Example #1
0
        public ThreadManager(Ilogger logger, IDataChecker dChecker, List <string> dir, string fileUnFinishedTag, string finishedFilePath, IHash hash) //folderState.finished
        {
            logger.log(echo + "created");                                                                                                             //start from last
            this.logger            = logger;
            this.dir               = dir;
            this.fileUnFinishedTag = fileUnFinishedTag;
            this.finishedFilePath  = finishedFilePath;
            this.dChecker          = dChecker;
            this.hash              = hash;

            init(folderState.finished);
            int ignore;

            dChecker.GetLastWordOfFileInfo(finishedFilePath, out ignore, out currentWord);
            try
            {
                currentFileNr = Convert.ToInt32(Path.GetFileNameWithoutExtension(finishedFilePath));
            }
            catch (Exception e)
            {
                logger.log(echo + e);
                logger.stopLogging();
                Environment.Exit(1);
            }
        }
        public void AddChecker(IDataChecker checker)
        {
            if (checker == null)
            {
                throw new ArgumentNullException(nameof(checker));
            }

            _checkers.Add(checker);
        }
Example #3
0
        public ThreadManager(Ilogger logger, IDataChecker dChecker, List <string> dir, string fileUnFinishedTag, IHash hash) //state.none
        {
            logger.log(echo + "created");                                                                                    //new start
            this.logger            = logger;
            this.dir               = dir;
            this.fileUnFinishedTag = fileUnFinishedTag;
            this.dChecker          = dChecker;
            this.hash              = hash;

            //has to be done for everyone
            init(folderState.none);
            currentFileNr = 0;
            currentWord   = "";
        }
Example #4
0
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterInstance(_log)
            .As <ILog>()
            .SingleInstance();

            builder.RegisterType <HealthService>()
            .As <IHealthService>()
            .SingleInstance();

            builder.RegisterType <StartupManager>()
            .As <IStartupManager>()
            .SingleInstance();

            builder.RegisterType <ShutdownManager>()
            .As <IShutdownManager>()
            .AutoActivate()
            .SingleInstance();

            builder.RegisterResourcesMonitoring(_log);

            var clientAccountClient = new ClientAccountClient(_appSettings.ClientAccountServiceClient.ServiceUrl);

            builder.RegisterInstance(clientAccountClient)
            .As <IClientAccountClient>()
            .SingleInstance();

            var assetsServiceClient = new AssetsService(new Uri(_appSettings.AssetsServiceClient.ServiceUrl), new HttpClient());

            builder.RegisterInstance(assetsServiceClient)
            .As <IAssetsService>()
            .SingleInstance();

            IDataChecker checker = RegisterCheckers(
                builder,
                clientAccountClient,
                assetsServiceClient);

            var periodicalHandler = new PeriodicalHandler(checker, _log);

            builder.RegisterInstance(periodicalHandler)
            .As <IStartStop>()
            .SingleInstance();
        }
Example #5
0
 public QueryConnectHelper(
     IArchitectureDetector architectureDetector,
     IConnectionStringHelper connectionStringHelper,
     IDataChecker dataChecker,
     IDbConnectionFactory dbConnectionFactory,
     IExcelWriter excelWriter,
     ILog log,
     IRelationshipsDataChecker relationshipsDataChecker,
     ISharpCloudApiFactory sharpCloudApiFactory)
 {
     _architectureDetector   = architectureDetector;
     _connectionStringHelper = connectionStringHelper;
     _dataChecker            = dataChecker;
     _dbConnectionFactory    = dbConnectionFactory;
     _excelWriter            = excelWriter;
     _logger = log;
     _relationshipsDataChecker = relationshipsDataChecker;
     _sharpCloudApiFactory     = sharpCloudApiFactory;
 }
Example #6
0
 private QueryConnectHelper CreateQueryConnectHelper(
     IArchitectureDetector architectureDetector     = null,
     IConnectionStringHelper connectionStringHelper = null,
     IDataChecker dataChecker = null,
     IDbConnectionFactory dbConnectionFactory = null,
     IExcelWriter excelWriter = null,
     ILog log = null,
     IRelationshipsDataChecker relationshipsDataChecker = null,
     ISharpCloudApiFactory sharpCloudApiFactory         = null)
 {
     return(new QueryConnectHelper(
                architectureDetector ?? Mock.Of <IArchitectureDetector>(),
                connectionStringHelper ?? Mock.Of <IConnectionStringHelper>(),
                dataChecker ?? Mock.Of <IDataChecker>(),
                dbConnectionFactory ?? Mock.Of <IDbConnectionFactory>(),
                excelWriter ?? Mock.Of <IExcelWriter>(),
                log ?? Mock.Of <ILog>(),
                relationshipsDataChecker ?? Mock.Of <IRelationshipsDataChecker>(),
                sharpCloudApiFactory ?? Mock.Of <ISharpCloudApiFactory>()));
 }
 public TextDataProcessor(IDataChecker dataChecker, IDataParser dataParser)
 {
     this.dataChecker = dataChecker;
     this.dataParser  = dataParser;
 }
Example #8
0
 public PeriodicalHandler(IDataChecker checker, ILog log)
     : base((int)TimeSpan.FromHours(24).TotalMilliseconds, log)
 {
     _checker = checker;
 }