public Migrator(ILoggerFactory logger, IProjectRepository projectRepository, IConfiguration configuration, IConfigurationStore configStore, ILiteDbAgent liteDbAgent, IFileRepository fileRepo, IImportFile importFile, IEnvironmentHelper environmentHelper, ICalibrationFileAgent dcFileAgent) { Log = logger.CreateLogger <Migrator>(); ProjectRepo = projectRepository; FileRepo = fileRepo; ImportFile = importFile; _database = liteDbAgent; DcFileAgent = dcFileAgent; _appSettings = configuration; _resumeMigration = configStore.GetValueBool("RESUME_MIGRATION", true); _reProcessFailedProjects = configStore.GetValueBool("REPROCESS_FAILED_PROJECTS", true); _reProcessSkippedFiles = configStore.GetValueBool("REPROCESS_SKIPPED_FILES", true); _fileSpaceId = environmentHelper.GetVariable("TCCFILESPACEID", 48); _uploadFileApiUrl = environmentHelper.GetVariable("IMPORTED_FILE_API_URL2", 1); _importedFileApiUrl = environmentHelper.GetVariable("IMPORTED_FILE_API_URL", 3); _capMigrationCount = configStore.GetValueInt("CAP_MIGRATION_COUNT", defaultValue: int.MaxValue); _tempFolder = Path.Combine( environmentHelper.GetVariable("TEMPORARY_FOLDER", 2), "DataOceanMigrationTmp", environmentHelper.GetVariable("MIGRATION_ENVIRONMENT", 2)); // Diagnostic settings _downloadProjectFiles = configStore.GetValueBool("DOWNLOAD_PROJECT_FILES", defaultValue: false); _uploadProjectFiles = configStore.GetValueBool("UPLOAD_PROJECT_FILES", defaultValue: false); _saveFailedProjects = configStore.GetValueBool("SAVE_FAILED_PROJECT_IDS", defaultValue: true); }
public ImportFile(ILoggerFactory loggerFactory, ITPaaSApplicationAuthentication authentication, IRestClient restClient, ILiteDbAgent databaseAgent, IEnvironmentHelper environmentHelper) { _log = loggerFactory.CreateLogger <ImportFile>(); _bearerToken = "Bearer " + authentication.GetApplicationBearerToken(); _jwtToken = environmentHelper.GetVariable("JWT_TOKEN", 1); _restClient = restClient; _database = databaseAgent; _maxFileSize = int.Parse(environmentHelper.GetVariable("MAX_FILE_SIZE", 1)); }
public CalibrationFileAgent(ILoggerFactory loggerFactory, ILiteDbAgent liteDbAgent, IConfigurationStore configStore, IEnvironmentHelper environmentHelper, IFileRepository fileRepo, IWebApiUtils webApiUtils, ICSIBAgent csibAgent, IDataOceanAgent dataOceanAgent, IMemoryCache memoryCache) { _log = loggerFactory.CreateLogger <CalibrationFileAgent>(); _log.LogInformation(Method.In()); _migrationDb = liteDbAgent; _webApiUtils = webApiUtils; _csibAgent = csibAgent; _dataOceanAgent = dataOceanAgent; _fileRepo = fileRepo; _cache = memoryCache; _cache.Set(COORDINATE_SYSTEM_FILES_KEY, new List <string>()); _projectApiUrl = environmentHelper.GetVariable("PROJECT_API_URL", 1); _fileSpaceId = environmentHelper.GetVariable("TCCFILESPACEID", 48); _tempFolder = Path.Combine( environmentHelper.GetVariable("TEMPORARY_FOLDER", 2), "DataOceanMigrationTmp", environmentHelper.GetVariable("MIGRATION_ENVIRONMENT", 2)); _updateProjectCoordinateSystemFile = configStore.GetValueBool("UPDATE_PROJECT_COORDINATE_SYSTEM_FILE", defaultValue: false); }