Example #1
0
        public void Initialise(
            IUploadAllocationFileMonitor uploadAllocationFileMonitor,
            IUploadTradeFileMonitor uploadTradeFileMonitor,
            IUploadEtlFileMonitor uploadEtlFileMonitor)
        {
            try
            {
                this._logger.LogInformation("Initialising file upload monitoring process");

                this._uploadAllocationFileMonitor = uploadAllocationFileMonitor;
                this._uploadTradeFileMonitor      = uploadTradeFileMonitor;
                this._uploadEtlFileMonitor        = uploadEtlFileMonitor;
                this._cts   = new CancellationTokenSource();
                this._token = new AwsResusableCancellationToken();

                this._queueClient.SubscribeToQueueAsync(
                    this._configuration.DataImportS3UploadQueueName,
                    this.ReadMessage,
                    this._cts.Token,
                    this._token);
            }
            catch (Exception e)
            {
                this._logger.LogError(e, $"S3FileUploadMonitoringProcess");
            }
        }
Example #2
0
        public Mediator(
            IEnrichmentService enrichmentService,
            IUploadAllocationFileMonitor allocationFileMonitor,
            IUploadTradeFileMonitor tradeFileMonitor,
            IUploadEtlFileMonitor etlFileMonitor,
            IS3FileUploadMonitoringProcess s3FileUploadProcess,
            IFileScannerScheduler fileScanner,
            ILogger <Mediator> logger)
        {
            this._enrichmentService = enrichmentService ?? throw new ArgumentNullException(nameof(enrichmentService));

            this._allocationFileMonitor =
                allocationFileMonitor ?? throw new ArgumentNullException(nameof(allocationFileMonitor));

            this._tradeFileMonitor = tradeFileMonitor ?? throw new ArgumentNullException(nameof(tradeFileMonitor));

            this._etlFileMonitor = etlFileMonitor ?? throw new ArgumentNullException(nameof(etlFileMonitor));

            this._s3FileUploadProcess =
                s3FileUploadProcess ?? throw new ArgumentNullException(nameof(s3FileUploadProcess));

            this._fileScanner = fileScanner ?? throw new ArgumentNullException(nameof(fileScanner));

            this._logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }