Class BasicJobInfo

java.lang.Object
net.solarnetwork.central.scheduler.BasicJobInfo
All Implemented Interfaces:
JobInfo
Direct Known Subclasses:
ScheduledJob

public class BasicJobInfo extends Object implements JobInfo
Basic implementation of JobInfo.
Since:
1.37
  • Constructor Details

    • BasicJobInfo

      public BasicJobInfo(String groupId, String id, String executionScheduleDescription)
  • Method Details

    • getGroupId

      public final String getGroupId()
      Description copied from interface: JobInfo
      Get the group this job belongs to.
      Specified by:
      getGroupId in interface JobInfo
      Returns:
      the group ID
    • getId

      public final String getId()
      Description copied from interface: JobInfo
      Get the ID of this job, unique to the job's group.
      Specified by:
      getId in interface JobInfo
      Returns:
      the job ID
    • getExecutionScheduleDescription

      public final String getExecutionScheduleDescription()
      Description copied from interface: JobInfo
      Get a description of the execution schedule of the job.

      The description might be a period like "every 10 minutes" or a cron expression, for example.

      Specified by:
      getExecutionScheduleDescription in interface JobInfo
      Returns:
      a description of the execution schedule
    • getJobStatus

      public JobStatus getJobStatus()
      Description copied from interface: JobInfo
      Get the status of this job.
      Specified by:
      getJobStatus in interface JobInfo
      Returns:
      the job status
    • isExecuting

      public boolean isExecuting()
      Description copied from interface: JobInfo
      Flag indicating the job is currently executing.
      Specified by:
      isExecuting in interface JobInfo
      Returns:
      true if the job is executing
    • getPreviousExecutionTime

      public Instant getPreviousExecutionTime()
      Description copied from interface: JobInfo
      Get the previous execution time of the job.

      If the job is currently executing, this value represents the time the job started.

      Specified by:
      getPreviousExecutionTime in interface JobInfo
      Returns:
      the previous execution time, or null if the job has never run before
    • getNextExecutionTime

      public Instant getNextExecutionTime()
      Description copied from interface: JobInfo
      Get the next execution time of the job.
      Specified by:
      getNextExecutionTime in interface JobInfo
      Returns:
      the next execution time, or null if no more executions are scheduled