コード例 #1
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (!base.HasErrors)
     {
         if (CommonConstants.UseDataCenterCallRouting && this.DataObject.Address.IsIPAddress && this.DataObject.GlobalCallRoutingScheme != UMGlobalCallRoutingScheme.E164)
         {
             base.WriteError(new GatewayAddressRequiresFqdnException(), ErrorCategory.InvalidOperation, this.DataObject);
         }
         LocalizedException ex = NewUMIPGateway.ValidateFQDNInTenantAcceptedDomain(this.DataObject, (IConfigurationSession)base.DataSession);
         if (ex != null)
         {
             base.WriteError(ex, ErrorCategory.InvalidOperation, this.DataObject);
         }
         string text = this.DataObject.Address.ToString();
         this.CheckAndWriteError(new IPGatewayAlreadyExistsException(text), text);
         LocalizedException ex2 = NewUMIPGateway.ValidateIPAddressFamily(this.DataObject);
         if (ex2 != null)
         {
             base.WriteError(ex2, ErrorCategory.InvalidOperation, this.DataObject);
         }
     }
     TaskLogger.LogExit();
 }
コード例 #2
0
 protected override void InternalValidate()
 {
     base.InternalValidate();
     TaskLogger.LogEnter();
     if (!base.HasErrors)
     {
         if (CommonConstants.UseDataCenterCallRouting && this.DataObject.Address.IsIPAddress && this.DataObject.GlobalCallRoutingScheme != UMGlobalCallRoutingScheme.E164)
         {
             base.WriteError(new GatewayAddressRequiresFqdnException(), ErrorCategory.InvalidOperation, this.DataObject);
         }
         LocalizedException ex = NewUMIPGateway.ValidateFQDNInTenantAcceptedDomain(this.DataObject, this.ConfigurationSession);
         if (ex != null)
         {
             base.WriteError(ex, ErrorCategory.InvalidOperation, this.DataObject);
         }
         string text = this.DataObject.Address.ToString();
         this.CheckAndWriteError(new IPGatewayAlreadyExistsException(text), text);
         if (this.UMDialPlan != null)
         {
             IConfigurationSession session = (IConfigurationSession)base.DataSession;
             this.dialPlan = (UMDialPlan)base.GetDataObject <UMDialPlan>(this.UMDialPlan, session, null, new LocalizedString?(Strings.NonExistantDialPlan(this.UMDialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(this.UMDialPlan.ToString())));
             if (this.dialPlan.URIType == UMUriType.SipName && !VariantConfiguration.InvariantNoFlightingSnapshot.UM.HuntGroupCreationForSipDialplans.Enabled)
             {
                 base.WriteError(new CannotCreateGatewayForHostedSipDialPlanException(), ErrorCategory.InvalidOperation, this.DataObject);
             }
         }
         if (!this.DataObject.IsModified(UMIPGatewaySchema.GlobalCallRoutingScheme))
         {
             if (CommonConstants.UseDataCenterCallRouting)
             {
                 this.GlobalCallRoutingScheme = UMGlobalCallRoutingScheme.GatewayGuid;
             }
             else
             {
                 this.GlobalCallRoutingScheme = UMGlobalCallRoutingScheme.None;
             }
         }
         LocalizedException ex2 = NewUMIPGateway.ValidateIPAddressFamily(this.DataObject);
         if (ex2 != null)
         {
             base.WriteError(ex2, ErrorCategory.InvalidOperation, this.DataObject);
         }
     }
     TaskLogger.LogExit();
 }
コード例 #3
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (!base.HasErrors)
     {
         if (this.DataObject.Status == GatewayStatus.Enabled)
         {
             IPGatewayAlreadEnabledException exception = new IPGatewayAlreadEnabledException(this.DataObject.Name);
             base.WriteError(exception, ErrorCategory.InvalidOperation, null);
             return;
         }
         LocalizedException ex = NewUMIPGateway.ValidateFQDNInTenantAcceptedDomain(this.DataObject, (IConfigurationSession)base.DataSession);
         if (ex != null)
         {
             base.WriteError(ex, ErrorCategory.InvalidOperation, this.DataObject);
         }
     }
     TaskLogger.LogExit();
 }