protected override AnchorMailbox ResolveAnchorMailbox()
        {
            ExTraceGlobals.VerboseTracer.TraceDebug <string, Uri>((long)this.GetHashCode(), "[EDiscoveryExportToolProxyRequestHandler::ResolveAnchorMailbox]: Method {0}; Url {1};", base.ClientRequest.HttpMethod, base.ClientRequest.Url);
            string[] array = base.ClientRequest.Url.AbsolutePath.Split(new char[]
            {
                '/'
            }, StringSplitOptions.RemoveEmptyEntries);
            if (array.Length == 5 && array[2] == "exporttool" && array[4].StartsWith("microsoft.exchange."))
            {
                this.serverFqdn = array[3];
                base.Logger.Set(HttpProxyMetadata.RoutingHint, "EDiscoveryExportTool-ServerInfo");
                return(new ServerInfoAnchorMailbox(this.serverFqdn, this));
            }
            this.serverFqdn = null;
            Match         pathMatch = EDiscoveryExportToolRequestPathHandler.GetPathMatch(base.ClientRequest);
            ServerVersion serverVersion;

            if (pathMatch.Success && RegexUtilities.TryGetServerVersionFromRegexMatch(pathMatch, out serverVersion))
            {
                AnchorMailbox result = new ServerVersionAnchorMailbox <EcpService>(serverVersion, ClientAccessType.Internal, true, this);
                base.Logger.Set(HttpProxyMetadata.RoutingHint, "EDiscoveryExportTool-ServerVersion");
                return(result);
            }
            throw new HttpProxyException(HttpStatusCode.NotFound, HttpProxySubErrorCode.ServerNotFound, string.Format("Unable to find target server for url: {0}", base.ClientRequest.Url));
        }
Пример #2
0
        private static ServerVersion ParseServerVersion(string versionString)
        {
            ServerVersion result = null;

            if (!string.IsNullOrEmpty(versionString))
            {
                Match         match = Constants.ExchClientVerRegex.Match(versionString);
                ServerVersion serverVersion;
                if (match.Success && RegexUtilities.TryGetServerVersionFromRegexMatch(match, out serverVersion) && serverVersion.Major >= 14)
                {
                    result = serverVersion;
                }
            }
            return(result);
        }
Пример #3
0
        // Token: 0x06000515 RID: 1301 RVA: 0x0001C5A4 File Offset: 0x0001A7A4
        protected override AnchorMailbox ResolveAnchorMailbox()
        {
            if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
            {
                ExTraceGlobals.VerboseTracer.TraceDebug <string, Uri>((long)this.GetHashCode(), "[EDiscoveryExportToolProxyRequestHandler::ResolveAnchorMailbox]: Method {0}; Url {1};", base.ClientRequest.HttpMethod, base.ClientRequest.Url);
            }
            string[] array = base.ClientRequest.Url.AbsolutePath.Split(new char[]
            {
                '/'
            }, StringSplitOptions.RemoveEmptyEntries);
            if (((array.Length == 5 && array[4].StartsWith("microsoft.exchange.")) || (array.Length == 6 && array[5].StartsWith("microsoft.exchange."))) && array[2] == "exporttool" && array[3].Contains("."))
            {
                this.serverFqdn = array[3];
            }
            else
            {
                this.serverFqdn = null;
            }
            Match         pathMatch         = EDiscoveryExportToolRequestPathHandler.GetPathMatch(base.ClientRequest);
            bool          exactVersionMatch = false;
            ServerVersion serverVersion;

            if (pathMatch.Success)
            {
                if (RegexUtilities.TryGetServerVersionFromRegexMatch(pathMatch, ref serverVersion))
                {
                    exactVersionMatch = true;
                }
            }
            else
            {
                serverVersion     = new ServerVersion(Server.CurrentExchangeMajorVersion, 0, 0, 0);
                exactVersionMatch = false;
            }
            if (((!string.IsNullOrEmpty(this.serverFqdn)) ? CafeConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).DiscoveryExportToolDownloadRoutingMechanism.Value : string.Empty) == "ServerInfo")
            {
                base.Logger.Set(3, "EDiscoveryExportTool-ServerInfo");
                return(new ServerInfoAnchorMailbox(this.serverFqdn, this));
            }
            if (EDiscoveryExportToolRequestPathHandler.IsEDiscoveryExportToolRequest(base.ClientRequest))
            {
                AnchorMailbox result = new ServerVersionAnchorMailbox <EcpService>(serverVersion, 0, exactVersionMatch, this);
                base.Logger.Set(3, "EDiscoveryExportTool-ServerVersion");
                return(result);
            }
            throw new HttpProxyException(HttpStatusCode.NotFound, 3007, string.Format("Unable to find target server for url: {0}", base.ClientRequest.Url));
        }
        // Token: 0x060004C2 RID: 1218 RVA: 0x0001A43C File Offset: 0x0001863C
        protected ServerVersionAnchorMailbox <ServiceType> GetServerVersionAnchorMailbox(string serverVersionString)
        {
            ServerVersion serverVersion = new ServerVersion(LocalServerCache.LocalServer.VersionNumber);

            if (!string.IsNullOrEmpty(serverVersionString))
            {
                Match         match = Constants.ExchClientVerRegex.Match(serverVersionString);
                ServerVersion serverVersion2;
                if (match.Success && RegexUtilities.TryGetServerVersionFromRegexMatch(match, ref serverVersion2) && serverVersion2.Major >= 14)
                {
                    serverVersion = serverVersion2;
                }
            }
            int num = (serverVersion.Build > 0) ? (serverVersion.Build - 1) : serverVersion.Build;

            serverVersion = new ServerVersion(serverVersion.Major, serverVersion.Minor, num, serverVersion.Revision);
            return(new ServerVersionAnchorMailbox <ServiceType>(serverVersion, this.ClientAccessType, false, this));
        }