Class AbstractDatabaseMigrator
java.lang.Object
org.frankframework.jdbc.migration.AbstractDatabaseMigrator
- All Implemented Interfaces:
- HasApplicationContext,- IConfigurable,- IScopeProvider,- ConfigurableLifecycle,- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.ApplicationContextAware,- org.springframework.context.Lifecycle,- org.springframework.context.Phased,- org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
- LiquibaseMigrator
public abstract class AbstractDatabaseMigrator
extends Object
implements ConfigurableLifecycle, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, HasApplicationContext, IScopeProvider
DatabaseMigration implementation for Frank!Framework.
- Since:
- 7.0-B4
- Author:
- Niels Meijer
- 
Field SummaryFieldsFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidConfigure this component.final org.springframework.context.ApplicationContextabstract ResourceintgetPhase()protected final URLgetResource(String path) booleanCheck whether the configuration contains liquibase script that can be translated into sql statements in the classpathbooleanbooleanprotected final voidlogConfigurationMessage(String message) protected final DataSourcefinal voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidstart()voidstop()abstract voidupdate()Run the migration script against the database.abstract voidRun the migration script and write the output to theWriter.abstract voidRun the provided migration script (against the local database) and write the output to theWriter.abstract booleanvalidate()Validate the current already executed ChangeSets against the migration scriptMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycleisAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.HasApplicationContextgetConfigurationClassLoaderMethods inherited from interface org.springframework.context.SmartLifecyclestop
- 
Field Details- 
logprotected org.apache.logging.log4j.Logger log
 
- 
- 
Constructor Details- 
AbstractDatabaseMigratorpublic AbstractDatabaseMigrator()
 
- 
- 
Method Details- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
- 
getDatasourceName
- 
getResource
- 
lookupMigratorDatasource- Throws:
- SQLException
 
- 
validatepublic abstract boolean validate()Validate the current already executed ChangeSets against the migration script
- 
updateRun the migration script against the database.- Throws:
- JdbcException
 
- 
updateRun the migration script and write the output to theWriter.- Throws:
- JdbcException
 
- 
updateRun the provided migration script (against the local database) and write the output to theWriter.- Throws:
- JdbcException
 
- 
hasMigrationScriptpublic boolean hasMigrationScript()Check whether the configuration contains liquibase script that can be translated into sql statements in the classpath
- 
getChangeLog
- 
logConfigurationMessage
- 
setApplicationContextpublic final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
- setApplicationContextin interface- org.springframework.context.ApplicationContextAware
 
- 
getApplicationContextpublic final org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
- getApplicationContextin interface- HasApplicationContext
 
- 
isEnabledpublic boolean isEnabled()
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- ConfigurableLifecycle
- Specified by:
- getPhasein interface- org.springframework.context.Phased
- Specified by:
- getPhasein interface- org.springframework.context.SmartLifecycle
 
- 
startpublic void start()- Specified by:
- startin interface- ConfigurableLifecycle
- Specified by:
- startin interface- org.springframework.context.Lifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- org.springframework.context.Lifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- org.springframework.context.Lifecycle
 
- 
configureDescription copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply. - Specified by:
- configurein interface- IConfigurable
- Throws:
- ConfigurationException- in case it was not able to configure the component.
 
 
-