Beispiel #1
0
 internal override void InvokeWebService(IConfigurationSession session, EhfTargetServerConfig config, EhfProvisioningService provisioningService)
 {
     IPAddress[] array  = null;
     IPAddress[] array2 = null;
     if (this.dnsServerIPAddresses != null && this.fqdnTemplate != null)
     {
         ADSite site = null;
         ADNotificationAdapter.TryRunADOperation(delegate()
         {
             site = ((ITopologyConfigurationSession)session).GetLocalSite();
         });
         if (site == null)
         {
             base.WriteError(new InvalidOperationException("Unable to find ADSite object"), ErrorCategory.InvalidOperation, null);
         }
         Dns dns = new Dns();
         dns.Timeout    = TimeSpan.FromSeconds(30.0);
         dns.ServerList = new DnsServerList();
         dns.ServerList.Initialize(this.dnsServerIPAddresses.ToArray());
         array = this.ResolveInboundVirtualIPs(dns, site.PartnerId, this.fqdnTemplate);
     }
     if (this.outboundIPAddresses != null && this.outboundIPAddresses.Count > 0)
     {
         array2 = this.outboundIPAddresses.ToArray();
     }
     if (array != null || array2 != null)
     {
         CompanyResponseInfo companyResponseInfo = provisioningService.UpdateReseller(config.ResellerId, array, array2);
         if (companyResponseInfo.Status != ResponseStatus.Success)
         {
             this.HandleFailure(companyResponseInfo);
         }
     }
 }
        protected override void InternalProcessRecord()
        {
            if (this.Organization != null)
            {
                if (this.ehfService == null)
                {
                    this.globalSession = this.CreateGlobalSession();
                    EhfTargetServerConfig config = Utils.CreateEhfTargetConfig(this.globalSession, this.ConnectorId, this);
                    this.edgeSyncEhfConnector = Utils.GetConnector(this.globalSession, this.ConnectorId, this);
                    this.ehfService           = new EhfProvisioningService(config);
                }
                ExchangeConfigurationUnit currentOrganization  = this.GetCurrentOrganization(this.globalSession);
                ExchangeTenantRecord      exchangeTenantRecord = this.CreateExchangeTenantRecord(currentOrganization);
                EhfCompanyRecord          ehfCompanyRecord     = this.CreateEhfCompanyRecord(exchangeTenantRecord.PerimeterConfig);
                IList <object>            list = EhfSyncDiffRecord <object> .Compare(exchangeTenantRecord, ehfCompanyRecord);

                using (IEnumerator <object> enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        object sendToPipeline = enumerator.Current;
                        base.WriteObject(sendToPipeline);
                    }
                    return;
                }
            }
            base.TestGeneralSyncHealth();
        }
Beispiel #3
0
        protected override void InternalProcessRecord()
        {
            ITopologyConfigurationSession session = this.CreateSession();
            EhfTargetServerConfig         config  = Utils.CreateEhfTargetConfig(session, this.ConnectorId, this);

            using (EhfProvisioningService ehfProvisioningService = new EhfProvisioningService(config))
            {
                Exception ex = null;
                try
                {
                    this.InvokeWebService(session, config, ehfProvisioningService);
                }
                catch (FaultException <ServiceFault> faultException)
                {
                    ServiceFault detail = faultException.Detail;
                    if (detail.Id == FaultId.UnableToConnectToDatabase)
                    {
                        ex = new InvalidOperationException("ServiceFault: EHF is unable to connect to its database", faultException);
                    }
                    else
                    {
                        ex = faultException;
                    }
                }
                catch (MessageSecurityException ex2)
                {
                    switch (EhfProvisioningService.DecodeMessageSecurityException(ex2))
                    {
                    case EhfProvisioningService.MessageSecurityExceptionReason.DatabaseFailure:
                        ex = new InvalidOperationException("MessageSecurityException: EHF is unable to connect to its database", ex2.InnerException);
                        goto IL_A4;

                    case EhfProvisioningService.MessageSecurityExceptionReason.InvalidCredentials:
                        ex = new InvalidOperationException("MessageSecurityException: EHF connector contains invalid credentials", ex2.InnerException);
                        goto IL_A4;
                    }
                    ex = ex2;
                    IL_A4 :;
                }
                catch (CommunicationException ex3)
                {
                    ex = ex3;
                }
                catch (TimeoutException ex4)
                {
                    ex = ex4;
                }
                catch (EhfProvisioningService.ContractViolationException ex5)
                {
                    ex = ex5;
                }
                if (ex != null)
                {
                    base.WriteError(ex, ErrorCategory.InvalidOperation, null);
                }
            }
        }
        internal override void InvokeWebService(IConfigurationSession session, EhfTargetServerConfig config, EhfProvisioningService provisioningService)
        {
            Company          reseller = provisioningService.GetReseller(config.ResellerId);
            List <IPAddress> list     = new List <IPAddress>();

            if (reseller.Settings.InboundIPList != null && reseller.Settings.InboundIPList.IPList != null && reseller.Settings.InboundIPList.IPList.Length == 1 && reseller.Settings.InboundIPList.IPList[0].IPList != null)
            {
                SmtpProfileEntry[] iplist = reseller.Settings.InboundIPList.IPList[0].IPList;
                foreach (SmtpProfileEntry smtpProfileEntry in iplist)
                {
                    IPAddress item;
                    if (IPAddress.TryParse(smtpProfileEntry.IP, out item))
                    {
                        list.Add(item);
                    }
                    else
                    {
                        this.WriteWarning(new LocalizedString("Unable to parse inbound IP address: " + smtpProfileEntry.IP));
                    }
                }
            }
            List <IPAddress> list2 = new List <IPAddress>();

            if (reseller.Settings.OutboundIPList != null && reseller.Settings.OutboundIPList.IPList != null)
            {
                foreach (string text in reseller.Settings.OutboundIPList.IPList)
                {
                    IPAddress item2;
                    if (IPAddress.TryParse(text, out item2))
                    {
                        list2.Add(item2);
                    }
                    else
                    {
                        this.WriteWarning(new LocalizedString("Unable to parse outbound IP address: " + text));
                    }
                }
            }
            base.WriteObject(new DCPerimeterConfig(list.ToArray(), list2.ToArray()));
        }
Beispiel #5
0
 internal abstract void InvokeWebService(IConfigurationSession session, EhfTargetServerConfig config, EhfProvisioningService provisioningService);