Class TaskLastRun

java.lang.Object
org.deltava.taskman.TaskLastRun
All Implemented Interfaces:
Serializable, Comparable<TaskLastRun>

public class TaskLastRun extends Object implements Serializable, Comparable<TaskLastRun>
A bean to store last execution data for a Scheduled Task.
Since:
1.0
Version:
7.0
Author:
Luke
See Also:
  • Constructor Details

    • TaskLastRun

      public TaskLastRun(String name, Instant dt, long execTime)
      Creates a new Task execution data bean.
      Parameters:
      name - the name of the Task
      dt - the last execution date/time
      execTime - the execution duration in milliseconds
      Throws:
      NullPointerException - if name is null
      See Also:
  • Method Details

    • getName

      public String getName()
      Returns the Schedule Task name.
      Returns:
      the Task name
    • getLastRun

      public Instant getLastRun()
      Returns the last execution time for the Scheduled Task.
      Returns:
      the date/time the task last started, or null if never run
    • getExecTime

      public long getExecTime()
      Returns the task's last execution duration.
      Returns:
      the duration in milliseconds
    • compareTo

      public int compareTo(TaskLastRun tlr2)
      Compares two task execution beans by comparing their names and last run date/times.
      Specified by:
      compareTo in interface Comparable<TaskLastRun>