Exemplo n.º 1
0
        /// <summary>
        /// Construct overall migration plan for a specified config
        /// </summary>
        /// <param name="migrationPlan"></param>
        public MigrationPlanMsg(MigrationPlan migrationPlan)
        {
            LegacyConfigId = migrationPlan.ConfigId;
            DeviceName     = migrationPlan.DeviceName;
            MigrationTimeEstimationInProgress = new MigrationPlanInfoMsgList(MigrationPlanStatus.InProgress);
            MigrationTimeEstimationNotStarted = new MigrationPlanInfoMsgList(MigrationPlanStatus.NotStarted);
            MigrationTimeEstimationCompleted  = new MigrationPlanInfoMsgList(MigrationPlanStatus.Completed);
            MigrationTimeEstimationFailed     = new MigrationPlanInfoMsgList(MigrationPlanStatus.Failed);

            foreach (var migrationPlanInfo in migrationPlan.MigrationPlanInfo)
            {
                MigrationPlanInfoMsg migrationPlanInfoMsg = new MigrationPlanInfoMsg(migrationPlanInfo);

                if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.InProgress)
                {
                    MigrationTimeEstimationInProgress.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.NotStarted)
                {
                    MigrationTimeEstimationNotStarted.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.Completed)
                {
                    MigrationTimeEstimationCompleted.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.Failed)
                {
                    MigrationTimeEstimationFailed.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
            }
        }
        /// <summary>
        /// Construct overall migration plan for a specified config
        /// </summary>
        /// <param name="migrationPlan"></param>
        public MigrationPlanMsg(MigrationPlan migrationPlan)
        {
            LegacyConfigId = migrationPlan.ConfigId;
            DeviceName = migrationPlan.DeviceName;
            MigrationTimeEstimationInProgress = new MigrationPlanInfoMsgList(MigrationPlanStatus.InProgress);
            MigrationTimeEstimationNotStarted = new MigrationPlanInfoMsgList(MigrationPlanStatus.NotStarted);
            MigrationTimeEstimationCompleted = new MigrationPlanInfoMsgList(MigrationPlanStatus.Completed);
            MigrationTimeEstimationFailed = new MigrationPlanInfoMsgList(MigrationPlanStatus.Failed);

            foreach (var migrationPlanInfo in migrationPlan.MigrationPlanInfo)
            {
                MigrationPlanInfoMsg migrationPlanInfoMsg = new MigrationPlanInfoMsg(migrationPlanInfo);

                if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.InProgress)
                {
                    MigrationTimeEstimationInProgress.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.NotStarted)
                {
                    MigrationTimeEstimationNotStarted.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.Completed)
                {
                    MigrationTimeEstimationCompleted.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
                else if (migrationPlanInfo.PlanStatus == MigrationPlanStatus.Failed)
                {
                    MigrationTimeEstimationFailed.MigrationTimeEstimationInfoList.Add(migrationPlanInfoMsg);
                }
            }
        }