示例#1
0
 private void ValidatePublicFolderParameters()
 {
     this.ValidateRemoteServerConstraint(this.RPCProxyServer, MigrationBatchMessageSchema.MigrationJobExchangeRPCProxyServerHostName, "RpcProxyServer");
     if (!LegacyDN.IsValidLegacyDN(this.SourceMailboxLegacyDN))
     {
         this.WriteError(new InvalidLegacyExchangeDnValueException("SourceMailboxLegacyDN"));
     }
     if (!LegacyDN.IsValidLegacyDN(this.PublicFolderDatabaseServerLegacyDN))
     {
         this.WriteError(new InvalidLegacyExchangeDnValueException("PublicFolderDatabaseServerLegacyDN"));
     }
     this.endpoint = new PublicFolderEndpoint
     {
         RpcProxyServer        = this.RPCProxyServer,
         AuthenticationMethod  = this.Authentication,
         SourceMailboxLegacyDN = this.SourceMailboxLegacyDN,
         PublicFolderDatabaseServerLegacyDN = this.PublicFolderDatabaseServerLegacyDN,
         Credentials = this.Credentials
     };
     this.targetMailbox = TestMigrationServerAvailability.DiscoverPublicFolderTestMailbox(this.TestMailbox, this.ConfigurationSession, this.RecipientSession, base.ServerSettings, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
 }
示例#2
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            bool          flag         = false;
            MigrationType endpointType = this.DataObject.EndpointType;

            if (endpointType <= MigrationType.ExchangeOutlookAnywhere)
            {
                if (endpointType == MigrationType.IMAP)
                {
                    this.WriteParameterErrorIfSet("Credentials");
                    this.WriteParameterErrorIfSet("MailboxPermission");
                    this.WriteParameterErrorIfSet("ExchangeServer");
                    this.WriteParameterErrorIfSet("RPCProxyServer");
                    this.WriteParameterErrorIfSet("NspiServer");
                    this.WriteParameterErrorIfSet("PublicFolderDatabaseServerLegacyDN");
                    this.WriteParameterErrorIfSet("TestMailbox", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("SourceMailboxLegacyDN", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("EmailAddress", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    goto IL_2B4;
                }
                if (endpointType == MigrationType.ExchangeOutlookAnywhere)
                {
                    this.WriteParameterErrorIfSet("Port");
                    this.WriteParameterErrorIfSet("Security");
                    this.WriteParameterErrorIfSet("PublicFolderDatabaseServerLegacyDN");
                    goto IL_2B4;
                }
            }
            else
            {
                if (endpointType == MigrationType.ExchangeRemoteMove)
                {
                    this.WriteParameterErrorIfSet("ExchangeServer");
                    this.WriteParameterErrorIfSet("RPCProxyServer");
                    this.WriteParameterErrorIfSet("Port");
                    this.WriteParameterErrorIfSet("MailboxPermission");
                    this.WriteParameterErrorIfSet("Authentication");
                    this.WriteParameterErrorIfSet("Security");
                    this.WriteParameterErrorIfSet("NspiServer");
                    this.WriteParameterErrorIfSet("PublicFolderDatabaseServerLegacyDN");
                    this.WriteParameterErrorIfSet("TestMailbox", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("SourceMailboxLegacyDN", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("EmailAddress", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    goto IL_2B4;
                }
                if (endpointType == MigrationType.PSTImport)
                {
                    this.WriteParameterErrorIfSet("ExchangeServer");
                    this.WriteParameterErrorIfSet("RPCProxyServer");
                    this.WriteParameterErrorIfSet("Port");
                    this.WriteParameterErrorIfSet("MailboxPermission");
                    this.WriteParameterErrorIfSet("Authentication");
                    this.WriteParameterErrorIfSet("Security");
                    this.WriteParameterErrorIfSet("NspiServer");
                    this.WriteParameterErrorIfSet("PublicFolderDatabaseServerLegacyDN");
                    this.WriteParameterErrorIfSet("TestMailbox", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("SourceMailboxLegacyDN", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    this.WriteParameterErrorIfSet("EmailAddress", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    goto IL_2B4;
                }
                if (endpointType == MigrationType.PublicFolder)
                {
                    this.WriteParameterErrorIfSet("RemoteServer");
                    this.WriteParameterErrorIfSet("ExchangeServer");
                    this.WriteParameterErrorIfSet("Port");
                    this.WriteParameterErrorIfSet("MailboxPermission");
                    this.WriteParameterErrorIfSet("Security");
                    this.WriteParameterErrorIfSet("NspiServer");
                    this.WriteParameterErrorIfSet("EmailAddress", new LocalizedString?(Strings.ErrorInvalidEndpointParameterReasonUsedForConnectionTest));
                    goto IL_2B4;
                }
            }
            base.WriteError(new InvalidEndpointTypeException(this.Identity.RawIdentity, this.DataObject.EndpointType.ToString()));
IL_2B4:
            if (base.IsFieldSet("MaxConcurrentMigrations") || base.IsFieldSet("MaxConcurrentIncrementalSyncs"))
            {
                Unlimited <int> unlimited  = base.IsFieldSet("MaxConcurrentMigrations") ? this.MaxConcurrentMigrations : this.DataObject.MaxConcurrentMigrations;
                Unlimited <int> unlimited2 = base.IsFieldSet("MaxConcurrentIncrementalSyncs") ? this.MaxConcurrentIncrementalSyncs : this.DataObject.MaxConcurrentIncrementalSyncs;
                if (unlimited2 > unlimited)
                {
                    base.WriteError(new MigrationMaxConcurrentIncrementalSyncsVerificationFailedException(unlimited2, unlimited));
                }
            }
            if (base.IsFieldSet("MaxConcurrentMigrations") && !this.MaxConcurrentMigrations.Equals(this.DataObject.MaxConcurrentMigrations))
            {
                this.DataObject.MaxConcurrentMigrations = this.MaxConcurrentMigrations;
                this.changed = true;
            }
            if (base.IsFieldSet("MaxConcurrentIncrementalSyncs") && !this.MaxConcurrentIncrementalSyncs.Equals(this.DataObject.MaxConcurrentIncrementalSyncs))
            {
                this.DataObject.MaxConcurrentIncrementalSyncs = this.MaxConcurrentIncrementalSyncs;
                this.changed = true;
            }
            if (base.IsFieldSet("Credentials") && (this.Credentials == null || !this.Credentials.Equals(this.DataObject.Credentials)))
            {
                this.DataObject.Credentials = this.Credentials;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("MailboxPermission") && this.MailboxPermission != this.DataObject.MailboxPermission)
            {
                this.DataObject.MailboxPermission = this.MailboxPermission;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("ExchangeServer") && !this.ExchangeServer.Equals(this.DataObject.ExchangeServer))
            {
                this.DataObject.ExchangeServer = this.ExchangeServer;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("RPCProxyServer") && !this.RpcProxyServer.Equals(this.DataObject.RpcProxyServer))
            {
                this.DataObject.RpcProxyServer = this.RpcProxyServer;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("Port") && !this.Port.Equals(this.DataObject.Port))
            {
                this.DataObject.Port = new int?(this.Port);
                this.changed         = true;
                flag = true;
            }
            if (base.IsFieldSet("Authentication") && !this.Authentication.Equals(this.DataObject.Authentication))
            {
                this.DataObject.Authentication = new AuthenticationMethod?(this.Authentication);
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("Security") && !this.Security.Equals(this.DataObject.Security))
            {
                this.DataObject.Security = new IMAPSecurityMechanism?(this.Security);
                this.changed             = true;
                flag = true;
            }
            if (base.IsFieldSet("RemoteServer") && !this.RemoteServer.Equals(this.DataObject.RemoteServer))
            {
                this.DataObject.RemoteServer = this.RemoteServer;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("NspiServer") && !this.NspiServer.Equals(this.DataObject.NspiServer))
            {
                this.DataObject.NspiServer = this.NspiServer;
                this.changed = true;
                flag         = true;
            }
            if (this.DataObject.EndpointType == MigrationType.PublicFolder && base.IsFieldSet("SourceMailboxLegacyDN") && !this.SourceMailboxLegacyDN.Equals(this.DataObject.SourceMailboxLegacyDN))
            {
                if (!LegacyDN.IsValidLegacyDN(this.SourceMailboxLegacyDN))
                {
                    base.WriteError(new InvalidLegacyExchangeDnValueException("SourceMailboxLegacyDN"));
                }
                this.DataObject.SourceMailboxLegacyDN = this.SourceMailboxLegacyDN;
                this.changed = true;
                flag         = true;
            }
            if (base.IsFieldSet("PublicFolderDatabaseServerLegacyDN") && !this.PublicFolderDatabaseServerLegacyDN.Equals(this.DataObject.PublicFolderDatabaseServerLegacyDN))
            {
                if (!LegacyDN.IsValidLegacyDN(this.PublicFolderDatabaseServerLegacyDN))
                {
                    base.WriteError(new InvalidLegacyExchangeDnValueException("PublicFolderDatabaseServerLegacyDN"));
                }
                this.DataObject.PublicFolderDatabaseServerLegacyDN = this.PublicFolderDatabaseServerLegacyDN;
                this.changed = true;
                flag         = true;
            }
            if (flag)
            {
                this.DataObject.LastModifiedTime = (DateTime)ExDateTime.UtcNow;
            }
            if (!this.SkipVerification)
            {
                MigrationEndpointBase migrationEndpointBase = MigrationEndpointBase.CreateFrom(this.DataObject);
                migrationEndpointBase.VerifyConnectivity();
                if (this.DataObject.EndpointType == MigrationType.ExchangeOutlookAnywhere)
                {
                    ExchangeOutlookAnywhereEndpoint exchangeOutlookAnywhereEndpoint = (ExchangeOutlookAnywhereEndpoint)migrationEndpointBase;
                    if (!string.IsNullOrEmpty(this.SourceMailboxLegacyDN) || this.EmailAddress != SmtpAddress.Empty || !string.IsNullOrEmpty(exchangeOutlookAnywhereEndpoint.EmailAddress))
                    {
                        MailboxData targetMailbox = TestMigrationServerAvailability.DiscoverTestMailbox(this.TestMailbox, ((MigrationADProvider)this.DataProvider.ADProvider).RecipientSession, base.ServerSettings, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
                        string      text          = (string)this.EmailAddress;
                        if (string.IsNullOrEmpty(text))
                        {
                            text = exchangeOutlookAnywhereEndpoint.EmailAddress;
                        }
                        TestMigrationServerAvailability.VerifyExchangeOutlookAnywhereConnection(this.DataProvider, exchangeOutlookAnywhereEndpoint, text, this.SourceMailboxLegacyDN, targetMailbox, false);
                        return;
                    }
                }
                else if (this.DataObject.EndpointType == MigrationType.PublicFolder)
                {
                    MailboxData mailboxData = TestMigrationServerAvailability.DiscoverPublicFolderTestMailbox(this.TestMailbox, this.ConfigurationSession, ((MigrationADProvider)this.DataProvider.ADProvider).RecipientSession, base.ServerSettings, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
                    TestMigrationServerAvailability.VerifyPublicFolderConnection(this.DataProvider, (PublicFolderEndpoint)migrationEndpointBase, this.SourceMailboxLegacyDN, this.PublicFolderDatabaseServerLegacyDN, mailboxData);
                }
            }
        }