protected override void InternalProcessRecord()
        {
            MigrationBatchDataProvider batchProvider = (MigrationBatchDataProvider)base.DataSession;

            try
            {
                MigrationHelper.RunUpdateOperation(delegate
                {
                    if (this.Force)
                    {
                        batchProvider.MigrationJob.Delete(batchProvider.MailboxProvider, true);
                        return;
                    }
                    if (batchProvider.MigrationJob.IsPAW)
                    {
                        batchProvider.MigrationJob.SetMigrationFlags(batchProvider.MailboxProvider, MigrationFlags.Remove);
                        return;
                    }
                    batchProvider.MigrationJob.RemoveJob(batchProvider.MailboxProvider);
                });
            }
            catch (ObjectNotFoundException ex)
            {
                MigrationObjectTaskBase <MigrationBatchIdParameter> .WriteJobNotFoundError(this, this.Identity.RawIdentity, ex);
            }
            batchProvider.MigrationJob.ReportData.Append(Strings.MigrationReportJobRemoved(base.ExecutingUserIdentityName));
            MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, batchProvider.MailboxSession, base.CurrentOrganizationId, false, false);

            base.InternalProcessRecord();
        }
예제 #2
0
        protected override void InternalProcessRecord()
        {
            base.InternalProcessRecord();
            MigrationUserDataProvider migrationUserDataProvider = (MigrationUserDataProvider)base.DataSession;

            MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, migrationUserDataProvider.MailboxSession, base.CurrentOrganizationId, false, false);
        }
예제 #3
0
        protected override void InternalProcessRecord()
        {
            MigrationBatchDataProvider migrationBatchDataProvider = (MigrationBatchDataProvider)base.DataSession;

            migrationBatchDataProvider.MigrationJob.ReportData.Append(Strings.MigrationReportJobStarted(base.ExecutingUserIdentityName));
            if (migrationBatchDataProvider.MigrationJob.IsPAW)
            {
                migrationBatchDataProvider.MigrationJob.SetMigrationFlags(migrationBatchDataProvider.MailboxProvider, MigrationFlags.Start);
            }
            else
            {
                MigrationBatchFlags migrationBatchFlags = migrationBatchDataProvider.MigrationJob.BatchFlags;
                if (this.Validate)
                {
                    migrationBatchFlags |= MigrationBatchFlags.UseAdvancedValidation;
                }
                else
                {
                    migrationBatchFlags &= ~MigrationBatchFlags.UseAdvancedValidation;
                }
                MigrationObjectTaskBase <MigrationBatchIdParameter> .StartJob(this, migrationBatchDataProvider, migrationBatchDataProvider.MigrationJob, null, migrationBatchFlags);
            }
            MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, migrationBatchDataProvider.MailboxSession, base.CurrentOrganizationId, false, false);

            base.InternalProcessRecord();
        }
예제 #4
0
        protected override void InternalProcessRecord()
        {
            MigrationBatchDataProvider batchProvider = (MigrationBatchDataProvider)base.DataSession;
            bool      isPAW = batchProvider.MigrationJob.IsPAW;
            Exception ex    = null;

            try
            {
                if (isPAW)
                {
                    this.DataObject.CompleteAfter                = new DateTime?(DateTime.MinValue);
                    this.DataObject.CompleteAfterUTC             = new DateTime?(DateTime.MinValue);
                    this.DataObject.SubscriptionSettingsModified = (DateTime)ExDateTime.UtcNow;
                    MigrationHelper.RunUpdateOperation(delegate
                    {
                        batchProvider.MigrationJob.UpdateJob(batchProvider.MailboxProvider, false, this.DataObject);
                    });
                }
                else
                {
                    if (this.DataObject.MigrationType == MigrationType.PublicFolder)
                    {
                        this.VerifyLegacyPublicFolderDatabaseLocked();
                    }
                    MigrationHelper.RunUpdateOperation(delegate
                    {
                        batchProvider.MigrationJob.FinalizeJob(batchProvider.MailboxProvider, this.resolvedNotificationEmails);
                    });
                }
                batchProvider.MigrationJob.ReportData.Append(Strings.MigrationReportJobCompletedByUser(base.ExecutingUserIdentityName));
            }
            catch (InvalidOperationException ex2)
            {
                ex = ex2;
            }
            if (ex != null)
            {
                base.WriteError(new MigrationPermanentException(Strings.MigrationCannotBeCompleted, ex));
            }
            if (isPAW)
            {
                MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, batchProvider.MailboxSession, base.CurrentOrganizationId, false, false);
            }
            base.InternalProcessRecord();
        }
예제 #5
0
        protected override void InternalProcessRecord()
        {
            MigrationBatchDataProvider batchProvider = (MigrationBatchDataProvider)base.DataSession;

            if (batchProvider.MigrationJob.IsPAW)
            {
                batchProvider.MigrationJob.SetMigrationFlags(batchProvider.MailboxProvider, MigrationFlags.Stop);
            }
            else
            {
                MigrationHelper.RunUpdateOperation(delegate
                {
                    batchProvider.MigrationJob.StopJob(batchProvider.MailboxProvider, batchProvider.MigrationSession.Config, JobCancellationStatus.CancelledByUserRequest);
                });
            }
            MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, batchProvider.MailboxSession, base.CurrentOrganizationId, false, false);

            base.InternalProcessRecord();
        }
예제 #6
0
        protected override void InternalProcessRecord()
        {
            MigrationBatchDataProvider batchProvider = (MigrationBatchDataProvider)base.DataSession;
            bool flag         = batchProvider.MigrationSession.Config.IsSupported(MigrationFeature.PAW);
            bool flag2        = false;
            bool updateEmails = false;
            bool flag3        = false;
            bool flag4        = false;

            if (flag && this.ReportInterval != null)
            {
                this.DataObject.ReportInterval = new TimeSpan?(this.ReportInterval.Value);
                flag2 = true;
            }
            if (base.Fields.IsModified("NotificationEmails"))
            {
                MultiValuedProperty <SmtpAddress> updatedNotificationEmails = MigrationObjectTaskBase <MigrationBatchIdParameter> .GetUpdatedNotificationEmails(this, base.TenantGlobalCatalogSession, this.NotificationEmails);

                if (updatedNotificationEmails != null && updatedNotificationEmails.Count != 0)
                {
                    this.DataObject.NotificationEmails = updatedNotificationEmails;
                    flag2        = true;
                    updateEmails = true;
                }
            }
            if (base.Fields.IsModified("AllowUnknownColumnsInCsv"))
            {
                this.DataObject.AllowUnknownColumnsInCsv = this.AllowUnknownColumnsInCsv;
                flag2 = true;
            }
            if (this.CSVData != null)
            {
                this.InternalProcessCsv(batchProvider);
                flag2 = true;
            }
            if (this.AllowIncrementalSyncs != null)
            {
                if (!this.AllowIncrementalSyncs.Value)
                {
                    this.DataObject.BatchFlags |= MigrationBatchFlags.AutoStop;
                }
                else
                {
                    this.DataObject.BatchFlags &= ~MigrationBatchFlags.AutoStop;
                }
                flag2 = true;
            }
            if (base.IsFieldSet("UseAdvancedValidation"))
            {
                if (this.UseAdvancedValidation)
                {
                    this.DataObject.BatchFlags |= MigrationBatchFlags.UseAdvancedValidation;
                }
                else
                {
                    this.DataObject.BatchFlags &= ~MigrationBatchFlags.UseAdvancedValidation;
                }
                flag2 = true;
            }
            if (this.AutoRetryCount != null)
            {
                this.DataObject.AutoRetryCount = this.AutoRetryCount;
                flag2 = true;
            }
            if (base.IsFieldSet("BadItemLimit") && !this.BadItemLimit.Equals(this.DataObject.BadItemLimit))
            {
                this.DataObject.BadItemLimit = this.BadItemLimit;
                flag3 = true;
                flag2 = true;
            }
            if (base.IsFieldSet("LargeItemLimit") && !this.LargeItemLimit.Equals(this.DataObject.LargeItemLimit))
            {
                this.DataObject.LargeItemLimit = this.LargeItemLimit;
                flag3 = true;
                flag2 = true;
            }
            if (base.IsFieldSet("StartAfter"))
            {
                this.DataObject.StartAfter    = this.StartAfter;
                this.DataObject.StartAfterUTC = (DateTime?)MigrationHelper.GetUniversalDateTime((ExDateTime?)this.StartAfter);
                flag3 = true;
                flag2 = true;
                flag4 = true;
            }
            if (base.IsFieldSet("CompleteAfter"))
            {
                DateTime?completeAfterUTC = (DateTime?)MigrationHelper.GetUniversalDateTime((ExDateTime?)this.CompleteAfter);
                this.DataObject.CompleteAfter    = this.CompleteAfter;
                this.DataObject.CompleteAfterUTC = completeAfterUTC;
                flag3 = true;
                flag2 = true;
                flag4 = true;
            }
            if (base.IsFieldSet("SourcePublicFolderDatabase"))
            {
                this.DataObject.SourcePublicFolderDatabase = this.SourcePublicFolderDatabase.RawIdentity;
                flag2 = true;
                flag4 = true;
                flag3 = true;
            }
            if (flag3)
            {
                this.DataObject.SubscriptionSettingsModified = (DateTime)ExDateTime.UtcNow;
            }
            if (flag2)
            {
                MigrationHelper.RunUpdateOperation(delegate
                {
                    batchProvider.MigrationJob.UpdateJob(batchProvider.MailboxProvider, updateEmails, this.DataObject);
                });
                batchProvider.MigrationJob.ReportData.Append(Strings.MigrationReportJobModifiedByUser(base.ExecutingUserIdentityName));
                this.changed = true;
                if (flag4)
                {
                    MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, batchProvider.MailboxSession, base.CurrentOrganizationId, false, false);
                }
            }
            base.InternalProcessRecord();
        }