|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbmaintain.script.analyzer.ScriptUpdatesAnalyzer
public class ScriptUpdatesAnalyzer
An instance of this class can compare the info that we have about previously executed scripts with the new scripts. It decides which of these scripts were added, updated, deleted or renamed. It also decides for each script update whether it is a regular or irregular one.
Constructor Summary | |
---|---|
ScriptUpdatesAnalyzer(ScriptRepository scriptRepository,
ExecutedScriptInfoSource executedScriptInfoSource,
boolean useScriptFileLastModificationDates,
boolean allowOutOfSequenceExecutionOfPatchScripts)
Creates a new instance that will compare the info from the given ExecutedScriptInfoSource with the current
scripts from the given ScriptRepository . |
Method Summary | |
---|---|
ScriptUpdates |
calculateScriptUpdates()
Compares the info that we have about previously executed scripts with the new scripts. |
protected Script |
findNewScriptWithSameContent(ExecutedScript executedScript)
|
protected Script |
findScriptWithSameName(ExecutedScript executedScript)
|
protected Map<String,Set<Script>> |
getCheckSumScriptMap()
|
protected Script |
getExecutedScriptWithHighestScriptIndex()
|
protected Map<String,ExecutedScript> |
getScriptNameExecutedScriptMap()
|
protected Map<String,Script> |
getScriptNameScriptMap()
|
protected void |
registerIrregularIncrementalScriptRenames()
Take all script renames that were registered using the method registerScriptRename(ExecutedScript, Script)
and register them all as irregular script renames. |
protected void |
registerIrregularScriptUpdate(ScriptUpdateType scriptUpdateType,
Script script)
|
protected void |
registerIrregularScriptUpdate(ScriptUpdateType scriptUpdateType,
Script script1,
Script script2)
|
protected void |
registerPostprocessingScriptRename(ScriptUpdateType scriptUpdateType,
Script originalScript,
Script renamedToScript)
|
protected void |
registerPostprocessingScriptUpdate(ScriptUpdateType scriptUpdateType,
Script script)
|
protected void |
registerRegularIncrementalScriptRenames()
Take all script renames that were registered using the method registerScriptRename(ExecutedScript, Script)
and register them all as regular script renames. |
protected void |
registerRegularlyAddedPatchScript(ScriptUpdateType scriptUpdateType,
Script script)
|
protected void |
registerRegularScriptRename(ScriptUpdateType scriptUpdateType,
Script originalScript,
Script renamedScript)
|
protected void |
registerRegularScriptUpdate(ScriptUpdateType scriptUpdateType,
Script script)
|
protected void |
registerRepeatableScriptDeletion(Script script)
|
protected void |
registerScriptAddition(Script script)
Register the given script as a newly added one |
protected void |
registerScriptDeletion(Script deletedScript)
Register that the given script has been deleted since the last update |
protected void |
registerScriptRename(ExecutedScript executedScript,
Script renamedTo)
Register that the given script has been renamed to the given new script since the last update |
protected void |
registerScriptUpdate(Script script)
Register that the given script's content has changed since the last update |
protected boolean |
sequenceOfIndexedScriptsChangedDueToRenames()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptUpdatesAnalyzer(ScriptRepository scriptRepository, ExecutedScriptInfoSource executedScriptInfoSource, boolean useScriptFileLastModificationDates, boolean allowOutOfSequenceExecutionOfPatchScripts)
ExecutedScriptInfoSource
with the current
scripts from the given ScriptRepository
. It also needs to know whether a new patch script with a lower
index is a regular or irregular script update
scriptRepository
- exposes the current set of scriptsexecutedScriptInfoSource
- provides info on the script that were executed on the databaseuseScriptFileLastModificationDates
- whether the last modification date of the scripts can be used to determine if a script has changed.allowOutOfSequenceExecutionOfPatchScripts
- whether scripts marked as patch scripts may be executed out-of-sequenceMethod Detail |
---|
public ScriptUpdates calculateScriptUpdates()
ScriptUpdates
object that represents all updates that were performed to the scripts since the last
database updateprotected void registerScriptAddition(Script script)
script
- The newly added scriptprotected void registerScriptUpdate(Script script)
script
- The script who's content has changedprotected void registerScriptDeletion(Script deletedScript)
deletedScript
- The script that has been deletedprotected void registerScriptRename(ExecutedScript executedScript, Script renamedTo)
executedScript
- The script like it was during the last updaterenamedTo
- The renamed scriptprotected boolean sequenceOfIndexedScriptsChangedDueToRenames()
protected void registerRegularIncrementalScriptRenames()
registerScriptRename(ExecutedScript, Script)
and register them all as regular script renames.
protected void registerIrregularIncrementalScriptRenames()
registerScriptRename(ExecutedScript, Script)
and register them all as irregular script renames.
protected Script findNewScriptWithSameContent(ExecutedScript executedScript)
executedScript
- The script as executed during a previous update
protected Script findScriptWithSameName(ExecutedScript executedScript)
executedScript
- A script as executed during a previous update
protected Map<String,ExecutedScript> getScriptNameExecutedScriptMap()
protected Map<String,Script> getScriptNameScriptMap()
protected Map<String,Set<Script>> getCheckSumScriptMap()
protected Script getExecutedScriptWithHighestScriptIndex()
protected void registerRegularScriptUpdate(ScriptUpdateType scriptUpdateType, Script script)
protected void registerIrregularScriptUpdate(ScriptUpdateType scriptUpdateType, Script script)
protected void registerIrregularScriptUpdate(ScriptUpdateType scriptUpdateType, Script script1, Script script2)
protected void registerRepeatableScriptDeletion(Script script)
protected void registerRegularlyAddedPatchScript(ScriptUpdateType scriptUpdateType, Script script)
protected void registerPostprocessingScriptUpdate(ScriptUpdateType scriptUpdateType, Script script)
protected void registerPostprocessingScriptRename(ScriptUpdateType scriptUpdateType, Script originalScript, Script renamedToScript)
protected void registerRegularScriptRename(ScriptUpdateType scriptUpdateType, Script originalScript, Script renamedScript)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |