Interface Job

All Superinterfaces:
Runnable
All Known Implementing Classes:
AbstractJob, GenericServiceJob, PersistedServiceJob, PurgeJob

public interface Job extends Runnable
A scheduled job.

A job starts out in the created state. When the job is queued for execution, it transitions to the queued state. While the job is executing it is in the running state. When the job execution ends, it transitions to the finished or failed state - depending on the outcome of the task that was performed.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the current state of this job.
    void
    Transitions this job to the pre-queued (created) state.
    Returns the ID of this Job.
    Returns the name of this Job.
    long
    Returns the priority of this job, higher the number the higher the priority
    long
    Returns the job execution time in milliseconds.
    Returns the time this job is scheduled to start.
    boolean
    Returns true if this job is ready to be queued.
    void
    Transitions this job to the queued state.

    Methods inherited from interface java.lang.Runnable

    run
  • Method Details

    • currentState

      Job.State currentState()
      Returns the current state of this job.
    • getJobId

      String getJobId()
      Returns the ID of this Job.
    • getJobName

      String getJobName()
      Returns the name of this Job.
    • getRuntime

      long getRuntime()
      Returns the job execution time in milliseconds. Returns zero if the job has not run.
    • isValid

      boolean isValid()
      Returns true if this job is ready to be queued.
    • deQueue

      void deQueue() throws InvalidJobException
      Transitions this job to the pre-queued (created) state. The job manager will call this method when there was a problem adding this job to the queue.
      Throws:
      InvalidJobException
    • queue

      void queue() throws InvalidJobException
      Transitions this job to the queued state.
      Throws:
      InvalidJobException
    • getStartTime

      Date getStartTime()
      Returns the time this job is scheduled to start.
    • getPriority

      long getPriority()
      Returns the priority of this job, higher the number the higher the priority