Esempio n. 1
0
        public bool Insert(int index, SASProfile obj)
        {
            System.Diagnostics.Debug.Assert(obj != null);

            if (index < 0 || index >= totalCnt)
            {
                return(false);
            }

            this.lstSASProfile[index].DeepCopyFrom(obj);

            return(true);
        }
Esempio n. 2
0
        public void DeepCopyFrom(ProfileUpdateReqData src)
        {
            System.Diagnostics.Debug.Assert(this != null);
            System.Diagnostics.Debug.Assert(src != null);

            this.reqEventID = src.reqEventID;
            this.totalCnt   = src.totalCnt;
            this.mode       = src.mode;
            this.lstSASProfile.Clear();
            foreach (SASProfile profile in src.lstSASProfile)
            {
                SASProfile copyProfile = new SASProfile();
                copyProfile.DeepCopyFrom(profile);
                this.lstSASProfile.Add(copyProfile);
            }
        }
Esempio n. 3
0
 public bool IsAllSet()
 {
     for (int index = 0; index < this.totalCnt; index++)
     {
         SASProfile system = this.lstSASProfile[index];
         if (string.IsNullOrEmpty(system.ID))
         {
             return(false);
         }
         if (string.IsNullOrEmpty(system.Name))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 4
0
        /// <summary>
        /// CAP 메시지로부터 발령 대상 시스템 정보를 추출.
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public List <SASProfile> ExtractTargetSystemsFromCAP(CAP msg)
        {
            System.Diagnostics.Debug.Assert(msg != null);
            System.Diagnostics.Debug.Assert(msg.Info != null);

            if (msg.Scope != CAPLib.ScopeType.Private)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(msg.Addresses))
            {
                return(null);
            }

            List <SASProfile> profileInfo = DBManager.GetInstance().QuerySASInfo();

            if (profileInfo == null || profileInfo.Count < 1)
            {
                return(null);
            }

            string[] stringSeperators = new string[] { "," };
            string[] dividedArray     = msg.Addresses.Split(stringSeperators, StringSplitOptions.RemoveEmptyEntries);
            if (dividedArray == null || dividedArray.Count() <= 0)
            {
                return(null);
            }

            List <SASProfile> targets = new List <SASProfile>();

            foreach (string systemIP in dividedArray)
            {
                foreach (SASProfile profile in profileInfo)
                {
                    if (profile.IpAddress == systemIP)
                    {
                        SASProfile copy = new SASProfile();
                        copy.DeepCopyFrom(profile);
                        targets.Add(copy);
                        break;
                    }
                }
            }

            return(targets);
        }
Esempio n. 5
0
        public ProfileUpdateReqData(uint requestID, uint totalCount, ProfileUpdateMode mode)
        {
            if (totalCount <= 0)
            {
                FileLogManager.GetInstance().WriteLog("[DataSyncInfo] ProfileUpdateReqData ( Invalid Total Count. )");

                throw new Exception("Invalid Total Count.");
            }

            this.reqEventID = requestID;
            this.totalCnt   = totalCount;
            this.mode       = mode;

            this.lstSASProfile = new List <SASProfile>((int)totalCount);
            for (int index = 0; index < totalCount; index++)
            {
                SASProfile system = new SASProfile();
                this.lstSASProfile.Add(system);
            }
        }
        public bool DeepCopyFrom(SASProfile src)
        {
            if (src == null)
            {
                return(false);
            }
            this.identifier             = src.identifier;
            this.name                   = src.name;
            this.authCode               = src.authCode;
            this.kindCode               = src.kindCode;
            this.ipType                 = src.ipType;
            this.ipAddress              = src.ipAddress;
            this.latitude               = src.latitude;
            this.longitude              = src.longitude;
            this.assignedIAGWRegionCode = src.assignedIAGWRegionCode;
            this.address                = src.address;
            this.managerName            = src.managerName;
            this.managerDepartment      = src.managerDepartment;
            this.managerPhone           = src.managerPhone;

            return(true);
        }