コード例 #1
0
        // Token: 0x060001F4 RID: 500 RVA: 0x00009BF0 File Offset: 0x00007DF0
        private void TriggerServerMapRefreshIfNeeded(ServiceTopology topology, List <DownLevelServerStatusEntry> serverList)
        {
            bool flag = false;

            if (serverList.Count == 0)
            {
                flag = true;
            }
            using (List <DownLevelServerStatusEntry> .Enumerator enumerator = serverList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    if (!DownLevelServerManager.IsServerDiscoverable(enumerator.Current.BackEndServer.Fqdn))
                    {
                        flag = true;
                        break;
                    }
                }
            }
            if (flag)
            {
                ThreadPool.QueueUserWorkItem(delegate(object o)
                {
                    this.RefreshServerMap(true);
                });
            }
        }
コード例 #2
0
        // Token: 0x060001F3 RID: 499 RVA: 0x00009988 File Offset: 0x00007B88
        private ServiceType GetClientAccessServiceFromList <ServiceType>(List <DownLevelServerStatusEntry> serverList, ServiceTopology topology, AnchorMailbox anchorMailbox, Site targetSite, ClientAccessType clientAccessType, Predicate <ServiceType> otherFilter, RequestDetailsLogger logger, DownLevelServerManager.DownlevelExchangeServerVersion targetDownlevelExchangeServerVersion) where ServiceType : HttpService
        {
            string text     = anchorMailbox.ToCookieKey();
            int    hashCode = HttpProxyBackEndHelper.GetHashCode(text);

            serverList = this.GetFilteredServerListByVersion(serverList, targetDownlevelExchangeServerVersion);
            int[] shuffledList = DownLevelServerManager.GetShuffledList(serverList.Count, hashCode);
            if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
            {
                ExTraceGlobals.VerboseTracer.TraceDebug <string, int, string>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: HashKey: {0}, HashCode: {1}, Anchor mailbox {2}.", text, hashCode, anchorMailbox.ToString());
            }
            for (int i = 0; i < shuffledList.Length; i++)
            {
                int num = shuffledList[i];
                DownLevelServerStatusEntry currentServer = serverList[num];
                if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                {
                    ExTraceGlobals.VerboseTracer.TraceDebug <string, int, bool>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: Back end server {0} is selected by current index {1}. IsHealthy = {2}", currentServer.BackEndServer.Fqdn, num, currentServer.IsHealthy);
                }
                if (currentServer.IsHealthy)
                {
                    ServiceType serviceType = topology.FindAny <ServiceType>(clientAccessType, (ServiceType service) => service != null && service.ServerFullyQualifiedDomainName.Equals(currentServer.BackEndServer.Fqdn, StringComparison.OrdinalIgnoreCase) && !service.IsOutOfService && otherFilter(service), "d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\DownLevelServerManager\\DownLevelServerManager.cs", "GetClientAccessServiceFromList", 799);
                    if (serviceType != null)
                    {
                        if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                        {
                            ExTraceGlobals.VerboseTracer.TraceDebug <Uri, string>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: Found service {0} matching back end server {1}.", serviceType.Url, currentServer.BackEndServer.Fqdn);
                        }
                        RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(logger, "DownLevelTargetRandomHashing", string.Format("{0}/{1}", i, serverList.Count));

                        return(serviceType);
                    }
                    if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(3))
                    {
                        ExTraceGlobals.VerboseTracer.TraceError <string>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: Back end server {0} cannot be found by ServiceDiscovery.", currentServer.BackEndServer.Fqdn);
                    }
                }
                else if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(2))
                {
                    ExTraceGlobals.VerboseTracer.TraceWarning <string>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: Back end server {0} is marked as unhealthy.", currentServer.BackEndServer.Fqdn);
                }
            }
            RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(logger, "DownLevelTargetRandomHashingFailure", string.Format("{0}", serverList.Count));

            this.TriggerServerMapRefreshIfNeeded(topology, serverList);
            string text2 = string.Format("Unable to find proper back end service for {0} in site {1}.", anchorMailbox, targetSite.DistinguishedName);

            if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(3))
            {
                ExTraceGlobals.VerboseTracer.TraceError <string>((long)this.GetHashCode(), "[DownLevelServerManager::GetClientAccessServiceFromList]: {0}", text2);
            }
            throw new NoAvailableDownLevelBackEndException(text2);
        }
コード例 #3
0
        private void TriggerServerMapRefreshIfNeeded(ServiceTopology topology, List <DownLevelServerStatusEntry> serverList)
        {
            bool flag = false;

            if (serverList.Count == 0)
            {
                flag = true;
            }
            foreach (DownLevelServerStatusEntry downLevelServerStatusEntry in serverList)
            {
                if (!DownLevelServerManager.IsServerDiscoverable(downLevelServerStatusEntry.BackEndServer.Fqdn))
                {
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                ThreadPool.QueueUserWorkItem(delegate(object o)
                {
                    this.RefreshServerMap(true);
                });
            }
        }
コード例 #4
0
 private static bool IsE14ServerStale(MailboxServerCacheEntry cacheEntry)
 {
     return(!cacheEntry.BackEndServer.IsE15OrHigher && !DownLevelServerManager.IsServerDiscoverable(cacheEntry.BackEndServer.Fqdn));
 }