public UploadEtlFileMonitor( IUploadConfiguration uploadConfiguration, IReddeerDirectory directory, IUploadEtlFileProcessor fileProcessor, IEnrichmentService enrichmentService, IOrdersRepository ordersRepository, IFileUploadOrdersRepository fileUploadOrdersRepository, IUploadCoordinatorMessageSender fileUploadMessageSender, ISystemProcessContext systemProcessContext, IOmsVersioner omsVersioner, ILogger <UploadEtlFileMonitor> logger) : base(directory, logger, "Upload Etl File Monitor") { this._uploadConfiguration = uploadConfiguration ?? throw new ArgumentNullException(nameof(uploadConfiguration)); this._fileProcessor = fileProcessor ?? throw new ArgumentNullException(nameof(fileProcessor)); this._enrichmentService = enrichmentService ?? throw new ArgumentNullException(nameof(enrichmentService)); this._ordersRepository = ordersRepository ?? throw new ArgumentNullException(nameof(ordersRepository)); this._fileUploadOrdersRepository = fileUploadOrdersRepository ?? throw new ArgumentNullException(nameof(fileUploadOrdersRepository)); this._fileUploadMessageSender = fileUploadMessageSender ?? throw new ArgumentNullException(nameof(fileUploadMessageSender)); this._systemProcessContext = systemProcessContext ?? throw new ArgumentNullException(nameof(systemProcessContext)); this._omsVersioner = omsVersioner ?? throw new ArgumentNullException(nameof(omsVersioner)); this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public UploadTask(IUploadConfiguration configuration, IFileServiceProxy fileService, ILoggingClient logger) { _configuration = configuration; _fileService = fileService; _logger = logger; InitMessages(); }
public void Setup() { this._uploadConfiguration = A.Fake <IUploadConfiguration>(); this._systemProcessContext = A.Fake <ISystemProcessContext>(); this._reddeerDirectory = A.Fake <IReddeerDirectory>(); this._fileProcessor = A.Fake <IAllocationFileProcessor>(); this._allocationRepository = A.Fake <IOrderAllocationRepository>(); this._fileUploadAllocationRepository = A.Fake <IFileUploadOrderAllocationRepository>(); this._coordinatorMessageSender = A.Fake <IUploadCoordinatorMessageSender>(); this._logger = A.Fake <ILogger <AllocationFileMonitor> >(); }
public void Setup() { this._uploadConfiguration = A.Fake <IUploadConfiguration>(); this._directory = A.Fake <IReddeerDirectory>(); this._fileProcessor = A.Fake <IUploadTradeFileProcessor>(); this._enrichmentService = A.Fake <IEnrichmentService>(); this._ordersRepository = A.Fake <IOrdersRepository>(); this._fileUploadOrdersRepository = A.Fake <IFileUploadOrdersRepository>(); this._systemProcessContext = A.Fake <ISystemProcessContext>(); this._messageSender = A.Fake <IUploadCoordinatorMessageSender>(); this._omsVersioner = A.Fake <IOmsVersioner>(); this._logger = A.Fake <ILogger <UploadTradeFileMonitor> >(); A.CallTo(() => this._omsVersioner.ProjectOmsVersion(A <IReadOnlyCollection <Order> > .Ignored)) .ReturnsLazily(a => (IReadOnlyCollection <Order>)a.Arguments[0]); }
public UploadEtlFileProcessor( IOrderFileToOrderSerialiser orderFileSerialiser, IEtlFileValidator etlFileValidator, IEtlUploadErrorStore etlUploadErrorStore, IUploadConfiguration configuration, IEmailNotificationMessageSender messageSender, ILogger <UploadEtlFileProcessor> logger) : base(logger) { this._orderFileSerialiser = orderFileSerialiser ?? throw new ArgumentNullException(nameof(orderFileSerialiser)); this._etlFileValidator = etlFileValidator ?? throw new ArgumentNullException(nameof(etlFileValidator)); this._etlUploadErrorStore = etlUploadErrorStore ?? throw new ArgumentNullException(nameof(etlUploadErrorStore)); this._configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this._messageSender = messageSender ?? throw new ArgumentNullException(nameof(messageSender)); }
public S3FileUploadMonitoringProcess( IFileUploadMessageMapper mapper, IUploadConfiguration configuration, IAwsQueueClient queueClient, IAwsS3Client s3Client, ILogger <S3FileUploadMonitoringProcess> logger) { this._mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); this._configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this._queueClient = queueClient ?? throw new ArgumentNullException(nameof(queueClient)); this._s3Client = s3Client ?? throw new ArgumentNullException(nameof(s3Client)); this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); this._dataImportTradeFileDirectoryPatternRegex = new Regex(this._configuration.DataImportTradeFileDirectoryPattern, RegexOptions.Compiled | RegexOptions.Singleline); this._dataImportAllocationFileDirectoryPatternRegex = new Regex(this._configuration.DataImportAllocationFileDirectoryPattern, RegexOptions.Compiled | RegexOptions.Singleline); this._dataImportEtlFileDirectoryPatternRegex = new Regex(this._configuration.DataImportEtlFileDirectoryPattern, RegexOptions.Compiled | RegexOptions.Singleline); this._dataImportIgnoreFileDirectoryPatternRegex = new Regex(this._configuration.DataImportIgnoreFileDirectoryPattern, RegexOptions.Compiled | RegexOptions.Singleline); }
public AllocationFileMonitor( IAllocationFileProcessor fileProcessor, ISystemProcessContext systemProcessContext, IUploadConfiguration uploadConfiguration, IReddeerDirectory directory, IOrderAllocationRepository repository, IFileUploadOrderAllocationRepository fileUploadRepository, IUploadCoordinatorMessageSender messageSender, ILogger <AllocationFileMonitor> logger) : base(directory, logger, "Allocation File Monitor") { this._allocationFileProcessor = fileProcessor ?? throw new ArgumentNullException(nameof(fileProcessor)); this._systemProcessContext = systemProcessContext ?? throw new ArgumentNullException(nameof(systemProcessContext)); this._uploadConfiguration = uploadConfiguration ?? throw new ArgumentNullException(nameof(uploadConfiguration)); this._allocationRepository = repository ?? throw new ArgumentNullException(nameof(repository)); this._fileUploadRepository = fileUploadRepository ?? throw new ArgumentNullException(nameof(fileUploadRepository)); this._messageSender = messageSender ?? throw new ArgumentNullException(nameof(messageSender)); }
public static MvcForm BeginAsyncUploadForm <T>(this HtmlHelper <T> htmlHelper, Uri callbackUrl, IUploadConfiguration uploadConfiguration, object htmlAttributes = null) { var formAttributes = new Dictionary <string, string> { { "data-post", callbackUrl.OriginalString }, { "enctype", "multipart/form-data" }, }.Concat(uploadConfiguration.FormAttributes); var formTagBuilder = new TagBuilder("form"); foreach (var attribute in formAttributes) { formTagBuilder.MergeAttribute(attribute.Key, attribute.Value); } if (htmlAttributes != null) { var htmlAttributeDictionary = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); formTagBuilder.MergeAttributes(htmlAttributeDictionary, replaceExisting: true); } var writer = htmlHelper.ViewContext.Writer; writer.Write(formTagBuilder.ToString(TagRenderMode.StartTag)); foreach (var field in uploadConfiguration.FormFields) { writer.Write(htmlHelper.Hidden(field.Key, field.Value)); } return(new MvcForm(htmlHelper.ViewContext)); }
public FileServiceProxy(IFileService fileService, IParallelIterator iterator, IUploadConfiguration configuration) { _fileService = fileService; _configuration = configuration; _iterator = iterator; }