Ejemplo n.º 1
0
        private static Uri GetFrontEndHttpServiceUrl <ServiceType>(IExchangePrincipal exchangePrincipal) where ServiceType : HttpService
        {
            if (exchangePrincipal == null)
            {
                throw new ArgumentNullException("exchangePrincipal");
            }
            if (exchangePrincipal.MailboxInfo.Location.ServerVersion >= Server.E15MinVersion && FrontEndLocator.IsDatacenter)
            {
                return(GlobalServiceUrls.GetExternalUrl <ServiceType>());
            }
            ServiceTopology     serviceTopology = FrontEndLocator.IsDatacenter ? ServiceTopology.GetCurrentLegacyServiceTopology("f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\Cafe\\FrontEndLocator.cs", "GetFrontEndHttpServiceUrl", 276) : ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\Cafe\\FrontEndLocator.cs", "GetFrontEndHttpServiceUrl", 276);
            ServerVersion       serverVersion   = new ServerVersion(exchangePrincipal.MailboxInfo.Location.ServerVersion);
            int                 majorversion    = serverVersion.Major;
            IList <ServiceType> services        = serviceTopology.FindAll <ServiceType>(exchangePrincipal, ClientAccessType.External, (ServiceType service) => new ServerVersion(service.ServerVersionNumber).Major == majorversion, "f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\Cafe\\FrontEndLocator.cs", "GetFrontEndHttpServiceUrl", 281);
            Uri                 uri             = FrontEndLocator.FindServiceInList <ServiceType>(services);

            if (uri == null)
            {
                services = serviceTopology.FindAll <ServiceType>(exchangePrincipal, ClientAccessType.Internal, (ServiceType service) => new ServerVersion(service.ServerVersionNumber).Major == majorversion, "f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\Cafe\\FrontEndLocator.cs", "GetFrontEndHttpServiceUrl", 285);
                uri      = FrontEndLocator.FindServiceInList <ServiceType>(services);
            }
            if (uri != null)
            {
                ExTraceGlobals.CafeTracer.TraceDebug <string>(0L, "[FrontEndLocator.GetFrontEndHttpServiceUrl] Found HTTP service for the specified back end server {0}.", exchangePrincipal.MailboxInfo.Location.ServerFqdn);
                return(uri);
            }
            throw new ServerNotFoundException("Unable to find proper HTTP service.");
        }
Ejemplo n.º 2
0
 public static Uri GetFrontEndEasUrl(IExchangePrincipal exchangePrincipal)
 {
     return(FrontEndLocator.GetFrontEndHttpServiceUrl <MobileSyncService>(exchangePrincipal));
 }
Ejemplo n.º 3
0
 public static Uri GetFrontEndEcpUrl(IExchangePrincipal exchangePrincipal)
 {
     return(FrontEndLocator.GetFrontEndHttpServiceUrl <EcpService>(exchangePrincipal));
 }
Ejemplo n.º 4
0
 public Uri GetOwaUrl(IExchangePrincipal exchangePrincipal)
 {
     return(FrontEndLocator.GetFrontEndOwaUrl(exchangePrincipal));
 }
Ejemplo n.º 5
0
 public Uri GetWebServicesUrl(IExchangePrincipal exchangePrincipal)
 {
     return(FrontEndLocator.GetFrontEndWebServicesUrl(exchangePrincipal));
 }