org.unitils.dbmaintainer.script
Interface ScriptSource

All Superinterfaces:
Configurable
All Known Implementing Classes:
DefaultScriptSource

public interface ScriptSource
extends Configurable

A source that provides scripts for updating the database to a given state.

Author:
Filip Neven, Tim Ducheyne

Method Summary
 List<Script> getAllUpdateScripts()
           
 List<Script> getNewScripts(Version highestExecutedScriptVersion, Set<ExecutedScript> alreadyExecutedScripts)
          Returns a list of scripts including the ones that: have a higher version than the given version are unversioned, and they weren't yet applied on the database are unversioned, and their contents differ from the one currently applied to the database

The scripts are returned in the order in which they should be executed.

 List<Script> getPostProcessingScripts()
          Gets a list of all post processing scripts.
 boolean isExistingIndexedScriptModified(Version currentVersion, Set<ExecutedScript> alreadyExecutedScripts)
          Returns true if one or more scripts that have a version index equal to or lower than the index specified by the given version object has been modified since the timestamp specfied by the given version.
 
Methods inherited from interface org.unitils.core.util.Configurable
init
 

Method Detail

getAllUpdateScripts

List<Script> getAllUpdateScripts()
Returns:
a list of all available update scripts, in the order in which they must be executed on the database. These scripts can be used to completely recreate the database from scratch. Not null

getNewScripts

List<Script> getNewScripts(Version highestExecutedScriptVersion,
                           Set<ExecutedScript> alreadyExecutedScripts)
Returns a list of scripts including the ones that:
  1. have a higher version than the given version
  2. are unversioned, and they weren't yet applied on the database
  3. are unversioned, and their contents differ from the one currently applied to the database
  4. The scripts are returned in the order in which they should be executed.

    Parameters:
    highestExecutedScriptVersion - The highest version of the versioned scripts that were already applied to the database
    alreadyExecutedScripts - The scripts which were already executed on the database
    Returns:
    The new scripts.

isExistingIndexedScriptModified

boolean isExistingIndexedScriptModified(Version currentVersion,
                                        Set<ExecutedScript> alreadyExecutedScripts)
Returns true if one or more scripts that have a version index equal to or lower than the index specified by the given version object has been modified since the timestamp specfied by the given version.

Parameters:
currentVersion - The current database version, not null
alreadyExecutedScripts -
Returns:
True if an existing script has been modified, false otherwise

getPostProcessingScripts

List<Script> getPostProcessingScripts()
Gets a list of all post processing scripts.

The scripts are returned in the order in which they should be executed.

Returns:
All the postprocessing code scripts, not null


Copyright © 2011. All Rights Reserved.