Class DatabaseMigratorBase
java.lang.Object
org.frankframework.jdbc.migration.DatabaseMigratorBase
- All Implemented Interfaces:
IConfigurationAware
,IScopeProvider
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
LiquibaseMigrator
public abstract class DatabaseMigratorBase
extends Object
implements IConfigurationAware, org.springframework.beans.factory.InitializingBean
DatabaseMigration implementation for IAF.
- Since:
- 7.0-B4
- Author:
- Niels Meijer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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()
protected final URL
getResource
(String path) boolean
Check whether the configuration contains liquibase script that can be translated into sql statements in the classpathboolean
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) 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 script
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
DatabaseMigratorBase
public DatabaseMigratorBase()
-
-
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() -
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
-