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 Details

    • DatabaseUpgraderTracker

      public DatabaseUpgraderTracker(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
      The constructor.
      Parameters:
      jdbcTemplate - the jdbcTemplate
  • Method Details

    • executionBegin

      public void executionBegin(String taskSimpleName)
      What to do when a task starts.
      Specified by:
      executionBegin in interface com.foilen.smalltools.upgrader.trackers.UpgraderTracker
      Parameters:
      taskSimpleName - the task simple class name
    • executionEnd

      public void executionEnd(String taskSimpleName, boolean isSuccessful)
      What to do when a task ends.
      Specified by:
      executionEnd in interface com.foilen.smalltools.upgrader.trackers.UpgraderTracker
      Parameters:
      taskSimpleName - the task simple class name
      isSuccessful - if the task was successful
    • trackerBegin

      public void trackerBegin()
      What to do when the tracker starts.
      Specified by:
      trackerBegin in interface com.foilen.smalltools.upgrader.trackers.UpgraderTracker
    • trackerEnd

      public void trackerEnd()
      What to do when the tracker ends.
      Specified by:
      trackerEnd in interface com.foilen.smalltools.upgrader.trackers.UpgraderTracker
    • wasExecutedSuccessfully

      public boolean wasExecutedSuccessfully(String taskSimpleName)
      Check if a task was executed successfully.
      Specified by:
      wasExecutedSuccessfully in interface com.foilen.smalltools.upgrader.trackers.UpgraderTracker
      Parameters:
      taskSimpleName - the task simple class name
      Returns:
      true if it was executed successfully