Enum Class JobState

java.lang.Object
java.lang.Enum<JobState>
org.oddjob.state.JobState
All Implemented Interfaces:
Serializable, Comparable<JobState>, Constable, State

public enum JobState extends Enum<JobState> implements State
Encapsulate the allowed states for a job.
Author:
Rob Gordon
  • Enum Constant Details

    • READY

      public static final JobState READY
      Indicates the job is ready to be executing. The Oddjob Framework will only execute a job which is in this state.
    • EXECUTING

      public static final JobState EXECUTING
      Indicates the job is executing.
    • ACTIVE

      public static final JobState ACTIVE
      An Asynchronous Job is waiting to complete.
    • INCOMPLETE

      public static final JobState INCOMPLETE
      Indicates the job is not complete. Typically this is not unexpected, for instance a job which looks for a file, and a parent job will re-execute the job again at a later date.
    • COMPLETE

      public static final JobState COMPLETE
      Indicates job has completed.
    • EXCEPTION

      public static final JobState EXCEPTION
      Indicates an exception has occurred. This is generally recoverable. Such as database failure, disk full etc.
    • DESTROYED

      public static final JobState DESTROYED
      The job has been destroyed. It can no longer be used.
  • Method Details

    • values

      public static JobState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JobState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • stateFor

      public static JobState stateFor(String state)
      Utility function to convert a state text to to the JobState.
      Parameters:
      state - Case insensitive text.
      Returns:
      The corresponding jobState or null if it's invalid.