use of bio.terra.common.migrate.LiquibaseMigrator 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.
}
use of bio.terra.common.migrate.LiquibaseMigrator in project terra-resource-buffer by DataBiosphere.
the class StartupInitializer method initialize.
public static void initialize(ApplicationContext applicationContext) {
logger.info("Initializing the application after the application is setup");
applicationContext.getBean(StackdriverExporter.class).initialize();
// Initialize or upgrade the database depending on the configuration
LiquibaseMigrator migrateService = applicationContext.getBean(LiquibaseMigrator.class);
BufferDatabaseConfiguration bufferDatabaseConfiguration = applicationContext.getBean(BufferDatabaseConfiguration.class);
BufferDatabaseProperties bufferDatabaseProperties = applicationContext.getBean(BufferDatabaseProperties.class);
// of this if-else block.
if (bufferDatabaseProperties.isRecreateDbOnStart()) {
migrateService.initialize(changelogPath, bufferDatabaseConfiguration.getDataSource());
} else if (bufferDatabaseProperties.isUpdateDbOnStart()) {
migrateService.upgrade(changelogPath, bufferDatabaseConfiguration.getDataSource());
}
initializeStairwayComponent(applicationContext);
applicationContext.getBean(PoolService.class).initialize();
applicationContext.getBean(FlightScheduler.class).initialize();
applicationContext.getBean(CleanupScheduler.class).initialize();
}
Aggregations