Class AbstractDatabaseMigrator
java.lang.Object
org.frankframework.jdbc.migration.AbstractDatabaseMigrator
- All Implemented Interfaces:
IConfigurationAware
,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, IConfigurationAware, org.springframework.beans.factory.InitializingBean
DatabaseMigration implementation for IAF.
- Since:
- 7.0-B4
- Author:
- Niels Meijer
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Configure this component.final org.springframework.context.ApplicationContext
abstract Resource
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.getName()
int
getPhase()
protected final URL
getResource
(String path) boolean
Check whether the configuration contains liquibase script that can be translated into sql statements in the classpathboolean
boolean
protected final void
logConfigurationMessage
(String message) protected final DataSource
final void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setDataSourceFactory
(IDataSourceFactory dataSourceFactory) void
setDatasourceName
(String datasourceName) void
setDefaultDatasourceName
(String defaultDatasourceName) void
start()
void
stop()
abstract void
update()
Run the migration script against the database.abstract void
Run the migration script and write the output to theWriter
.abstract void
Run the provided migration script (against the local database) and write the output to theWriter
.abstract boolean
validate()
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, wait
Methods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
isAutoStartup
Methods 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:
afterPropertiesSet
in 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
getApplicationContext
public final org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceIConfigurationAware
-
isEnabled
public boolean isEnabled() -
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceConfigurableLifecycle
- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
configure
Description copied from interface:ConfigurableLifecycle
Configure this component.In the case of a container, this will propagate the start signal to all components that apply.
- Specified by:
configure
in interfaceConfigurableLifecycle
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
setDataSourceFactory
-
getConfiguration
-
setDefaultDatasourceName
-
getName
- Specified by:
getName
in interfaceIConfigurationAware
-
getConfigurationClassLoader
Description copied from interface:IScopeProvider
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.- Specified by:
getConfigurationClassLoader
in interfaceIScopeProvider
- Returns:
- returns the ClassLoader created by the
ClassLoaderManager
.
-
setDatasourceName
-