Пример #1
0
 public LogsScannerFactory(
     LogFileParserFactory logFileParserFactory,
     LogFileStreamReaderFactory streamReaderFactory,
     MonthlyLogFilesHeuristics heuristics,
     IWurmLogFiles wurmLogFiles,
     ILogger logger, [NotNull] IWurmApiConfig wurmApiConfig)
 {
     if (logFileParserFactory == null)
         throw new ArgumentNullException("logFileParserFactory");
     if (streamReaderFactory == null)
         throw new ArgumentNullException("streamReaderFactory");
     if (heuristics == null)
         throw new ArgumentNullException("heuristics");
     if (wurmLogFiles == null)
         throw new ArgumentNullException("wurmLogFiles");
     if (logger == null)
         throw new ArgumentNullException("logger");
     if (wurmApiConfig == null) throw new ArgumentNullException("wurmApiConfig");
     this.logFileParserFactory = logFileParserFactory;
     this.streamReaderFactory = streamReaderFactory;
     this.heuristics = heuristics;
     this.wurmLogFiles = wurmLogFiles;
     this.logger = logger;
     this.wurmApiConfig = wurmApiConfig;
 }
Пример #2
0
 public LogsScanner(
     [NotNull] LogSearchParameters logSearchParameters, 
     [NotNull] JobCancellationManager cancellationManager,
     [NotNull] IWurmLogFiles wurmLogFiles,
     [NotNull] MonthlyLogFilesHeuristics monthlyHeuristics,
     [NotNull] LogFileStreamReaderFactory streamReaderFactory,
     [NotNull] ILogger logger,
     [NotNull] LogFileParserFactory logFileParserFactory, 
     [NotNull] IWurmApiConfig wurmApiConfig)
 {
     if (logSearchParameters == null) throw new ArgumentNullException("logSearchParameters");
     if (cancellationManager == null) throw new ArgumentNullException("cancellationManager");
     if (wurmLogFiles == null) throw new ArgumentNullException("wurmLogFiles");
     if (monthlyHeuristics == null) throw new ArgumentNullException("monthlyHeuristics");
     if (streamReaderFactory == null) throw new ArgumentNullException("streamReaderFactory");
     if (logger == null) throw new ArgumentNullException("logger");
     if (logFileParserFactory == null) throw new ArgumentNullException("logFileParserFactory");
     if (wurmApiConfig == null) throw new ArgumentNullException("wurmApiConfig");
     this.logSearchParameters = logSearchParameters;
     this.cancellationManager = cancellationManager;
     this.wurmLogFiles = wurmLogFiles;
     this.monthlyHeuristics = monthlyHeuristics;
     this.streamReaderFactory = streamReaderFactory;
     this.logger = logger;
     this.logFileParserFactory = logFileParserFactory;
     this.wurmApiConfig = wurmApiConfig;
 }
Пример #3
0
 public SingleFileMonitorFactory(
     LogFileStreamReaderFactory streamReaderFactory,
     LogFileParser logFileParser)
 {
     if (streamReaderFactory == null) throw new ArgumentNullException("streamReaderFactory");
     if (logFileParser == null) throw new ArgumentNullException("logFileParser");
     this.streamReaderFactory = streamReaderFactory;
     this.logFileParser = logFileParser;
 }
 public MonthlyHeuristicsExtractorFactory(
     LogFileStreamReaderFactory logFileStreamReaderFactory,
     ILogger logger, [NotNull] IWurmApiConfig wurmApiConfig)
 {
     if (logFileStreamReaderFactory == null) throw new ArgumentNullException("logFileStreamReaderFactory");
     if (logger == null) throw new ArgumentNullException("logger");
     if (wurmApiConfig == null) throw new ArgumentNullException("wurmApiConfig");
     this.logFileStreamReaderFactory = logFileStreamReaderFactory;
     this.logger = logger;
     this.wurmApiConfig = wurmApiConfig;
 }
        public void Setup()
        {
            wurmApiConfig = new WurmApiConfig {Platform = Platform.Linux};

            system = new LogFileStreamReaderFactory(wurmApiConfig);

            ubuntuDir = TempDirectoriesFactory.CreateByUnzippingFile(Path.Combine(TestPaksZippedDirFullPath,
                "ubuntu-wurm-dir.7z"));

            sampleLogFilePath = Path.Combine(ubuntuDir.AbsolutePath,
                "players",
                "aldur",
                "logs",
                "_Event.2015-08.txt");
        }
Пример #6
0
        public SingleFileMonitor(
            LogFileInfo logFileInfo,
            LogFileStreamReaderFactory streamReaderFactory,
            LogFileParser logFileParser)
        {
            if (logFileInfo == null) throw new ArgumentNullException("logFileInfo");
            if (streamReaderFactory == null) throw new ArgumentNullException("streamReaderFactory");
            if (logFileParser == null) throw new ArgumentNullException("logFileParser");
            this.logFileInfo = logFileInfo;
            this.streamReaderFactory = streamReaderFactory;
            this.logFileParser = logFileParser;

            fileInfo = new FileInfo(logFileInfo.FullPath);
            lastFileSize = fileInfo.Length;
        }