Search in sources :

Example 1 with JobService

use of bio.terra.workspace.service.job.JobService in project terra-workspace-manager by DataBiosphere.

the class StartupInitializer method initialize.

public static void initialize(ApplicationContext applicationContext) {
    // Initialize or upgrade the database depending on the configuration
    LiquibaseMigrator migrateService = applicationContext.getBean(LiquibaseMigrator.class);
    WorkspaceDatabaseConfiguration workspaceDatabaseConfiguration = applicationContext.getBean(WorkspaceDatabaseConfiguration.class);
    JobService jobService = applicationContext.getBean(JobService.class);
    WsmApplicationService appService = applicationContext.getBean(WsmApplicationService.class);
    FeatureConfiguration featureConfiguration = applicationContext.getBean(FeatureConfiguration.class);
    // Log the state of the feature flags
    featureConfiguration.logFeatures();
    // Migrate the database
    if (workspaceDatabaseConfiguration.isInitializeOnStart()) {
        migrateService.initialize(changelogPath, workspaceDatabaseConfiguration.getDataSource());
    } else if (workspaceDatabaseConfiguration.isUpgradeOnStart()) {
        migrateService.upgrade(changelogPath, workspaceDatabaseConfiguration.getDataSource());
    }
    // The JobService initialization also handles Stairway initialization.
    jobService.initialize();
    // Process the WSM application configuration
    appService.configure();
// TODO: Fill in this method with any other initialization that needs to happen
// between the point of having the entire application initialized and
// the point of opening the port to start accepting REST requests.
}
Also used : WsmApplicationService(bio.terra.workspace.service.workspace.WsmApplicationService) WorkspaceDatabaseConfiguration(bio.terra.workspace.app.configuration.external.WorkspaceDatabaseConfiguration) LiquibaseMigrator(bio.terra.common.migrate.LiquibaseMigrator) FeatureConfiguration(bio.terra.workspace.app.configuration.external.FeatureConfiguration) JobService(bio.terra.workspace.service.job.JobService)

Aggregations

LiquibaseMigrator (bio.terra.common.migrate.LiquibaseMigrator)1 FeatureConfiguration (bio.terra.workspace.app.configuration.external.FeatureConfiguration)1 WorkspaceDatabaseConfiguration (bio.terra.workspace.app.configuration.external.WorkspaceDatabaseConfiguration)1 JobService (bio.terra.workspace.service.job.JobService)1 WsmApplicationService (bio.terra.workspace.service.workspace.WsmApplicationService)1