Example #1
0
        /// <summary>
        /// Takes action to process a logset based on the current status of the Logset.
        /// </summary>
        private LogsetParsingResult ProcessLogset(LogsharkRequest request, RunInitializationResult runInitializationResult)
        {
            var statusChecker = new LogsetProcessingStatusChecker(request.Configuration.MongoConnectionInfo);
            LogsetProcessingStatus existingProcessedLogsetStatus = statusChecker.GetStatus(runInitializationResult.LogsetHash, runInitializationResult.CollectionsRequested);

            Func <LogsetParsingRequest, LogsetParsingResult> parseLogset = logsetParsingRequest => ParseLogset(logsetParsingRequest, request.Configuration);
            Action <string> dropLogset = logsetHash => MongoAdminHelper.DropDatabase(request.Configuration.MongoConnectionInfo.GetClient(), logsetHash);

            var parsingRequest = new LogsetParsingRequest(runInitializationResult, request.ForceParse);
            ILogsetProcessingStrategy processingStrategy = LogsetProcessingStrategyFactory.GetLogsetProcessingStrategy(request.Target, parseLogset, dropLogset, request.Configuration);

            return(processingStrategy.ProcessLogset(parsingRequest, existingProcessedLogsetStatus));
        }
 /// <summary>
 /// Retrieves the status of any existing logsets that match the hash of this request.
 /// </summary>
 public static LogsetStatus GetExistingLogsetStatus(LogsharkRequest request)
 {
     return(LogsetProcessingStatusChecker.GetStatus(request));
 }