Exemple #1
0
 public TileGenerationJob(IConfigurationStore configurationStore, IPegasusClient pegasusClient, ITPaaSApplicationAuthentication authn, INotificationHubClient notificationHubClient, ILoggerFactory logger)
 {
     configStore                = configurationStore;
     this.pegasusClient         = pegasusClient;
     authentication             = authn;
     this.notificationHubClient = notificationHubClient;
     log = logger.CreateLogger <DxfTileGenerationJob>();
 }
Exemple #2
0
        public async Task <ContractExecutionResult> DeleteImportedFileV6(
            [FromQuery] Guid projectUid,
            [FromQuery] Guid?importedFileUid, // for 3dpm imported files
            [FromServices] IPegasusClient pegasusClient,
            [FromServices] IWebClientWrapper webClient)
        {
            Logger.LogInformation($"{nameof(DeleteImportedFileV6)}: projectUid {projectUid} importedFileUid: {importedFileUid}");

            await ValidateProjectId(projectUid.ToString());

            var importedFiles = await ImportedFileRequestDatabaseHelper.GetImportedFiles(projectUid.ToString(), Logger, ProjectRepo).ConfigureAwait(false);

            ImportedFile existing = null;

            if (importedFiles.Count > 0)
            {
                existing = importedFiles.FirstOrDefault(f => f.ImportedFileUid == importedFileUid.ToString());
            }

            if (existing == null)
            {
                ServiceExceptionHandler.ThrowServiceException(HttpStatusCode.BadRequest, 56);
                return(new ContractExecutionResult(ContractExecutionStatesEnum.InternalProcessingError, "shouldn't get here")); // to keep compiler happy
            }

            var deleteImportedFile = new DeleteImportedFile(
                projectUid, existing.ImportedFileType, JsonConvert.DeserializeObject <FileDescriptor>(existing.FileDescriptor),
                Guid.Parse(existing.ImportedFileUid), existing.ImportedFileId, existing.LegacyImportedFileId,
                DataOceanRootFolderId, existing.SurveyedUtc);

            var result = await WithServiceExceptionTryExecuteAsync(() =>
                                                                   RequestExecutorContainerFactory
                                                                   .Build <DeleteImportedFileExecutor>(
                                                                       LoggerFactory, ConfigStore, ServiceExceptionHandler, CustomerUid, UserId, UserEmailAddress, customHeaders,
                                                                       persistantTransferProxyFactory : persistantTransferProxyFactory, filterServiceProxy : filterServiceProxy, tRexImportFileProxy : tRexImportFileProxy,
                                                                       projectRepo : ProjectRepo, dataOceanClient : DataOceanClient, authn : Authorization, pegasusClient : pegasusClient, cwsProjectClient : CwsProjectClient)
                                                                   .ProcessAsync(deleteImportedFile)
                                                                   );

            await NotificationHubClient.Notify(new ProjectChangedNotification(projectUid));

            Logger.LogInformation(
                $"{nameof(DeleteImportedFileV6)}: Completed successfully. projectUid {projectUid} importedFileUid: {importedFileUid}");
            return(result);
        }
Exemple #3
0
 public void Initialise(ILogger logger, IConfigurationStore configStore,
                        IServiceExceptionHandler serviceExceptionHandler,
                        string customerUid, string userId = null, string userEmailAddress = null,
                        IHeaderDictionary headers         = null,
                        IProductivity3dV1ProxyCoord productivity3dV1ProxyCoord           = null,
                        IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction = null,
                        ITransferProxyFactory persistantTransferProxyFactory             = null, IFilterServiceProxy filterServiceProxy = null,
                        ITRexImportFileProxy tRexImportFileProxy           = null, IProjectRepository projectRepo = null,
                        IHttpContextAccessor httpContextAccessor           = null,
                        IDataOceanClient dataOceanClient                   = null, ITPaaSApplicationAuthentication authn = null,
                        ISchedulerProxy schedulerProxy                     = null, IPegasusClient pegasusClient          = null,
                        ICwsProjectClient cwsProjectClient                 = null, ICwsDeviceClient cwsDeviceClient      = null,
                        ICwsProfileSettingsClient cwsProfileSettingsClient = null,
                        IWebRequest gracefulClient = null, INotificationHubClient notificationHubClient = null)
 {
     log = logger;
     this.configStore             = configStore;
     this.serviceExceptionHandler = serviceExceptionHandler;
     this.customerUid             = customerUid;
     this.userId                          = userId;
     this.userEmailAddress                = userEmailAddress;
     this.customHeaders                   = headers;
     this.productivity3dV1ProxyCoord      = productivity3dV1ProxyCoord;
     this.productivity3dV2ProxyCompaction = productivity3dV2ProxyCompaction;
     this.persistantTransferProxyFactory  = persistantTransferProxyFactory;
     this.filterServiceProxy              = filterServiceProxy;
     this.tRexImportFileProxy             = tRexImportFileProxy;
     this.projectRepo                     = projectRepo;
     this.httpContextAccessor             = httpContextAccessor;
     this.dataOceanClient                 = dataOceanClient;
     this.authn                    = authn;
     this.schedulerProxy           = schedulerProxy;
     this.pegasusClient            = pegasusClient;
     this.cwsProjectClient         = cwsProjectClient;
     this.cwsDeviceClient          = cwsDeviceClient;
     this.cwsProfileSettingsClient = cwsProfileSettingsClient;
     this.gracefulClient           = gracefulClient;
     this.notificationHubClient    = notificationHubClient;
 }
Exemple #4
0
        /// <summary>
        /// Builds this instance for specified executor type.
        /// </summary>
        /// <typeparam name="TExecutor">The type of the executor.</typeparam>
        public static TExecutor Build <TExecutor>(
            ILoggerFactory logger, IConfigurationStore configStore, IServiceExceptionHandler serviceExceptionHandler,
            string customerUid = null, string userId = null, string userEmailAddress = null, IHeaderDictionary headers = null,
            IProductivity3dV1ProxyCoord productivity3dV1ProxyCoord = null, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction = null,
            ITransferProxyFactory persistantTransferProxyFactory   = null, IFilterServiceProxy filterServiceProxy = null, ITRexImportFileProxy tRexImportFileProxy = null,
            IProjectRepository projectRepo        = null, IHttpContextAccessor httpContextAccessor = null, IDataOceanClient dataOceanClient = null,
            ITPaaSApplicationAuthentication authn = null, ISchedulerProxy schedulerProxy           = null, IPegasusClient pegasusClient     = null,
            ICwsProjectClient cwsProjectClient    = null, ICwsDeviceClient cwsDeviceClient         = null,
            ICwsProfileSettingsClient cwsProfileSettingsClient = null,
            IWebRequest gracefulClient = null, INotificationHubClient notificationHubClient = null
            )
            where TExecutor : RequestExecutorContainer, new()
        {
            ILogger log = null;

            if (logger != null)
            {
                log = logger.CreateLogger <RequestExecutorContainer>();
            }

            var executor = new TExecutor();

            executor.Initialise(
                log, configStore, serviceExceptionHandler, customerUid, userId, userEmailAddress, headers,
                productivity3dV1ProxyCoord, productivity3dV2ProxyCompaction,
                persistantTransferProxyFactory, filterServiceProxy, tRexImportFileProxy, projectRepo,
                httpContextAccessor, dataOceanClient, authn, schedulerProxy, pegasusClient, cwsProjectClient, cwsDeviceClient,
                cwsProfileSettingsClient, gracefulClient, notificationHubClient
                );

            return(executor);
        }
Exemple #5
0
 public GeoTiffTileGenerationJob(IConfigurationStore configurationStore, IPegasusClient pegasusClient, ITPaaSApplicationAuthentication authn, INotificationHubClient notificationHubClient, ILoggerFactory logger)
     : base(configurationStore, pegasusClient, authn, notificationHubClient, logger)
 {
 }