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 Details

    • log

      protected org.apache.logging.log4j.Logger log
  • Constructor Details

    • DatabaseMigratorBase

      public DatabaseMigratorBase()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getDatasourceName

      public String getDatasourceName()
    • getResource

      protected final URL getResource(String path)
    • lookupMigratorDatasource

      protected final DataSource lookupMigratorDatasource() throws SQLException
      Throws:
      SQLException
    • validate

      public abstract boolean validate()
      Validate the current already executed ChangeSets against the migration script
    • update

      public abstract void update() throws JdbcException
      Run the migration script against the database.
      Throws:
      JdbcException
    • update

      public abstract void update(Writer writer) throws JdbcException
      Run the migration script and write the output to the Writer.
      Throws:
      JdbcException
    • update

      public abstract void update(Writer writer, Resource resource) throws JdbcException
      Run the provided migration script (against the local database) and write the output to the Writer.
      Throws:
      JdbcException
    • hasMigrationScript

      public boolean hasMigrationScript()
      Check whether the configuration contains liquibase script that can be translated into sql statements in the classpath
    • getChangeLog

      public abstract Resource getChangeLog()
    • logConfigurationMessage

      protected final void logConfigurationMessage(String message)
    • setApplicationContext

      public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • getApplicationContext

      public final org.springframework.context.ApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface IConfigurationAware
    • isEnabled

      public boolean isEnabled()
    • setDataSourceFactory

      public void setDataSourceFactory(IDataSourceFactory dataSourceFactory)
    • getConfiguration

      public Configuration getConfiguration()
    • setDefaultDatasourceName

      public void setDefaultDatasourceName(String defaultDatasourceName)
    • getName

      public String getName()
      Specified by:
      getName in interface IConfigurationAware
    • getConfigurationClassLoader

      public ClassLoader 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 interface IScopeProvider
      Returns:
      returns the ClassLoader created by the ClassLoaderManager.
    • setDatasourceName

      public void setDatasourceName(String datasourceName)