internal static Uri GetBackEndServiceUrlByServer <ServiceType>(BackEndServer backEndServer) where ServiceType : HttpService { if (backEndServer.IsE15OrHigher) { return(GlobalServiceUrls.GetInternalUrl <ServiceType>(backEndServer.Fqdn)); } HttpProxyBackEndHelper.TopologyWithSites legacyServiceTopologyWithSites = HttpProxyBackEndHelper.GetLegacyServiceTopologyWithSites(backEndServer.Fqdn); ServiceType serviceType = legacyServiceTopologyWithSites.ServiceTopology.FindAny <ServiceType>(ClientAccessType.InternalNLBBypass, (ServiceType service) => service != null && !service.IsFrontEnd && service.ServerFullyQualifiedDomainName.Equals(backEndServer.Fqdn, StringComparison.OrdinalIgnoreCase), "f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\Cafe\\HttpProxyBackEndHelper.cs", "GetBackEndServiceUrlByServer", 568); if (serviceType != null) { ExTraceGlobals.CafeTracer.TraceDebug <BackEndServer>(0L, "[HttpProxyBackEndHelper.GetBackEndServiceUrlByServer] Found HTTP service on the specified back end server {0}.", backEndServer); return(serviceType.Url); } serviceType = HttpProxyBackEndHelper.GetBestBackEndServiceForVersion <ServiceType>(legacyServiceTopologyWithSites, ClientAccessType.InternalNLBBypass, (int x) => new ServerVersion(x).Major == new ServerVersion(backEndServer.Version).Major); ExTraceGlobals.CafeTracer.TraceDebug <string, int>(0L, "[HttpProxyBackEndHelper.GetBackEndServiceByServer] Found HTTP service {0} with version {1}.", serviceType.ServerFullyQualifiedDomainName, serviceType.ServerVersionNumber); if (serviceType != null) { return(serviceType.Url); } throw new ServerNotFoundException("Unable to find proper HTTP service."); }
internal static Uri GetE12ExternalUrl <ServiceType>(BackEndServer mailboxServer) where ServiceType : HttpService { if (mailboxServer == null) { throw new ArgumentNullException("mailboxServer"); } if (mailboxServer.Version >= Server.E14MinVersion) { throw new ArgumentException("Mailbox server version is higher then E12", "mailboxServer"); } HttpProxyBackEndHelper.TopologyWithSites legacyServiceTopologyWithSites = HttpProxyBackEndHelper.GetLegacyServiceTopologyWithSites(mailboxServer.Fqdn); HttpService httpService = HttpProxyBackEndHelper.GetBestBackEndServiceForVersion <ServiceType>(legacyServiceTopologyWithSites, ClientAccessType.External, (int x) => x >= Server.E2007MinVersion && x < Server.E14MinVersion); return(httpService.Url); }