Class DatabaseUpgraderTracker
java.lang.Object
com.foilen.smalltools.upgrader.trackers.DatabaseUpgraderTracker
- All Implemented Interfaces:
com.foilen.smalltools.upgrader.trackers.UpgraderTracker
public class DatabaseUpgraderTracker
extends Object
implements com.foilen.smalltools.upgrader.trackers.UpgraderTracker
A tracker that stores the successfully executed tasks in a database.
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseUpgraderTracker(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecutionBegin(String taskSimpleName) What to do when a task starts.voidexecutionEnd(String taskSimpleName, boolean isSuccessful) What to do when a task ends.voidWhat to do when the tracker starts.voidWhat to do when the tracker ends.booleanwasExecutedSuccessfully(String taskSimpleName) Check if a task was executed successfully.
-
Constructor Details
-
DatabaseUpgraderTracker
public DatabaseUpgraderTracker(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) The constructor.- Parameters:
jdbcTemplate- the jdbcTemplate
-
-
Method Details
-
executionBegin
What to do when a task starts.- Specified by:
executionBeginin interfacecom.foilen.smalltools.upgrader.trackers.UpgraderTracker- Parameters:
taskSimpleName- the task simple class name
-
executionEnd
What to do when a task ends.- Specified by:
executionEndin interfacecom.foilen.smalltools.upgrader.trackers.UpgraderTracker- Parameters:
taskSimpleName- the task simple class nameisSuccessful- if the task was successful
-
trackerBegin
public void trackerBegin()What to do when the tracker starts.- Specified by:
trackerBeginin interfacecom.foilen.smalltools.upgrader.trackers.UpgraderTracker
-
trackerEnd
public void trackerEnd()What to do when the tracker ends.- Specified by:
trackerEndin interfacecom.foilen.smalltools.upgrader.trackers.UpgraderTracker
-
wasExecutedSuccessfully
Check if a task was executed successfully.- Specified by:
wasExecutedSuccessfullyin interfacecom.foilen.smalltools.upgrader.trackers.UpgraderTracker- Parameters:
taskSimpleName- the task simple class name- Returns:
- true if it was executed successfully
-