protected override void InternalProcessRecord()
        {
            MigrationSessionDataProvider migrationSessionDataProvider = (MigrationSessionDataProvider)base.DataSession;
            IMigrationDataProvider       mailboxProvider = migrationSessionDataProvider.MailboxProvider;

            if (this.IsFieldSet("MigrationFeature") && migrationSessionDataProvider.MigrationSession.EnableFeatures(mailboxProvider, this.Features))
            {
                this.changed = true;
            }
            MigrationConfig migrationConfig = migrationSessionDataProvider.MigrationSession.GetMigrationConfig(mailboxProvider);

            if (this.IsFieldSet("MaxNumberOfBatches") && this.MaxNumberOfBatches != migrationConfig.MaxNumberOfBatches)
            {
                migrationConfig.MaxNumberOfBatches = this.MaxNumberOfBatches;
                this.changed = true;
            }
            if (this.IsFieldSet("MaxConcurrentMigrations") && this.MaxConcurrentMigrations != migrationConfig.MaxConcurrentMigrations)
            {
                migrationConfig.MaxConcurrentMigrations = this.MaxConcurrentMigrations;
                this.changed = true;
            }
            if (this.changed)
            {
                migrationSessionDataProvider.MigrationSession.SetMigrationConfig(mailboxProvider, migrationConfig);
            }
            base.InternalProcessRecord();
        }
Exemple #2
0
        protected override void InternalProcessRecord()
        {
            MigrationSessionDataProvider migrationSessionDataProvider = (MigrationSessionDataProvider)base.DataSession;

            if (migrationSessionDataProvider.MigrationSession.HasJobs)
            {
                MigrationObjectTaskBase <MigrationBatchIdParameter> .RegisterMigrationBatch(this, migrationSessionDataProvider.MailboxSession, base.CurrentOrganizationId, false, false);
            }
            base.InternalProcessRecord();
        }
        protected override IConfigDataProvider CreateSession()
        {
            base.CurrentOrganizationId = this.ResolveCurrentOrganization();
            this.partitionMailbox      = MigrationObjectTaskBase <MigrationConfigIdParameter> .ResolvePartitionMailbox(this.Partition, base.TenantGlobalCatalogSession, base.ServerSettings, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.ErrorLoggerDelegate(base.WriteError), base.CurrentOrganizationId == OrganizationId.ForestWideOrgId && MapiTaskHelper.IsDatacenter);

            TenantPartitionHint partitionHint = TenantPartitionHint.FromOrganizationId(base.CurrentOrganizationId);

            MigrationLogger.Initialize();
            MigrationLogContext.Current.Source       = "Set-MigrationConfig";
            MigrationLogContext.Current.Organization = base.CurrentOrganizationId.OrganizationalUnit;
            return(MigrationSessionDataProvider.CreateDataProvider("SetMigrationConfig", MigrationHelperBase.CreateRecipientSession(partitionHint), this.partitionMailbox));
        }
Exemple #4
0
        protected override IConfigDataProvider CreateSession()
        {
            MigrationLogger.Initialize();
            MigrationLogContext.Current.Source       = "Get-MigrationSession";
            MigrationLogContext.Current.Organization = base.CurrentOrganizationId.OrganizationalUnit;
            MigrationSessionDataProvider migrationSessionDataProvider = MigrationSessionDataProvider.CreateDataProvider(this.Action, base.TenantGlobalCatalogSession, this.partitionMailbox);

            if (base.Diagnostic || !string.IsNullOrEmpty(base.DiagnosticArgument))
            {
                migrationSessionDataProvider.EnableDiagnostics(base.DiagnosticArgument);
            }
            return(migrationSessionDataProvider);
        }
        protected override void InternalValidate()
        {
            MigrationSessionDataProvider migrationSessionDataProvider = (MigrationSessionDataProvider)base.DataSession;

            if (this.IsFieldSet("MigrationFeature"))
            {
                migrationSessionDataProvider.MigrationSession.CheckFeaturesAvailableToUpgrade(this.Features);
            }
            if (this.IsFieldSet("MaxConcurrentMigrations"))
            {
                ValidationError validationError = MigrationConstraints.MaxConcurrentMigrationsConstraint.Validate(this.MaxConcurrentMigrations, MigrationBatchMessageSchema.MigrationJobMaxConcurrentMigrations, null);
                if (validationError != null)
                {
                    this.WriteError(new MigrationMaxConcurrentConnectionsVerificationFailedException(this.MaxConcurrentMigrations.Value.ToString(), MigrationConstraints.MaxConcurrentMigrationsConstraint.MinimumValue.ToString(), MigrationConstraints.MaxConcurrentMigrationsConstraint.MaximumValue.ToString()));
                }
            }
            base.InternalValidate();
        }
 protected override bool IsKnownException(Exception exception)
 {
     return(MigrationSessionDataProvider.IsKnownException(exception) || base.IsKnownException(exception));
 }
        protected override IConfigurable PrepareDataObject()
        {
            MigrationSessionDataProvider migrationSessionDataProvider = (MigrationSessionDataProvider)base.DataSession;

            return(migrationSessionDataProvider.MigrationSession.GetMigrationConfig(migrationSessionDataProvider.MailboxProvider));
        }