Beispiel #1
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);
            }
        }
Beispiel #2
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);
        }