public DataBaseService(string name, string rootPath, long fileSize, SupportedSources source, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; var regex = new Regex(".*"); //valid if (regex.IsMatch(rootPath)) { DataBase = new DataBase { Name = name, Settings = new Settings { RootPath = rootPath, FileSize = fileSize, DefaultSource = source } }; _fileWorker = fileWorkerFactory.GetFileWorker(DataBase); _fileWorker.UpdateDataBaseFile(); } else { throw new ArgumentException($"Incorrect path: {rootPath}"); } }
public DataBaseServiceFactory(IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _fileWorkerFactory = fileWorkerFactory; _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; }
public FileConsumerManager(BlockingCollection <ControlMessage> controlQueue, BlockingCollection <WorkMessage> workQueue, IFileWorkerFactory workerFactory, IOptions <FileConsumerManagerOptions> options, ILogger <FileConsumerManager> logger) { _controlQueue = controlQueue; _workQueue = workQueue; _workerFactory = workerFactory; _options = options.Value; _logger = logger; }
public DataBaseService(string path, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; SupportedSources source = ResolvePath(path); _fileWorker = fileWorkerFactory.GetFileWorker(new DataBase { Settings = new Settings { DefaultSource = source } }); DataBase = _fileWorker.GetDataBaseFromFile(path); _fileWorker.DataBase = DataBase; }