public static TopologyExtractor CreateExtractor(DirectoryContainerParent directoryContainerObject, TopologyExtractorFactory extractorFactory, ILogger logger)
 {
     if (LoadBalanceADSettings.Instance.Value.UseParallelDiscovery)
     {
         return(new ParallelParentContainerExtractor(directoryContainerObject, extractorFactory, logger));
     }
     return(new ParentContainerExtractor(directoryContainerObject, extractorFactory, logger));
 }
        public override LoadContainer ExtractTopology()
        {
            DirectoryContainerParent directoryContainerParent = (DirectoryContainerParent)base.DirectoryObject;

            this.logger.LogInformation("Retrieving topology for parent object {0} with {1} children.", new object[]
            {
                base.DirectoryObject.Identity,
                directoryContainerParent.Children.Count <DirectoryObject>()
            });
            LoadContainer container = new LoadContainer(base.DirectoryObject, ContainerType.Generic);
            IEnumerable <DirectoryObject>         children = directoryContainerParent.Children;
            IEnumerable <ChildContainerExtractor> source   = from child in children
                                                             select new ChildContainerExtractor(child, container, this.logger, this.ExtractorFactory.GetExtractor(child));

            Parallel.ForEach <ChildContainerExtractor>(source, new Action <ChildContainerExtractor, ParallelLoopState>(this.ExtractChild));
            return(container);
        }
Esempio n. 3
0
        public virtual TopologyExtractor GetExtractor(DirectoryObject directoryObject)
        {
            DirectoryMailbox directoryMailbox = directoryObject as DirectoryMailbox;

            if (directoryMailbox != null)
            {
                return(this.CreateMailboxExtractor(directoryMailbox));
            }
            DirectoryDatabase directoryDatabase = directoryObject as DirectoryDatabase;

            if (directoryDatabase != null)
            {
                return(this.CreateDatabaseExtractor(directoryDatabase));
            }
            DirectoryServer directoryServer = directoryObject as DirectoryServer;

            if (directoryServer != null)
            {
                return(this.CreateServerExtractor(directoryServer));
            }
            DirectoryDatabaseAvailabilityGroup directoryDatabaseAvailabilityGroup = directoryObject as DirectoryDatabaseAvailabilityGroup;

            if (directoryDatabaseAvailabilityGroup != null)
            {
                return(this.CreateDagExtractor(directoryDatabaseAvailabilityGroup));
            }
            DirectoryForest directoryForest = directoryObject as DirectoryForest;

            if (directoryForest != null)
            {
                return(this.CreateForestExtractor(directoryForest));
            }
            DirectoryContainerParent directoryContainerParent = directoryObject as DirectoryContainerParent;

            if (directoryContainerParent != null)
            {
                return(this.CreateContainerParentExtractor(directoryContainerParent));
            }
            return(null);
        }
 private ParallelParentContainerExtractor(DirectoryContainerParent directoryContainerObject, TopologyExtractorFactory extractorFactory, ILogger logger) : base(directoryContainerObject, extractorFactory)
 {
     this.logger = logger;
 }
Esempio n. 5
0
 protected virtual TopologyExtractor CreateContainerParentExtractor(DirectoryContainerParent container)
 {
     return(null);
 }
Esempio n. 6
0
 public ParentContainerExtractor(DirectoryContainerParent directoryObject, TopologyExtractorFactory extractorFactory, ILogger logger) : base(directoryObject, extractorFactory)
 {
     this.logger = logger;
 }
Esempio n. 7
0
 protected override TopologyExtractor CreateContainerParentExtractor(DirectoryContainerParent container)
 {
     return(new ParentContainerExtractor(container, this, base.Logger));
 }