org.unitils.dbmaintainer.version
Interface ExecutedScriptInfoSource

All Superinterfaces:
DatabaseAccessing
All Known Implementing Classes:
DefaultExecutedScriptInfoSource

public interface ExecutedScriptInfoSource
extends DatabaseAccessing

Interface that enables registering which scripts were executed on the database and retrieving this information afterwards.

Author:
Filip Neven, Tim Ducheyne

Method Summary
 void clearAllExecutedScripts()
          Clears all script executions that have been registered.
 Set<ExecutedScript> getExecutedScripts()
           
 boolean isFromScratchUpdateRecommended()
          This method returns whether a from scratch update is recommended: It will return true if the database is in it's initial state (i.e. no scripts were executed yet) and the autoCreateExecutedScriptsTable property is set to true.
 void registerExecutedScript(ExecutedScript executedScript)
          Registers the fact that the given script has been executed on the database
 void updateExecutedScript(ExecutedScript executedScript)
          Updates the given registered script
 
Methods inherited from interface org.unitils.dbmaintainer.util.DatabaseAccessing
init
 

Method Detail

isFromScratchUpdateRecommended

boolean isFromScratchUpdateRecommended()
This method returns whether a from scratch update is recommended: It will return true if the database is in it's initial state (i.e. no scripts were executed yet) and the autoCreateExecutedScriptsTable property is set to true.

The reasoning behind this is that before executing the first script, it's a good idea to clear the database in order to start with a clean situation.

Returns:
True if a from-scratch update is recommended

registerExecutedScript

void registerExecutedScript(ExecutedScript executedScript)
Registers the fact that the given script has been executed on the database

Parameters:
executedScript - The script that was executed on the database

updateExecutedScript

void updateExecutedScript(ExecutedScript executedScript)
Updates the given registered script

Parameters:
executedScript -

clearAllExecutedScripts

void clearAllExecutedScripts()
Clears all script executions that have been registered. After having invoked this method, getExecutedScripts() will return an empty set.


getExecutedScripts

Set<ExecutedScript> getExecutedScripts()
Returns:
All scripts that were registered as being executed on the database


Copyright © 2011. All Rights Reserved.