Example #1
0
        private static MiniServer GetAnyBackEndServer(int versionNumber, bool needsExactVersionMatch)
        {
            MiniServer miniServer = null;

            try
            {
                miniServer = ServersCache.GetDeterministicBackEndServerForASite(versionNumber, null, needsExactVersionMatch, null);
            }
            catch (ServerHasNotBeenFoundException)
            {
            }
            if (miniServer != null)
            {
                return(miniServer);
            }
            try
            {
                ServersCache.CacheLockForServersDictionary.EnterReadLock();
                miniServer = ServersCache.FindMiniServerInListWithoutAffinity(ServersCache.ServersDictionary.Values.ToList <ServersCache.ServerInfo>(), versionNumber, needsExactVersionMatch);
            }
            finally
            {
                ServersCache.CacheLockForServersDictionary.ExitReadLock();
            }
            if (miniServer != null)
            {
                return(miniServer);
            }
            MiniServer oneMailboxServerForASite = ServersCache.GetOneMailboxServerForASite(null, versionNumber, needsExactVersionMatch);

            ServersCache.UpdateMiniServerIntoCache(oneMailboxServerForASite);
            return(oneMailboxServerForASite);
        }
Example #2
0
        internal static MiniServer GetDeterministicBackEndServerFromSameSite(string sourceServerFQDN, int versionNumber, string identifier, bool needsExactVersionMatch = false)
        {
            if (string.IsNullOrWhiteSpace(sourceServerFQDN))
            {
                throw new ArgumentNullException("sourceServerName should not be null");
            }
            bool       flag         = true;
            MiniServer serverByFQDN = ServersCache.GetServerByFQDN(sourceServerFQDN, out flag);

            if (!flag)
            {
                ServersCache.UpdateMiniServerIntoCache(serverByFQDN);
            }
            ADObjectId serverSite = serverByFQDN.ServerSite;

            return(ServersCache.GetDeterministicBackEndServerForASite(versionNumber, identifier, needsExactVersionMatch, serverSite));
        }
Example #3
0
 internal static MiniServer GetAnyBackEndServerFromASite(ADObjectId adSiteId, int versionNumber, bool needsExactVersionMatch = false)
 {
     return(ServersCache.GetDeterministicBackEndServerForASite(versionNumber, null, needsExactVersionMatch, adSiteId));
 }
Example #4
0
 internal static MiniServer GetAnyBackEndServerFromLocalSite(int versionNumber, bool needsExactVersionMatch = false)
 {
     return(ServersCache.GetDeterministicBackEndServerForASite(versionNumber, null, needsExactVersionMatch, null));
 }