Ejemplo n.º 1
0
 private void EnableMinimization()
 {
     if (ADObjectWrapperBase.IsMinimizeEnabled())
     {
         AdObjectLookupCache <IADDatabase> adObjectLookupCache = this.m_databaseLookup as AdObjectLookupCache <IADDatabase>;
         if (adObjectLookupCache != null)
         {
             adObjectLookupCache.MinimizeObjects = true;
         }
         MiniServerLookupCache miniServerLookupCache = this.m_miniServerLookup as MiniServerLookupCache;
         if (miniServerLookupCache != null)
         {
             miniServerLookupCache.MinimizeObjects = true;
         }
     }
 }
Ejemplo n.º 2
0
        public static ActiveManager CreateRemoteActiveManager(string domainControllerName, NetworkCredential networkCredential, bool createCachingActiveManager)
        {
            ITopologyConfigurationSession  topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(domainControllerName, true, ConsistencyMode.FullyConsistent, networkCredential, ADSessionSettings.FromRootOrgScopeSet(), 1071, "CreateRemoteActiveManager", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\ActiveManager\\ActiveManager.cs");
            IADToplogyConfigurationSession adSession = ADSessionFactory.CreateWrapper(topologyConfigurationSession);
            IFindAdObject <IADDatabaseAvailabilityGroup> dagLookup;
            IFindAdObject <IADServer>            serverLookup;
            IFindMiniServer                      miniServerLookup;
            IFindAdObject <IADClientAccessArray> casLookup;
            IFindMiniClientAccessServerOrArray   miniCasArrayLookup;
            IFindAdObject <IADDatabase>          databaseLookup;

            if (createCachingActiveManager)
            {
                TimeSpan timeSpan = new TimeSpan(0, 0, 75);
                dagLookup          = new AdObjectLookupCache <IADDatabaseAvailabilityGroup>(adSession, timeSpan, timeSpan, ActiveManager.s_cacheLockTimeout, AdObjectLookupCache <IADDatabaseAvailabilityGroup> .AdOperationTimeout);
                serverLookup       = new AdObjectLookupCache <IADServer>(adSession, AdObjectLookupCache <IADServer> .TimeToLive, AdObjectLookupCache <IADServer> .TimeToNegativeLive, ActiveManager.s_cacheLockTimeout, AdObjectLookupCache <IADServer> .AdOperationTimeout);
                miniServerLookup   = new MiniServerLookupCache(adSession, MiniServerLookupCache.TimeToLive, MiniServerLookupCache.TimeToNegativeLive, ActiveManager.s_cacheLockTimeout, MiniServerLookupCache.AdOperationTimeout);
                casLookup          = new AdObjectLookupCache <IADClientAccessArray>(adSession, AdObjectLookupCache <IADClientAccessArray> .TimeToLive, AdObjectLookupCache <IADClientAccessArray> .TimeToNegativeLive, ActiveManager.s_cacheLockTimeout, AdObjectLookupCache <IADClientAccessArray> .AdOperationTimeout);
                miniCasArrayLookup = new MiniClientAccessServerOrArrayLookupCache(topologyConfigurationSession, MiniClientAccessServerOrArrayLookupCache.TimeToLive, MiniClientAccessServerOrArrayLookupCache.TimeToNegativeLive, ActiveManager.s_cacheLockTimeout, MiniClientAccessServerOrArrayLookupCache.AdOperationTimeout);
                databaseLookup     = new AdObjectLookupCache <IADDatabase>(adSession, AdObjectLookupCache <IADDatabase> .TimeToLive, AdObjectLookupCache <IADDatabase> .TimeToNegativeLive, ActiveManager.s_cacheLockTimeout, AdObjectLookupCache <IADDatabase> .AdOperationTimeout);
            }
            else
            {
                dagLookup          = new SimpleAdObjectLookup <IADDatabaseAvailabilityGroup>(adSession);
                serverLookup       = new SimpleAdObjectLookup <IADServer>(adSession);
                miniServerLookup   = new SimpleMiniServerLookup(adSession);
                casLookup          = new SimpleAdObjectLookup <IADClientAccessArray>(adSession);
                miniCasArrayLookup = new SimpleMiniClientAccessServerOrArrayLookup(topologyConfigurationSession);
                databaseLookup     = new SimpleAdObjectLookup <IADDatabase>(adSession);
            }
            ActiveManager activeManager = new ActiveManager(createCachingActiveManager, dagLookup, serverLookup, miniServerLookup, casLookup, miniCasArrayLookup, databaseLookup, topologyConfigurationSession, false);

            activeManager.m_networkCredential = networkCredential;
            ExTraceGlobals.ActiveManagerClientTracer.TraceDebug <string>(0L, "Created an ActiveManager suitable for cross-forest queries, dcName={0}.", domainControllerName);
            return(activeManager);
        }