Exemple #1
0
        protected virtual ProbeResultBuilder CollectInformation(CollectInfo collectInfo)
        {
            CollectedObject collectedObject    = null;
            var             probeResultBuilder = new ProbeResultBuilder();

            int idOfItems = 1;

            //  var objectsOfAnEspecificType = this.GetObjectsOfType(collectInfo.ObjectTypes);

            ObjectCollector.PrepareCollectionOfObjects(collectInfo.ObjectTypes, collectInfo.Variables);
            foreach (var ovalObject in collectInfo.ObjectTypes)
            {
                ExecutionLogBuilder.CollectingInformationFrom(ovalObject.id);

                if (this.ObjectTypeHasSet(ovalObject))
                {
                    collectedObject = this.ProcessSet(ovalObject, collectInfo);
                }
                else
                {
                    collectedObject = this.ProcessCollect(ovalObject, collectInfo, probeResultBuilder, ref idOfItems);
                }

                probeResultBuilder.AddCollectedObject(collectedObject);
            }

            return(probeResultBuilder);
        }
Exemple #2
0
        public ProbeResult CreateCollectedObjectForNotSupportedObjects(
            IEnumerable <Definitions.ObjectType> objectNotSupported)
        {
            ProbeResultBuilder probeResultBuilder = new ProbeResultBuilder();

            foreach (var objectType in objectNotSupported)
            {
                var collectedObject = new CollectedObject(objectType.id);
                collectedObject.SetEspecificObjectStatus(FlagEnumeration.notcollected);
                probeResultBuilder.AddCollectedObject(collectedObject);
            }
            return(probeResultBuilder.ProbeResult);
        }
Exemple #3
0
        public ProbeResult Execute(
            IList <IConnectionProvider> connectionContext,
            TargetInfo target,
            CollectInfo collectInfo)
        {
            this.ExecutionLogBuilder = new ExecutionLogBuilder();
            this.ExecutionLogBuilder.TryConnectToHost(target.GetAddress());
            this.OpenConnectionProvider(connectionContext, target);

            ExecuteAfterOpenConnectionProvider();

            this.ExecutionLogBuilder.ConnectedToHostWithUserName(target.credentials.GetFullyQualifiedUsername());
            this.ConfigureObjectCollector();

            ProbeResultBuilder probeResultBuilder = this.CollectInformation(collectInfo);

            probeResultBuilder.AddExecutionLogs(this.ExecutionLogBuilder.BuildExecutionLogs());
            return(probeResultBuilder.ProbeResult);
        }
Exemple #4
0
        /// <summary>
        /// Executes a normal collect, using the system datasource for data collecting.
        /// </summary>
        /// <param name="ovalComponent">The oval component.</param>
        /// <param name="collectInfo">The collect info.</param>
        /// <param name="id">The id parameter is 'a sequencial number controlled by external scope.</param>
        /// <returns></returns>
        private CollectedObject ProcessCollect(Definitions.ObjectType ovalComponent, CollectInfo collectInfo, ProbeResultBuilder probeResultBuilder, ref int id)
        {
            CollectedObject collectedObject = null;
            var allItemsToCollect = this.TryToGetItemsToCollect(ovalComponent, collectInfo.Variables);

            if (allItemsToCollect.Count() > 0)
            {
                collectedObject = new CollectedObject(ovalComponent.id);
                foreach (var itemToCollect in allItemsToCollect)
                {
                    var collectedItems = ObjectCollector.CollectDataForSystemItem(itemToCollect);
                    foreach (var collectedItem in collectedItems)
                    {
                        var itemType = probeResultBuilder.GetItemType(collectedItem.ItemType);
                        if (itemType == null)
                        {
                            collectedItem.ItemType.id = id.ToString();
                            id++;
                        }
                        else
                        {
                            collectedItem.ItemType = itemType;
                        }

                        collectedObject.AddItemToSystemData(collectedItem.ItemType);
                        var variables = collectInfo.GetVariableValueForOvalComponent(collectedObject.ObjectType.id);
                        collectedObject.AddVariableReference(variables);
                        ExecutionLogBuilder.AddDetailInformation(collectedItem.ExecutionLog);
                    }
                }

                collectedObject.UpdateCollectedObjectStatus();
            }

            return collectedObject;
        }
Exemple #5
0
        protected virtual ProbeResultBuilder CollectInformation(CollectInfo collectInfo)
        {
            CollectedObject collectedObject = null;
            var probeResultBuilder = new ProbeResultBuilder();

            int idOfItems = 1;
              //  var objectsOfAnEspecificType = this.GetObjectsOfType(collectInfo.ObjectTypes);

            ObjectCollector.PrepareCollectionOfObjects(collectInfo.ObjectTypes, collectInfo.Variables);
            foreach (var ovalObject in collectInfo.ObjectTypes)
            {
                ExecutionLogBuilder.CollectingInformationFrom(ovalObject.id);

                if (this.ObjectTypeHasSet(ovalObject))
                    collectedObject = this.ProcessSet(ovalObject, collectInfo);
                else
                    collectedObject = this.ProcessCollect(ovalObject, collectInfo, probeResultBuilder, ref idOfItems);

                probeResultBuilder.AddCollectedObject(collectedObject);
            }

            return probeResultBuilder;
        }
Exemple #6
0
 public ProbeResult CreateCollectedObjectForNotSupportedObjects(
     IEnumerable<Definitions.ObjectType> objectNotSupported)
 {
     ProbeResultBuilder probeResultBuilder = new ProbeResultBuilder();
     foreach (var objectType in objectNotSupported)
     {
         var collectedObject = new CollectedObject(objectType.id);
         collectedObject.SetEspecificObjectStatus(FlagEnumeration.notcollected);
         probeResultBuilder.AddCollectedObject(collectedObject);
     }
     return probeResultBuilder.ProbeResult;
 }
Exemple #7
0
        /// <summary>
        /// Executes a normal collect, using the system datasource for data collecting.
        /// </summary>
        /// <param name="ovalComponent">The oval component.</param>
        /// <param name="collectInfo">The collect info.</param>
        /// <param name="id">The id parameter is 'a sequencial number controlled by external scope.</param>
        /// <returns></returns>
        private CollectedObject ProcessCollect(Definitions.ObjectType ovalComponent, CollectInfo collectInfo, ProbeResultBuilder probeResultBuilder, ref int id)
        {
            CollectedObject collectedObject   = null;
            var             allItemsToCollect = this.TryToGetItemsToCollect(ovalComponent, collectInfo.Variables);

            if (allItemsToCollect.Count() > 0)
            {
                collectedObject = new CollectedObject(ovalComponent.id);
                foreach (var itemToCollect in allItemsToCollect)
                {
                    var collectedItems = ObjectCollector.CollectDataForSystemItem(itemToCollect);
                    foreach (var collectedItem in collectedItems)
                    {
                        var itemType = probeResultBuilder.GetItemType(collectedItem.ItemType);
                        if (itemType == null)
                        {
                            collectedItem.ItemType.id = id.ToString();
                            id++;
                        }
                        else
                        {
                            collectedItem.ItemType = itemType;
                        }

                        collectedObject.AddItemToSystemData(collectedItem.ItemType);
                        var variables = collectInfo.GetVariableValueForOvalComponent(collectedObject.ObjectType.id);
                        collectedObject.AddVariableReference(variables);
                        ExecutionLogBuilder.AddDetailInformation(collectedItem.ExecutionLog);
                    }
                }

                collectedObject.UpdateCollectedObjectStatus();
            }

            return(collectedObject);
        }