예제 #1
0
 /// <summary>
 /// Creates a probe execution with error status.
 /// This is necessary because in the execution of the collect, can be happen an 
 ///  error and should be possible to track the error.
 /// </summary>
 /// <param name="capability">The capability.</param>
 /// <param name="errorMessage">The error message.</param>
 /// <returns></returns>
 public ProbeExecution CreateAProbeExecutionWithError(string capability, string errorMessage)
 {
     ProbeExecution probe = new ProbeExecution();
     probe.Capability = capability;
     probe.ExecutionLogs.Add(this.CreateExecutionLog(DateTime.Now, errorMessage, LogType.Error));
     return probe;
 }
예제 #2
0
 public ProbeExecution CreateAProbeExecution(ProbeResult probeResult, string capability)
 {
     ProbeExecution probe = new ProbeExecution();
     probe.Capability = capability;
     this.SetExecutionLog(probeResult.ExecutionLog, probe);
     return probe;
 }
예제 #3
0
        /// <summary>
        /// Create a probe execution with error status and detail log entries, provided by LogEntries parameter;
        /// </summary>
        /// <param name="p">The probe capabality</param>
        /// <param name="iEnumerable">the set of log entries.</param>
        /// <returns></returns>
        public ProbeExecution CreateAProbeExecutionWithError(string capability, IEnumerable <ProbeLogItem> logEntries)
        {
            ProbeExecution probe = new ProbeExecution();

            probe.Capability = capability;
            this.SetExecutionLog(logEntries, probe);
            return(probe);
        }
예제 #4
0
        /// <summary>
        /// Creates a probe execution with error status.
        /// This is necessary because in the execution of the collect, can be happen an
        ///  error and should be possible to track the error.
        /// </summary>
        /// <param name="capability">The capability.</param>
        /// <param name="errorMessage">The error message.</param>
        /// <returns></returns>
        public ProbeExecution CreateAProbeExecutionWithError(string capability, string errorMessage)
        {
            ProbeExecution probe = new ProbeExecution();

            probe.Capability = capability;
            probe.ExecutionLogs.Add(this.CreateExecutionLog(DateTime.Now, errorMessage, LogType.Error));
            return(probe);
        }
예제 #5
0
        public ProbeExecution CreateAProbeExecution(ProbeResult probeResult, string capability)
        {
            ProbeExecution probe = new ProbeExecution();

            probe.Capability = capability;
            this.SetExecutionLog(probeResult.ExecutionLog, probe);
            return(probe);
        }
예제 #6
0
        private void SetExecutionLog(IEnumerable <ProbeLogItem> probeLogs, ProbeExecution probeExecution)
        {
            foreach (ProbeLogItem logItem in probeLogs)
            {
                if (logItem == null)
                {
                    continue;
                }

                try
                {
                    LogType             type         = (LogType)Enum.Parse(typeof(LogType), logItem.Type.ToString(), true);
                    CollectExecutionLog executionLog = CreateExecutionLog(logItem.Date, logItem.Message, type);
                    probeExecution.ExecutionLogs.Add(executionLog);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #7
0
 /// <summary>
 /// Create a probe execution with error status and detail log entries, provided by LogEntries parameter;
 /// </summary>
 /// <param name="p">The probe capabality</param>
 /// <param name="iEnumerable">the set of log entries.</param>
 /// <returns></returns>
 public ProbeExecution CreateAProbeExecutionWithError(string capability, IEnumerable<ProbeLogItem> logEntries)
 {
     ProbeExecution probe = new ProbeExecution();
     probe.Capability = capability;
     this.SetExecutionLog(logEntries, probe);
     return probe;
 }
예제 #8
0
        private void SetExecutionLog(IEnumerable<ProbeLogItem> probeLogs, ProbeExecution probeExecution)
        {
            foreach (ProbeLogItem logItem in probeLogs)
            {
                if (logItem == null)
                    continue;

                try
                {
                    LogType type = (LogType)Enum.Parse(typeof(LogType), logItem.Type.ToString(), true);
                    CollectExecutionLog executionLog = CreateExecutionLog(logItem.Date, logItem.Message, type);
                    probeExecution.ExecutionLogs.Add(executionLog);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
        }
예제 #9
0
 public ProbeExecution CreateProbeExecution(IDocumentSession session, string capability)
 {
     ProbeExecution registryProbe = new ProbeExecution()
     {
         Capability = capability,                               
     };
     return registryProbe;
 }