Beispiel #1
0
        protected override void InternalValidate()
        {
            IConfigurationSession configurationSession = (IConfigurationSession)base.DataSession;

            if (Server.IsSubscribedGateway(base.GlobalConfigSession))
            {
                base.WriteError(new CannotRunOnSubscribedEdgeException(), ErrorCategory.InvalidOperation, null);
            }
            base.InternalValidate();
            ADSessionSettings             sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(base.RootOrgContainerId, this.DataObject.OrganizationId, base.ExecutingUserOrganizationId, false);
            IConfigurationSession         tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(this.ConfigurationSession.DomainController, true, ConsistencyMode.PartiallyConsistent, sessionSettings, 82, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\MessageSecurity\\RemoteDomain\\SetRemoteDomain.cs");
            ITopologyConfigurationSession topologyConfigurationSession         = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(this.ConfigurationSession.DomainController, true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 88, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\MessageSecurity\\RemoteDomain\\SetRemoteDomain.cs");

            NewRemoteDomain.ValidateNoDuplicates(this.DataObject, tenantOrTopologyConfigurationSession, new Task.TaskErrorLoggingDelegate(base.WriteError));
            Server server = null;

            try
            {
                server = topologyConfigurationSession.ReadLocalServer();
            }
            catch (TransientException exception)
            {
                base.WriteError(exception, ErrorCategory.ResourceUnavailable, null);
            }
            if (server != null && server.IsEdgeServer && this.DataObject.IsModified(DomainContentConfigSchema.AcceptMessageTypes))
            {
                base.WriteError(new ArgumentException(Strings.ParameterNotApplicableToInstalledServerRoles("AllowedOOFType, AutoForwardEnabled, AutoReplyEnabled, DeliveryReportEnabled, IsInternal, NDREnabled, MFNEnabled, UseSimpleDisplayName, NDRDiagnosticInfoEnabled"), string.Empty), ErrorCategory.InvalidArgument, null);
            }
            if (this.TargetDeliveryDomain && (this.DataObject.DomainName.IncludeSubDomains || this.DataObject.DomainName.IsStar))
            {
                base.WriteError(new CannotSetTargetDeliveryDomainOnWildCardDomainsException(this.DataObject.DomainName.ToString()), ErrorCategory.InvalidArgument, this.Identity);
            }
        }
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (base.HasErrors)
     {
         return;
     }
     if (VariantConfiguration.InvariantNoFlightingSnapshot.Transport.LimitRemoteDomains.Enabled)
     {
         DomainContentConfig[] array = base.DataSession.FindPaged <DomainContentConfig>(null, null, true, null, 0).ToArray <DomainContentConfig>();
         if (array != null && array.Length >= 200)
         {
             base.WriteError(new InvalidOperationException(Strings.ErrorTooManyRemoteDomains(200)), ErrorCategory.InvalidOperation, null);
         }
     }
     if (Server.IsSubscribedGateway(base.GlobalConfigSession))
     {
         base.WriteError(new CannotRunOnSubscribedEdgeException(), ErrorCategory.InvalidOperation, null);
     }
     NewRemoteDomain.ValidateNoDuplicates(this.DataObject, this.ConfigurationSession, new Task.TaskErrorLoggingDelegate(base.WriteError));
     TaskLogger.LogExit();
 }