شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة ش.ش.و.

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Msmq

Public general use code classes and xml files that we've compiled and used over the years:

MSMQ support class for Next Generation Network (NGN) data model.

   1:  using System.Collections.Generic;
   2:   
   3:  namespace Ia.Ngn.Cl.Model.Data
   4:  {
   5:      ////////////////////////////////////////////////////////////////////////////
   6:   
   7:      /// <summary publish="true">
   8:      /// MSMQ support class for Next Generation Network (NGN) data model.
   9:      /// </summary>
  10:      /// 
  11:      /// <remarks> 
  12:      /// Copyright © 2018-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  13:      ///
  14:      /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
  15:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  16:      ///
  17:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  18:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  19:      /// 
  20:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  21:      /// 
  22:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  23:      /// </remarks> 
  24:      public abstract partial class Msmq
  25:      {
  26:          ////////////////////////////////////////////////////////////////////////////
  27:   
  28:          /// <summary>
  29:          ///
  30:          /// </summary>
  31:          public class Queue
  32:          {
  33:              // I can't use properties from child classes in virtual function in parents
  34:              // there is a reason why I can't construct a virtual abstract method
  35:          }
  36:   
  37:          ////////////////////////////////////////////////////////////////////////////
  38:   
  39:          /// <summary>
  40:          ///
  41:          /// </summary>
  42:          public abstract class ServiceQueue : Queue
  43:          {
  44:              protected static readonly string serviceApplicationQueueName = "msmq/data/default/queue/service/service-application";
  45:              protected static readonly string netManagerApplicationQueueName = "msmq/data/default/queue/service/net-manager-application";
  46:              protected static readonly string serviceRequestApplicationQueueName = "msmq/data/default/queue/service/service-request-application";
  47:              protected static readonly string spsApplicationQueueName = "msmq/data/default/queue/service/sps-application";
  48:              protected static readonly string axeApplicationQueueName = "msmq/data/default/queue/service/axe-application";
  49:   
  50:              ////////////////////////////////////////////////////////////////////////////
  51:   
  52:              /// <summary>
  53:              ///
  54:              /// </summary>
  55:              public static void Enqueue(string service)
  56:              {
  57:                  Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor;
  58:                  Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Pstn pstn;
  59:   
  60:                  if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceRequestApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(serviceRequestApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceRequestApplication.Process.Read.ToString(), service);
  61:   
  62:                  switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
  63:   
  64:                  if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia || switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
  65:                  {
  66:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(serviceApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceApplication.Process.Read.ToString(), service);
  67:                  }
  68:   
  69:                  // if service belongs to PSTN:
  70:                  if (Ia.Ngn.Cl.Model.Data.Service.ServiceIsWithinPstnDomainList(service))
  71:                  {
  72:                      // test to see if service is in Siemens EWSD or Ericsson AXE
  73:                      pstn = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.PstnFromService(service);
  74:   
  75:                      if (pstn.PstnExchangeType == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.PstnExchangeType.SiemensEwsd)
  76:                      {
  77:                          if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.NetManagerApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(netManagerApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.NetManagerApplication.Process.Read.ToString(), service);
  78:                      }
  79:                      else if (pstn.PstnExchangeType == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.PstnExchangeType.EricssonAxe)
  80:                      {
  81:                          if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.AxeApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(axeApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.AxeApplication.Process.Read.ToString(), service);
  82:                      }
  83:                      else
  84:                      {
  85:   
  86:                      }
  87:   
  88:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.SpsApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(spsApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.SpsApplication.Process.Read.ToString(), service);
  89:                  }
  90:              }
  91:   
  92:              ////////////////////////////////////////////////////////////////////////////
  93:   
  94:              /// <summary>
  95:              ///
  96:              /// </summary>
  97:              public abstract class ServiceApplication
  98:              {
  99:                  private static readonly string queueName = serviceApplicationQueueName;
 100:   
 101:                  public enum Process { Create = 1, Read, Update, Delete };
 102:   
 103:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 104:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 105:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 106:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 107:              }
 108:   
 109:              ////////////////////////////////////////////////////////////////////////////
 110:   
 111:              /// <summary>
 112:              ///
 113:              /// </summary>
 114:              public abstract class NetManagerApplication
 115:              {
 116:                  private static readonly string queueName = netManagerApplicationQueueName;
 117:   
 118:                  public enum Process { Create = 1, Read, Update, Delete };
 119:   
 120:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 121:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 122:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 123:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 124:              }
 125:   
 126:              ////////////////////////////////////////////////////////////////////////////
 127:   
 128:              /// <summary>
 129:              ///
 130:              /// </summary>
 131:              public abstract class ServiceRequestApplication
 132:              {
 133:                  private static readonly string queueName = serviceRequestApplicationQueueName;
 134:   
 135:                  public enum Process { Create = 1, Read, Update, Delete };
 136:   
 137:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 138:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 139:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 140:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 141:              }
 142:   
 143:              ////////////////////////////////////////////////////////////////////////////
 144:   
 145:              /// <summary>
 146:              ///
 147:              /// </summary>
 148:              public abstract class SpsApplication
 149:              {
 150:                  private static readonly string queueName = spsApplicationQueueName;
 151:   
 152:                  public enum Process { Create = 1, Read, Update, Delete };
 153:   
 154:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 155:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 156:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 157:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 158:              }
 159:   
 160:              ////////////////////////////////////////////////////////////////////////////
 161:   
 162:              /// <summary>
 163:              ///
 164:              /// </summary>
 165:              public abstract class AxeApplication
 166:              {
 167:                  private static readonly string queueName = axeApplicationQueueName;
 168:   
 169:                  public enum Process { Create = 1, Read, Update, Delete };
 170:   
 171:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 172:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 173:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 174:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 175:              }
 176:   
 177:              ////////////////////////////////////////////////////////////////////////////
 178:              ////////////////////////////////////////////////////////////////////////////
 179:   
 180:              /// <summary>
 181:              ///
 182:              /// </summary>
 183:              public abstract class ServiceSuspensionQueue
 184:              {
 185:                  protected static readonly string provisionApplicationQueueName = "msmq/data/default/queue/service/service-suspension/provision-application";
 186:   
 187:                  public enum Process { Create = 1, Read, Update, Delete };
 188:   
 189:                  ////////////////////////////////////////////////////////////////////////////
 190:   
 191:                  /// <summary>
 192:                  ///
 193:                  /// </summary>
 194:                  public static void Enqueue(string service)
 195:                  {
 196:                      Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor;
 197:   
 198:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceRequestApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(serviceRequestApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceRequestApplication.Process.Read.ToString(), service);
 199:   
 200:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceSuspensionQueue.ProvisionApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(provisionApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceSuspensionQueue.ProvisionApplication.Process.Update.ToString(), service);
 201:   
 202:                      switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 203:   
 204:                      if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia || switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 205:                      {
 206:                          if (!Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceApplication.List.Contains(service)) Ia.Cl.Model.Msmq.SendPrivate(serviceApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceApplication.Process.Read.ToString(), service);
 207:                      }
 208:                  }
 209:   
 210:                  ////////////////////////////////////////////////////////////////////////////
 211:   
 212:                  /// <summary>
 213:                  ///
 214:                  /// </summary>
 215:                  public abstract class ProvisionApplication
 216:                  {
 217:                      private static readonly string queueName = provisionApplicationQueueName;
 218:   
 219:                      public enum Process { Create = 1, Read, Update, Delete };
 220:   
 221:                      public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 222:                      public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 223:                      public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 224:                      public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 225:                  }
 226:   
 227:                  ////////////////////////////////////////////////////////////////////////////
 228:                  ////////////////////////////////////////////////////////////////////////////
 229:              }
 230:   
 231:              ////////////////////////////////////////////////////////////////////////////
 232:              ////////////////////////////////////////////////////////////////////////////
 233:          }
 234:   
 235:          ////////////////////////////////////////////////////////////////////////////
 236:          ////////////////////////////////////////////////////////////////////////////
 237:   
 238:   
 239:   
 240:   
 241:   
 242:   
 243:          ////////////////////////////////////////////////////////////////////////////
 244:          ////////////////////////////////////////////////////////////////////////////
 245:   
 246:          /// <summary>
 247:          ///
 248:          /// </summary>
 249:          public abstract class AccessNameQueue : Queue
 250:          {
 251:              protected static readonly string amsApplicationQueueName = "msmq/data/default/queue/access-name/ams-application";
 252:              protected static readonly string u2000ApplicationQueueName = "msmq/data/default/queue/access-name/u2000-application";
 253:   
 254:              public enum Process { Create = 1, Read, Update, Delete };
 255:   
 256:              ////////////////////////////////////////////////////////////////////////////
 257:   
 258:              /// <summary>
 259:              ///
 260:              /// </summary>
 261:              public static void Enqueue(string accessName)
 262:              {
 263:                  Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor accessVendor;
 264:   
 265:                  accessVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AccessVendorByAccessName(accessName);
 266:   
 267:                  if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 268:                  {
 269:                      // I will check if the items is in the list, if not I will enqueue
 270:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.List.Contains(accessName))
 271:                      {
 272:                          Ia.Cl.Model.Msmq.SendPrivate(amsApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.Process.Read.ToString(), accessName);
 273:                      }
 274:                  }
 275:                  else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 276:                  {
 277:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.List.Contains(accessName))
 278:                      {
 279:                          Ia.Cl.Model.Msmq.SendPrivate(u2000ApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.Process.Read.ToString(), accessName);
 280:                      }
 281:                  }
 282:              }
 283:   
 284:              ////////////////////////////////////////////////////////////////////////////
 285:   
 286:              /// <summary>
 287:              ///
 288:              /// </summary>
 289:              public static void Enqueue(Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.Process process, string accessName)
 290:              {
 291:                  Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor accessVendor;
 292:   
 293:                  accessVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AccessVendorByAccessName(accessName);
 294:   
 295:                  if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 296:                  {
 297:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.List.Contains(accessName))
 298:                      {
 299:                          Ia.Cl.Model.Msmq.SendPrivate(amsApplicationQueueName, process.ToString(), accessName);
 300:                      }
 301:                  }
 302:                  else
 303:                  {
 304:                  }
 305:              }
 306:   
 307:              ////////////////////////////////////////////////////////////////////////////
 308:   
 309:              /// <summary>
 310:              ///
 311:              /// </summary>
 312:              public static void Enqueue(Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.Process process, string accessName)
 313:              {
 314:                  Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor accessVendor;
 315:   
 316:                  accessVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AccessVendorByAccessName(accessName);
 317:   
 318:                  if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 319:                  {
 320:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.List.Contains(accessName))
 321:                      {
 322:                          Ia.Cl.Model.Msmq.SendPrivate(u2000ApplicationQueueName, process.ToString(), accessName);
 323:                      }
 324:                  }
 325:                  else
 326:                  {
 327:   
 328:                  }
 329:              }
 330:   
 331:              ////////////////////////////////////////////////////////////////////////////
 332:   
 333:              /// <summary>
 334:              ///
 335:              /// </summary>
 336:              public abstract class AmsApplication
 337:              {
 338:                  private static readonly string queueName = amsApplicationQueueName;
 339:   
 340:                  public enum Process { Create = 1, Read, Update, Delete };
 341:   
 342:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 343:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 344:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 345:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 346:              }
 347:   
 348:              ////////////////////////////////////////////////////////////////////////////
 349:   
 350:              /// <summary>
 351:              ///
 352:              /// </summary>
 353:              public abstract class U2000Application
 354:              {
 355:                  private static readonly string queueName = u2000ApplicationQueueName;
 356:   
 357:                  public enum Process { Create = 1, Read, Update, Delete, Reset };
 358:   
 359:                  public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 360:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 361:                  public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 362:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 363:              }
 364:   
 365:              ////////////////////////////////////////////////////////////////////////////
 366:              ////////////////////////////////////////////////////////////////////////////
 367:   
 368:              /// <summary>
 369:              ///
 370:              /// </summary>
 371:              public abstract class ProvisionAccessQueue
 372:              {
 373:                  protected static readonly string provisionApplicationQueueName = "msmq/data/default/queue/access-name/provision-access/provision-application";
 374:                  protected static readonly string serviceRequestApplicationQueueName = "msmq/data/default/queue/access-name/provision-access/service-request-application";
 375:   
 376:                  public enum Process { Create = 1, Read, Update, Delete };
 377:   
 378:                  ////////////////////////////////////////////////////////////////////////////
 379:   
 380:                  /// <summary>
 381:                  ///
 382:                  /// </summary>
 383:                  public static void Enqueue(string accessName)
 384:                  {
 385:                      Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor accessVendor;
 386:   
 387:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.ProvisionAccessQueue.ProvisionApplication.List.Contains(accessName))
 388:                      {
 389:                          Ia.Cl.Model.Msmq.SendPrivate(provisionApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.ProvisionAccessQueue.ProvisionApplication.Process.Read.ToString(), accessName);
 390:                      }
 391:   
 392:                      if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.ProvisionAccessQueue.ServiceRequestApplication.List.Contains(accessName))
 393:                      {
 394:                          Ia.Cl.Model.Msmq.SendPrivate(serviceRequestApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.ProvisionAccessQueue.ServiceRequestApplication.Process.Update.ToString(), accessName);
 395:                      }
 396:   
 397:                      accessVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AccessVendorByAccessName(accessName);
 398:   
 399:                      if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 400:                      {
 401:                          if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.List.Contains(accessName))
 402:                          {
 403:                              Ia.Cl.Model.Msmq.SendPrivate(amsApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.AmsApplication.Process.Read.ToString(), accessName);
 404:                          }
 405:                      }
 406:                      else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 407:                      {
 408:                          if (!Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.List.Contains(accessName))
 409:                          {
 410:                              Ia.Cl.Model.Msmq.SendPrivate(u2000ApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.U2000Application.Process.Read.ToString(), accessName);
 411:                          }
 412:                      }
 413:                  }
 414:   
 415:                  ////////////////////////////////////////////////////////////////////////////
 416:   
 417:                  /// <summary>
 418:                  ///
 419:                  /// </summary>
 420:                  public abstract class ProvisionApplication
 421:                  {
 422:                      private static readonly string queueName = provisionApplicationQueueName;
 423:   
 424:                      public enum Process { Create = 1, Read, Update, Delete };
 425:   
 426:                      public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 427:                      public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 428:                      public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 429:                      public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 430:                  }
 431:   
 432:                  ////////////////////////////////////////////////////////////////////////////
 433:   
 434:                  /// <summary>
 435:                  ///
 436:                  /// </summary>
 437:                  public abstract class ServiceRequestApplication
 438:                  {
 439:                      private static readonly string queueName = serviceRequestApplicationQueueName;
 440:   
 441:                      public enum Process { Create = 1, Read, Update, Delete };
 442:   
 443:                      public static string Dequeue { get { Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body); return body; } }
 444:                      public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 445:                      public static List<string> List { get { return Ia.Cl.Model.Msmq.PeekPrivateList(queueName); } }
 446:                      public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 447:                  }
 448:   
 449:                  ////////////////////////////////////////////////////////////////////////////
 450:                  ////////////////////////////////////////////////////////////////////////////
 451:              }
 452:   
 453:              ////////////////////////////////////////////////////////////////////////////
 454:              ////////////////////////////////////////////////////////////////////////////
 455:          }
 456:   
 457:          ////////////////////////////////////////////////////////////////////////////
 458:          ////////////////////////////////////////////////////////////////////////////
 459:   
 460:          /// <summary>
 461:          ///
 462:          /// </summary>
 463:          public abstract class GatewayIdQueue : Queue
 464:          {
 465:              protected static readonly string serviceApplicationQueueName = "msmq/data/default/queue/gatewayId/service-application";
 466:   
 467:              ////////////////////////////////////////////////////////////////////////////
 468:   
 469:              /// <summary>
 470:              ///
 471:              /// </summary>
 472:              public static void Enqueue(int gatewayId)
 473:              {
 474:                  // I will check if the items is in the list, if not I will enqueue
 475:                  if (!Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.ServiceApplication.List.Contains(gatewayId)) Ia.Cl.Model.Msmq.SendPrivate(serviceApplicationQueueName, Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.ServiceApplication.Process.Read.ToString(), gatewayId.ToString());
 476:              }
 477:   
 478:              ////////////////////////////////////////////////////////////////////////////
 479:   
 480:              /// <summary>
 481:              ///
 482:              /// </summary>
 483:              public abstract class ServiceApplication
 484:              {
 485:                  private static readonly string queueName = serviceApplicationQueueName;
 486:   
 487:                  public enum Process { Create = 1, Read, Update, Delete };
 488:   
 489:                  ////////////////////////////////////////////////////////////////////////////
 490:   
 491:                  /// <summary>
 492:                  ///
 493:                  /// </summary>
 494:                  public static int Dequeue
 495:                  {
 496:                      get
 497:                      {
 498:                          Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body);
 499:   
 500:                          int.TryParse(body, out int gatewayId);
 501:   
 502:                          return gatewayId;
 503:                      }
 504:                  }
 505:   
 506:                  public static string Peek { get { Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body); return body; } }
 507:                  public static List<int> List
 508:                  {
 509:                      get
 510:                      {
 511:                          List<int> gatewayIdList;
 512:   
 513:                          gatewayIdList = new List<int>();
 514:   
 515:                          foreach (string s in Ia.Cl.Model.Msmq.PeekPrivateList(queueName))
 516:                          {
 517:                              if (int.TryParse(s, out int gatewayId)) gatewayIdList.Add(gatewayId);
 518:                          }
 519:   
 520:                          return gatewayIdList;
 521:                      }
 522:                  }
 523:                  public static long Count { get { return Ia.Cl.Model.Msmq.Count(queueName); } }
 524:              }
 525:   
 526:              ////////////////////////////////////////////////////////////////////////////
 527:              ////////////////////////////////////////////////////////////////////////////
 528:          }
 529:   
 530:          ////////////////////////////////////////////////////////////////////////////
 531:          ////////////////////////////////////////////////////////////////////////////
 532:   
 533:          /// <summary>
 534:          ///
 535:          /// </summary>
 536:          public abstract class System : Queue
 537:          {
 538:              protected static readonly string queueName = "msmq/data/default/queue/system";
 539:   
 540:              ////////////////////////////////////////////////////////////////////////////
 541:   
 542:              /// <summary>
 543:              ///
 544:              /// </summary>
 545:              public static void Enqueue(string sender, string message)
 546:              {
 547:                  Ia.Cl.Model.Msmq.SendPrivate(queueName, sender, message);
 548:              }
 549:   
 550:              ////////////////////////////////////////////////////////////////////////////
 551:   
 552:              /// <summary>
 553:              ///
 554:              /// </summary>
 555:              public static string Dequeue
 556:              {
 557:                  get
 558:                  {
 559:                      Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body);
 560:   
 561:                      return body;
 562:                  }
 563:              }
 564:   
 565:              ////////////////////////////////////////////////////////////////////////////
 566:   
 567:              /// <summary>
 568:              ///
 569:              /// </summary>
 570:              public static string Peek
 571:              {
 572:                  get
 573:                  {
 574:                      Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body);
 575:   
 576:                      return body;
 577:                  }
 578:              }
 579:   
 580:              ////////////////////////////////////////////////////////////////////////////
 581:   
 582:              /// <summary>
 583:              ///
 584:              /// </summary>
 585:              public static List<string> List
 586:              {
 587:                  get
 588:                  {
 589:                      List<string> list;
 590:   
 591:                      list = new List<string>();
 592:   
 593:                      foreach (string s in Ia.Cl.Model.Msmq.PeekPrivateList(queueName)) list.Add(s);
 594:   
 595:                      return list;
 596:                  }
 597:              }
 598:   
 599:              ////////////////////////////////////////////////////////////////////////////
 600:   
 601:              /// <summary>
 602:              ///
 603:              /// </summary>
 604:              public static long Count
 605:              {
 606:                  get
 607:                  {
 608:                      return Ia.Cl.Model.Msmq.Count(queueName);
 609:                  }
 610:              }
 611:   
 612:              ////////////////////////////////////////////////////////////////////////////
 613:              ////////////////////////////////////////////////////////////////////////////
 614:          }
 615:   
 616:          ////////////////////////////////////////////////////////////////////////////
 617:          ////////////////////////////////////////////////////////////////////////////
 618:   
 619:   
 620:   
 621:   
 622:          ////////////////////////////////////////////////////////////////////////////
 623:          ////////////////////////////////////////////////////////////////////////////
 624:   
 625:          /// <summary>
 626:          ///
 627:          /// </summary>
 628:          public sealed class NewAccessFlag
 629:          {
 630:              private const string queueName = "msmq/data/default/flag/new-access";
 631:   
 632:              /// <summary/>
 633:              public static void Set()
 634:              {
 635:                  Ia.Cl.Model.Msmq.SendPrivate(queueName, "set", true.ToString());
 636:              }
 637:   
 638:              /// <summary/>
 639:              public static void Reset()
 640:              {
 641:                  Ia.Cl.Model.Msmq.SendPrivate(queueName, "reset", false.ToString());
 642:              }
 643:   
 644:              /// <summary/>
 645:              public static bool Read
 646:              {
 647:                  get
 648:                  {
 649:                      bool b;
 650:   
 651:                      Ia.Cl.Model.Msmq.RecievePrivate(queueName, out string label, out string body);
 652:   
 653:                      b = bool.TryParse(body.ToString(), out b) ? b : false;
 654:   
 655:                      return b;
 656:                  }
 657:              }
 658:   
 659:              /// <summary/>
 660:              public static bool Peek
 661:              {
 662:                  get
 663:                  {
 664:                      bool b;
 665:   
 666:                      Ia.Cl.Model.Msmq.PeekPrivate(queueName, out string label, out string body);
 667:   
 668:                      b = bool.TryParse(body.ToString(), out b) ? b : false;
 669:   
 670:                      return b;
 671:                  }
 672:              }
 673:          }
 674:   
 675:          ////////////////////////////////////////////////////////////////////////////
 676:          ////////////////////////////////////////////////////////////////////////////
 677:      }
 678:  }