Esempio n. 1
0
        public TrackingAuthority GetAuthorityForSiteUser(ADObjectId siteId, ADUser user)
        {
            ADObjectId id = LocalSiteCache.LocalSite.Id;

            if (siteId.Equals(id))
            {
                TraceWrapper.SearchLibraryTracer.TraceDebug(0, "Using local tracking authority for requested user.", new object[0]);
                return(CurrentSiteTrackingAuthority.Instance);
            }
            List <ServerInfo> casServers = ServerCache.Instance.GetCasServers(siteId);

            if (casServers == null || casServers.Count == 0)
            {
                TraceWrapper.SearchLibraryTracer.TraceDebug <ADObjectId>(this.GetHashCode(), "No suitable CAS servers found in site: {0}", siteId);
                return(LegacyExchangeServerTrackingAuthority.Instance);
            }
            return(RemoteSiteInCurrentOrgTrackingAuthority.Create(siteId, this.directoryContext, user));
        }
Esempio n. 2
0
        public TrackingAuthority GetAuthorityForSite(ADObjectId siteId, int minimumCasVersionRequested)
        {
            ADObjectId localServerSiteId = ServerCache.Instance.GetLocalServerSiteId(this.directoryContext);

            if (siteId.Equals(localServerSiteId))
            {
                TraceWrapper.SearchLibraryTracer.TraceDebug <ADObjectId>(this.GetHashCode(), "Using local tracking authority for site: {0}", siteId);
                return(CurrentSiteTrackingAuthority.Instance);
            }
            List <ServerInfo> casServers = ServerCache.Instance.GetCasServers(siteId);

            if (casServers == null || casServers.Count == 0)
            {
                TraceWrapper.SearchLibraryTracer.TraceDebug <ADObjectId>(this.GetHashCode(), "No suitable CAS servers found in site: {0}", siteId);
                return(LegacyExchangeServerTrackingAuthority.Instance);
            }
            bool enabled = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).MessageTracking.UseBackEndLocator.Enabled;

            return(RemoteSiteInCurrentOrgTrackingAuthority.Create(siteId, this.directoryContext, minimumCasVersionRequested, enabled));
        }