|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbmaintain.script.executedscriptinfo.impl.DefaultExecutedScriptInfoSource
public class DefaultExecutedScriptInfoSource
Implementation of VersionSource
that stores the version in the database.
Field Summary | |
---|---|
protected boolean |
autoCreateExecutedScriptsTable
|
protected SortedSet<ExecutedScript> |
cachedExecutedScripts
|
protected String |
checksumColumnName
|
protected int |
checksumColumnSize
|
protected Database |
defaultDatabase
|
protected String |
executedAtColumnName
|
protected int |
executedAtColumnSize
|
protected String |
executedScriptsTableName
|
protected String |
fileLastModifiedAtColumnName
|
protected String |
fileNameColumnName
|
protected int |
fileNameColumnSize
|
protected ScriptFactory |
scriptFactory
|
protected SQLHandler |
sqlHandler
|
protected String |
succeededColumnName
|
protected DateFormat |
timestampFormat
|
protected boolean |
validExecutedScriptsTable
|
Constructor Summary | |
---|---|
DefaultExecutedScriptInfoSource(boolean autoCreateExecutedScriptsTable,
String executedScriptsTableName,
String fileNameColumnName,
int fileNameColumnSize,
String fileLastModifiedAtColumnName,
String checksumColumnName,
int checksumColumnSize,
String executedAtColumnName,
int executedAtColumnSize,
String succeededColumnName,
DateFormat timestampFormat,
Database defaultSupport,
SQLHandler sqlHandler,
ScriptFactory scriptFactory)
|
Method Summary | |
---|---|
protected boolean |
checkExecutedScriptsTable()
Checks if the version table and columns are available and if a record exists in which the version info is stored. |
void |
clearAllExecutedScripts()
Clears all script executions that have been registered. |
protected void |
createExecutedScriptsTable()
Creates the version table and inserts a version record. |
void |
deleteAllExecutedPostprocessingScripts()
Removes all previously registered executed postprocessing scripts |
void |
deleteExecutedScript(ExecutedScript executedScript)
Remove the given executed script from the executed scripts |
protected SortedSet<ExecutedScript> |
doGetExecutedScripts()
Precondition: The table db_executed_scripts must exist |
protected String |
getCreateExecutedScriptTableStatement()
|
SortedSet<ExecutedScript> |
getExecutedScripts()
|
protected String |
getQualifiedExecutedScriptsTableName()
|
protected void |
insertExecutedScript(ExecutedScript executedScript)
Saves the given registered script Precondition: The table db_executed_scripts must exist |
protected boolean |
isExecutedScriptsTableValid()
Checks if the version table and columns are available and if a record exists in which the version info is stored. |
void |
markErrorScriptsAsSuccessful()
Marks the failed scripts in the executed scripts table as successful. |
void |
registerExecutedScript(ExecutedScript executedScript)
Registers the fact that the given script has been executed on the database |
void |
removeErrorScripts()
Removes the failed scripts in the executed scripts table. |
void |
renameExecutedScript(ExecutedScript executedScript,
Script renamedToScript)
Registers the fact that the script that was originally executed has been renamed. |
void |
resetCachedState()
Resets the cached state, for example when the scripts table was modified by another process. |
void |
updateExecutedScript(ExecutedScript executedScript)
Updates the given registered script |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SortedSet<ExecutedScript> cachedExecutedScripts
protected Database defaultDatabase
protected SQLHandler sqlHandler
protected String executedScriptsTableName
protected String fileNameColumnName
protected int fileNameColumnSize
protected String fileLastModifiedAtColumnName
protected String checksumColumnName
protected int checksumColumnSize
protected String executedAtColumnName
protected int executedAtColumnSize
protected String succeededColumnName
protected boolean autoCreateExecutedScriptsTable
protected DateFormat timestampFormat
protected boolean validExecutedScriptsTable
protected ScriptFactory scriptFactory
Constructor Detail |
---|
public DefaultExecutedScriptInfoSource(boolean autoCreateExecutedScriptsTable, String executedScriptsTableName, String fileNameColumnName, int fileNameColumnSize, String fileLastModifiedAtColumnName, String checksumColumnName, int checksumColumnSize, String executedAtColumnName, int executedAtColumnSize, String succeededColumnName, DateFormat timestampFormat, Database defaultSupport, SQLHandler sqlHandler, ScriptFactory scriptFactory)
Method Detail |
---|
public SortedSet<ExecutedScript> getExecutedScripts()
getExecutedScripts
in interface ExecutedScriptInfoSource
protected SortedSet<ExecutedScript> doGetExecutedScripts()
public void registerExecutedScript(ExecutedScript executedScript)
registerExecutedScript
in interface ExecutedScriptInfoSource
executedScript
- The script that was executed on the databaseprotected void insertExecutedScript(ExecutedScript executedScript)
executedScript
- The script that needs to be saved, not nullpublic void updateExecutedScript(ExecutedScript executedScript)
updateExecutedScript
in interface ExecutedScriptInfoSource
executedScript
- The script that needs to be updated, not nullpublic void deleteExecutedScript(ExecutedScript executedScript)
deleteExecutedScript
in interface ExecutedScriptInfoSource
executedScript
- The executed script, which is no longer part of the executed scriptspublic void renameExecutedScript(ExecutedScript executedScript, Script renamedToScript)
renameExecutedScript
in interface ExecutedScriptInfoSource
executedScript
- the original executed script that still refers to the original scriptrenamedToScript
- the script to which the original script has been renamedpublic void deleteAllExecutedPostprocessingScripts()
ExecutedScriptInfoSource
deleteAllExecutedPostprocessingScripts
in interface ExecutedScriptInfoSource
public void clearAllExecutedScripts()
getExecutedScripts()
will return an empty set.
clearAllExecutedScripts
in interface ExecutedScriptInfoSource
public void markErrorScriptsAsSuccessful()
markErrorScriptsAsSuccessful
in interface ExecutedScriptInfoSource
public void removeErrorScripts()
removeErrorScripts
in interface ExecutedScriptInfoSource
protected boolean checkExecutedScriptsTable()
protected boolean isExecutedScriptsTableValid()
protected void createExecutedScriptsTable()
protected String getCreateExecutedScriptTableStatement()
protected String getQualifiedExecutedScriptsTableName()
public void resetCachedState()
resetCachedState
in interface ExecutedScriptInfoSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |