Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » EmsPort

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

Huawei's EMS Port Entity Framework class for Next Generation Network (NGN) entity model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.ComponentModel.DataAnnotations;
   4:  using System.ComponentModel.DataAnnotations.Schema;
   5:   
   6:  namespace Ia.Ngn.Cl.Model.Huawei
   7:  {
   8:      ////////////////////////////////////////////////////////////////////////////
   9:   
  10:      /// <summary publish="true">
  11:      /// Huawei's EMS Port Entity Framework class for Next Generation Network (NGN) entity model.
  12:      /// </summary>
  13:      /// 
  14:      /// <remarks> 
  15:      /// Copyright © 2016-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  16:      ///
  17:      /// 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
  18:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  19:      ///
  20:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  21:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  22:      /// 
  23:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  24:      /// 
  25:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  26:      /// </remarks> 
  27:      public partial class EmsPort
  28:      {
  29:          /*
  30:           * iManager_U2000_V200R014C60_TL1_NBI_User_Guide_13.pdf
  31:           * 14.1.10 Querying the Information About a Port (LST-PORT)
  32:           * 
  33:           * Usage Note
  34:           * 
  35:           * The DEV (IP address of an OLT) and ONULOCATEINFO parameters can be used as the location information. Before using these two parameters as the location information, make sure that the DEV parameter indicates the IP address of the device. For details, see C.7 How to Locate a Device According to the IP Address.
  36:           * 
  37:           * Command Format LST-PORT::[ALIAS=Port-Alias][,](DID=Device-ID|DEV=Device-name|(DEV=device-oltipaddress,ONULOCATEINFO=onu-locate-infomation))[,FN=Frame-num[,SN=Slotnum[,PN=Port-num]]][,PT=Port-type][,PSTAT=Port-status]:CTAG::[SHOWOPTION=option 
  38:           * 
  39:           */
  40:   
  41:          /// <summary/>
  42:          //public enum ServiceTypeList { IMPU = 1, TEMPLATEIDX, DSPIDX, LP, CSC, UNAME, VCCFLAG, VTFLAG, NSCFU, NSCFUVM, NSCFB, NSCFBVM, NSCFNR, NSCFNRVM, NSCFNL, NSCFNLVM, NSCD, NSCDVM, NSCFNRC, NSCFNRCVM, NSCLIP, NSCIDCW, NSRIO, NSCNIP, NSCLIR, NSRIP, NSCNIR, NSRID, NSNRID, NSRND, NSNRND, NSCW, NSCCW, NSOIP, NSACRM, NSGOIR, NSMOIR, NSTIP, NSTIR, NSOTIR, NSCLIPNOSCREENING, NSCR, NSWAKE_UP, NSAOC_D, NSAOC_E, NSXEXH, NSXEGJ, NSCWCFNR, NSIIFC, NSDN_CALL_OUT_BAR, NSCCBS, NSCCNR, NSCCBSR, NSCCNRR, NS3PTY, NSNPTY, NSDND, NSMCR, NSCBA, NSTMP_LIN, NSCODEC_CNTRL, NSMWI, NSDC, NSHOLD, NSECT, NSCFTB, NSDAN, NSSTOP_SECRET, NSMCID, NSEBO, NSICO, NSOUTG, NSINQYH, NSUINFO, NSDN_CALL_OUT_ALLOW, NSSIC, NSSOC, NSSETCFNRTIME, NSCFS, NSCFSB, NSFAX, NSABRC, NSACRTOVM, NSPREPAID, NSCRBT, NSICB, NSMRINGING, NSCIS, NSCBEG, NSCOLP, NSCOLR, NSCOLPOVR, NSBAOC, NSBOIC, NSBOICEXHC, NSBAIC, NSBICROM, NSSPEED_DIAL, NSSD1D, NSSD2D, NSGRNCALL, NSCPARK, NSGAA, NSQSNS, NSMSN, NSHOTLINE, NSAOC_S, NSNIGHTSRV, NSBACKNUM, NSAUTOCON, NSCAMPON, NSCTD, NSCLICKHOLD, NSQUEUE, NSSANSWER, NSICENCF, NSCFGO, NSCECT, NSCTGO, NSCTIO, NSSETBUSY, NSOVERSTEP, NSABSENT, NSMONITOR, NSFMONITOR, NSDISCNT, NSFDISCNT, NSINSERT, NSFINSERT, NSASI, NSPWCB, NSRD, NSLCPS, NSNCPS, NSICPS, NSCBCLOCK, NSMINIBAR, NSMCN, NSDSTR, NSOPRREG, NSONEKEY, NSINBOUND, NSOUTBOUND, NSCALLERID, NSCUN, NSIPTVVC, NSNP, NSSEC, NSSECSTA, NSHRCN, NSSB, NSOCCR, LCO, LC, LCT, NTT, ITT, ICTX, OCTX, INTT, IITT, ICLT, ICDDD, ICIDD, IOLT, CTLCO, CTLCT, CTLD, CTINTNANP, CTINTWORLD, CTDA, CTOSM, CTOSP, CTOSP1, CCO1, CCO2, CCO3, CCO4, CCO5, CCO6, CCO7, CCO8, CCO9, CCO10, CCO11, CCO12, CCO13, CCO14, CCO15, CCO16, HIGHENTCO, OPERATOR, SUPYSRV, IDDCI, NTCI, LTCI, RSC, CIG, OUTRST, INRST, NOAT, RINGCOUNT, VMAIND, VDMAIND, TGRP, TIDHLD, TIDCW, SCF, LMTGRP, FLBGRP, SLBGRP, COP, G711_64K_A_LAW, G711_64K_U_LAW, G722, G723, G726, G728, G729, CODEC_MP4A, CODEC2833, CODEC2198, G726_40, G726_32, G726_24, G726_16, AMR, CLEARMODE, ILBC, SPEEX, G729EV, EVRC, EVRCB, H261, H263, CODEC_MP4V, H264, T38, T120, G711A_VBD, G711U_VBD, G726_VBD, G726_40_VBD, G726_32_VBD, G726_24_VBD, G726_16_VBD, WIND_BAND_AMR, GSM610, H263_2000, BROADVOICE_32, UNKNOWN_CODEC, ACODEC, VCODEC, POLIDX, NCPI, ICPI, EBOCL, EBOPL, EBOIT, RM, CPC, PCHG, TFPT, CHT, MCIDMODE, MCIDCMODE, MCIDAMODE, PREPAIDIDX, CRBTID, ODBBICTYPE, ODBBOCTYPE, ODBBARTYPE, ODBSS, ODBBRCFTYPE, PNOTI, MAXPARACALL, ATSDTMBUSY, CALLCOUNT, CDNOTICALLER, ISCHGFLAG, CHC, CUSER, CGRP, CUSERGRP, STCF, CHARSC, REGUIDX, SOCBFUNC, SOCBPTONEIDX, ADMINCBA, ADCONTROL_DIVERSION, DPR, PRON, CPCRUS, CUSCAT, SPT100REL }
  43:   
  44:          /// <summary/>
  45:          public EmsPort() { }
  46:   
  47:          /// <summary/>
  48:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  49:          public string Id { get; set; }
  50:   
  51:          /// <summary>
  52:          /// ALIAS OCTET STRING SIZE (64) Indicates the alias for the port.
  53:          /// </summary>
  54:          public string ALIAS { get; set; }
  55:   
  56:          /// <summary>
  57:          /// DID INTEGER - Indicates the device ID. 
  58:          /// </summary>
  59:          public int DID { get; set; }
  60:   
  61:          /// <summary>
  62:          /// FN INTEGER 0-255 Indicates the subrack ID. 
  63:          /// </summary>
  64:          public int FN { get; set; }
  65:   
  66:          /// <summary>
  67:          /// SN INTEGER 0-35 Indicates the slot ID. 
  68:          /// </summary>
  69:          public int SN { get; set; }
  70:   
  71:          /// <summary>
  72:          /// PN INTEGER 0-63 Indicates the port ID. 
  73:          /// </summary>
  74:          public int PN { get; set; }
  75:   
  76:          /// <summary>
  77:          /// PT OCTET STRING See D.4 Parameters Related To the Port Type. Indicates the type of the port. NA: If the displayed port type is not included in the list of port types, the character string "NA(subtype of the port)" is displayed. For example, if the BRUS type is not included in the list of port types, "NA(BRUS)" is displayed for the corresponding port. 
  78:          /// </summary>
  79:          public string PT { get; set; }
  80:   
  81:          /// <summary>
  82:          /// PSTAT OCTET STRING See D.5 Parameters Related To the Port Status. Indicates the status of the port. 
  83:          /// </summary>
  84:          public string PSTAT { get; set; }
  85:   
  86:          /// <summary>
  87:          /// NAME OCTET STRING SIZE (64) Indicates the port name. 
  88:          /// </summary>
  89:          public string NAME { get; set; }
  90:   
  91:          /// <summary>
  92:          /// PSPEED OCTET STRING SIZE (64) Indicates the port rate. Unit: bit/s. 
  93:          /// </summary>
  94:          public string PSPEED { get; set; }
  95:   
  96:          /// <summary>
  97:          /// PDIRECT OCTET STRING bidirectional Indicates the port direction. 
  98:          /// </summary>
  99:          public string PDIRECT { get; set; }
 100:   
 101:          /// <summary>
 102:          /// LOOPSTAT OCTET STRING l noLoop l remoteLoop l localLoop l unknown Indicates the loopback status of a port. Options are as follows: l noLoop: no loopback l remoteLoop: remote loopback l localLoop: local loopback l unknown: The loopback status is unknown. 
 103:          /// </summary>
 104:          public string LOOPSTAT { get; set; }
 105:   
 106:          /// <summary>
 107:          /// TESTSTAT OCTET STRING l noTest l Test l unknown Indicates the test status of a port.
 108:          /// </summary>
 109:          public string TESTSTAT { get; set; }
 110:   
 111:          /// <summary>
 112:          /// FEC OCTET STRING l enable l disable l unknown Specifies whether the forward error correction (FEC) function is enabled. 
 113:          /// </summary>
 114:          public string FEC { get; set; }
 115:   
 116:          /// <summary>
 117:          /// RN OCTET STRING SIZE (64) Indicates the rack identifier. 
 118:          /// </summary>
 119:          public string RN { get; set; }
 120:   
 121:          /// <summary>
 122:          /// AState OCTET STRING l up l down l testing Indicates the management status of a port. Options are as follows: l up: activated l down: deactivated
 123:          /// </summary>
 124:          public string AState { get; set; }
 125:   
 126:          /// <summary/>
 127:          public DateTime Created { get; set; }
 128:   
 129:          /// <summary/>
 130:          public DateTime Updated { get; set; }
 131:   
 132:          /// <summary/>
 133:          public virtual Ia.Ngn.Cl.Model.Huawei.EmsBoard EmsBoard { get; set; }
 134:   
 135:          /// <summary/>
 136:          public virtual ICollection<Ia.Ngn.Cl.Model.Huawei.EmsOnt> EmsOnts { get; set; }
 137:          
 138:          ////////////////////////////////////////////////////////////////////////////
 139:   
 140:          /// <summary>
 141:          ///
 142:          /// </summary>
 143:          public bool Equal(Ia.Ngn.Cl.Model.Huawei.EmsPort b)
 144:          {
 145:              // below: this will not check the Id, Created, Updated fields
 146:              bool areEqual;
 147:   
 148:              if (this.ALIAS != b.ALIAS) areEqual = false;
 149:              else if (this.DID != b.DID) areEqual = false;
 150:              else if (this.FN != b.FN) areEqual = false;
 151:              else if (this.SN != b.SN) areEqual = false;
 152:              else if (this.PN != b.PN) areEqual = false;
 153:              else if (this.PT != b.PT) areEqual = false;
 154:              else if (this.PSTAT != b.PSTAT) areEqual = false;
 155:              else if (this.NAME != b.NAME) areEqual = false;
 156:              else if (this.PSPEED != b.PSPEED) areEqual = false;
 157:              else if (this.PDIRECT != b.PDIRECT) areEqual = false;
 158:              else if (this.LOOPSTAT != b.LOOPSTAT) areEqual = false;
 159:              else if (this.TESTSTAT != b.TESTSTAT) areEqual = false;
 160:              else if (this.FEC != b.FEC) areEqual = false;
 161:              else if (this.RN != b.RN) areEqual = false;
 162:              else if (this.AState != b.AState) areEqual = false;
 163:              else if (this.EmsBoard.Id != b.EmsBoard.Id) areEqual = false;
 164:              else areEqual = true;
 165:   
 166:              return areEqual;
 167:          }
 168:   
 169:          ////////////////////////////////////////////////////////////////////////////
 170:   
 171:          /// <summary>
 172:          ///
 173:          /// </summary>
 174:          public bool Update(Ia.Ngn.Cl.Model.Huawei.EmsPort updatedItem)
 175:          {
 176:              // below: this will not update Id, Created
 177:              bool updated;
 178:   
 179:              updated = false;
 180:   
 181:              if (this.ALIAS != updatedItem.ALIAS) { this.ALIAS = updatedItem.ALIAS; updated = true; }
 182:              if (this.DID != updatedItem.DID) { this.DID = updatedItem.DID; updated = true; }
 183:              if (this.FN != updatedItem.FN) { this.FN = updatedItem.FN; updated = true; }
 184:              if (this.SN != updatedItem.SN) { this.SN = updatedItem.SN; updated = true; }
 185:              if (this.PN != updatedItem.PN) { this.PN = updatedItem.PN; updated = true; }
 186:              if (this.PT != updatedItem.PT) { this.PT = updatedItem.PT; updated = true; }
 187:              if (this.PSTAT != updatedItem.PSTAT) { this.PSTAT = updatedItem.PSTAT; updated = true; }
 188:              if (this.NAME != updatedItem.NAME) { this.NAME = updatedItem.NAME; updated = true; }
 189:              if (this.PSPEED != updatedItem.PSPEED) { this.PSPEED = updatedItem.PSPEED; updated = true; }
 190:              if (this.PDIRECT != updatedItem.PDIRECT) { this.PDIRECT = updatedItem.PDIRECT; updated = true; }
 191:              if (this.LOOPSTAT != updatedItem.LOOPSTAT) { this.LOOPSTAT = updatedItem.LOOPSTAT; updated = true; }
 192:              if (this.TESTSTAT != updatedItem.TESTSTAT) { this.TESTSTAT = updatedItem.TESTSTAT; updated = true; }
 193:              if (this.FEC != updatedItem.FEC) { this.FEC = updatedItem.FEC; updated = true; }
 194:              if (this.RN != updatedItem.RN) { this.RN = updatedItem.RN; updated = true; }
 195:              if (this.AState != updatedItem.AState) { this.AState = updatedItem.AState; updated = true; }
 196:              if (this.EmsBoard.Id != updatedItem.EmsBoard.Id) { this.EmsBoard = updatedItem.EmsBoard; updated = true; }
 197:   
 198:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 199:   
 200:              return updated;
 201:          }
 202:   
 203:          ////////////////////////////////////////////////////////////////////////////
 204:          ////////////////////////////////////////////////////////////////////////////
 205:      }
 206:   
 207:      ////////////////////////////////////////////////////////////////////////////
 208:      ////////////////////////////////////////////////////////////////////////////
 209:  }