internal bool TryGetProxyDestination(string rpcServerFqdn, out ProxyDestination destination)
        {
            destination = null;
            Dictionary <string, ProxyDestination> dictionary = this.proxyDestinations;

            if (dictionary != null)
            {
                dictionary.TryGetValue(rpcServerFqdn, out destination);
            }
            return(destination != null);
        }
Beispiel #2
0
 // Token: 0x06000764 RID: 1892 RVA: 0x0002B280 File Offset: 0x00029480
 public bool TryGetProxyDestination(string rpcServerFqdn, out ProxyDestination destination)
 {
     destination = null;
     return(false);
 }
 private static void AddTwoMapsOfDestinations(Dictionary <string, ProxyDestination> dict, Server server, ProxyDestination destination)
 {
     dict[server.Fqdn] = destination;
     dict[server.Name] = destination;
 }
 private void RefreshServerList(object stateInfo)
 {
     ADSite[]            adsites            = this.directory.GetADSites();
     ClientAccessArray[] clientAccessArrays = this.directory.GetClientAccessArrays();
     Server[]            servers            = this.directory.GetServers();
     if (adsites != null && servers != null)
     {
         Dictionary <string, ProxyDestination> dictionary = new Dictionary <string, ProxyDestination>(StringComparer.OrdinalIgnoreCase);
         foreach (Server server5 in from s in servers
                  where s.IsE15OrLater && s.IsMailboxServer
                  select s)
         {
             RpcHttpProxyRules.AddTwoMapsOfDestinations(dictionary, server5, RpcHttpProxyRules.CreateFixedDestination(Server.E15MinVersion, server5.Fqdn, 444));
         }
         ADSite[] array = adsites;
         for (int i = 0; i < array.Length; i++)
         {
             ADSite site = array[i];
             IEnumerable <Server> source = from s in servers
                                           where s.ServerSite != null && s.ServerSite.Name == site.Name
                                           select s;
             IEnumerable <Server> enumerable = from s in source
                                               where s.IsE14OrLater && !s.IsE15OrLater && s.IsClientAccessServer
                                               select s;
             IEnumerable <Server> source2 = from s in enumerable
                                            where !(bool)s[ActiveDirectoryServerSchema.IsOutOfService]
                                            select s;
             ProxyDestination proxyDestination = null;
             if (source2.Count <Server>() > 0)
             {
                 proxyDestination = new ProxyDestination(Server.E14MinVersion, 443, (from server in enumerable
                                                                                     select server.Fqdn).OrderBy((string str) => str, StringComparer.OrdinalIgnoreCase).ToArray <string>(), (from server in source2
                                                                                                                                                                                             select server.Fqdn).OrderBy((string str) => str, StringComparer.OrdinalIgnoreCase).ToArray <string>());
             }
             foreach (Server server2 in enumerable)
             {
                 RpcHttpProxyRules.AddTwoMapsOfDestinations(dictionary, server2, RpcHttpProxyRules.CreateFixedDestination(Server.E14MinVersion, server2.Fqdn, 443));
             }
             if (proxyDestination != null)
             {
                 foreach (Server server3 in from s in source
                          where s.IsE14OrLater && !s.IsE15OrLater && !s.IsClientAccessServer && s.IsMailboxServer
                          select s)
                 {
                     RpcHttpProxyRules.AddTwoMapsOfDestinations(dictionary, server3, proxyDestination);
                 }
                 if (clientAccessArrays != null && clientAccessArrays.Count <ClientAccessArray>() > 0)
                 {
                     foreach (ClientAccessArray clientAccessArray in from arr in clientAccessArrays
                              where arr.SiteName == site.Name
                              select arr)
                     {
                         dictionary[clientAccessArray.Fqdn] = proxyDestination;
                     }
                 }
             }
             IEnumerable <Server> source3 = from s in source
                                            where !s.IsE14OrLater && s.IsExchange2007OrLater && s.IsClientAccessServer
                                            select s;
             ProxyDestination proxyDestination2 = null;
             if (source3.Count <Server>() > 0)
             {
                 string[] array2 = (from server in source3
                                    select server.Fqdn).OrderBy((string str) => str, StringComparer.OrdinalIgnoreCase).ToArray <string>();
                 proxyDestination2 = new ProxyDestination(Server.E2007MinVersion, 443, array2, array2);
             }
             else if (proxyDestination != null)
             {
                 proxyDestination2 = proxyDestination;
             }
             if (proxyDestination2 != null)
             {
                 foreach (Server server4 in from s in source
                          where s.IsExchange2007OrLater && !s.IsE14OrLater && s.IsMailboxServer
                          select s)
                 {
                     RpcHttpProxyRules.AddTwoMapsOfDestinations(dictionary, server4, proxyDestination2);
                 }
             }
         }
         string text = WebConfigurationManager.AppSettings["OverrideProxyingRules"];
         if (!string.IsNullOrEmpty(text))
         {
             RpcHttpProxyRules.ApplyManualOverrides(dictionary, text);
         }
         this.proxyDestinations = dictionary;
     }
     if (this.refreshTimer != null)
     {
         this.refreshTimer.Change((int)RpcHttpProxyRules.TopologyRefreshInterval.TotalMilliseconds, -1);
         return;
     }
     this.refreshTimer = new Timer(new TimerCallback(this.RefreshServerList), null, (int)RpcHttpProxyRules.TopologyRefreshInterval.TotalMilliseconds, -1);
 }