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 Summary
FieldsFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
isAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.HasApplicationContext
getConfigurationClassLoaderMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
AbstractDatabaseMigrator
public AbstractDatabaseMigrator()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getDatasourceName
-
getResource
-
lookupMigratorDatasource
- Throws:
SQLException
-
validate
public abstract boolean validate()Validate the current already executed ChangeSets against the migration script -
update
Run the migration script against the database.- Throws:
JdbcException
-
update
Run the migration script and write the output to theWriter.- Throws:
JdbcException
-
update
Run the provided migration script (against the local database) and write the output to theWriter.- Throws:
JdbcException
-
hasMigrationScript
public boolean hasMigrationScript()Check whether the configuration contains liquibase script that can be translated into sql statements in the classpath -
getChangeLog
-
logConfigurationMessage
-
setApplicationContext
public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getApplicationContext
public final org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContextin interfaceHasApplicationContext
-
isEnabled
public boolean isEnabled() -
getPhase
public int getPhase()- Specified by:
getPhasein interfaceConfigurableLifecycle- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceConfigurableLifecycle- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
configure
Description 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 interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-