dk.netarkivet.harvester.datamodel
Enum JobStatus

java.lang.Object
  extended by java.lang.Enum<JobStatus>
      extended by dk.netarkivet.harvester.datamodel.JobStatus
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<JobStatus>

public enum JobStatus
extends java.lang.Enum<JobStatus>

Enumeration of the possible states (alt.: status) a Job can be in.


Enum Constant Summary
DONE
          Job status done is used for a job that a harvester has successfully finished.
FAILED
          Job status failed is used for a job that has failed to execute correctly.
NEW
          Job status new is used for a job that has been created but not yet sent to a JMS queue.
RESUBMITTED
          Job status resubmitted is used for a job that had failed and a new job with this jobs data has been submitted.
STARTED
          Job status started is used for a job that a harvester has started.
SUBMITTED
          Job status submitted is used for a job that has been sent to a JMS queue, but not yet picked up by a harvester.
 
Method Summary
static JobStatus fromOrdinal(int status)
          Helper method that gives a proper object from e.g.
 java.lang.String getLocalizedString(java.util.Locale l)
          Return a localized human-readable string describing this status.
 boolean legalChange(JobStatus newStatus)
          True if it is legal to change from this status to a new status.
static JobStatus valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static JobStatus[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NEW

public static final JobStatus NEW
Job status new is used for a job that has been created but not yet sent to a JMS queue.


SUBMITTED

public static final JobStatus SUBMITTED
Job status submitted is used for a job that has been sent to a JMS queue, but not yet picked up by a harvester.


STARTED

public static final JobStatus STARTED
Job status started is used for a job that a harvester has started.


DONE

public static final JobStatus DONE
Job status done is used for a job that a harvester has successfully finished.


FAILED

public static final JobStatus FAILED
Job status failed is used for a job that has failed to execute correctly.


RESUBMITTED

public static final JobStatus RESUBMITTED
Job status resubmitted is used for a job that had failed and a new job with this jobs data has been submitted.

Method Detail

values

public static final JobStatus[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(JobStatus c : JobStatus.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static JobStatus valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

fromOrdinal

public static JobStatus fromOrdinal(int status)
Helper method that gives a proper object from e.g. a DB-stored value.

Parameters:
status - a certain integer
Returns:
the JobStatus related to a certain integer
Throws:
ArgumentNotValid

getLocalizedString

public java.lang.String getLocalizedString(java.util.Locale l)
Return a localized human-readable string describing this status. Strings are read from the harvester translation bundle found in Translation.properties in this module.

Parameters:
l - The locale
Returns:
A human readable string for that locale.
Throws:
ArgumentNotValid - on null locale.

legalChange

public boolean legalChange(JobStatus newStatus)
True if it is legal to change from this status to a new status.

Parameters:
newStatus - a new JobStatus
Returns:
true if it is legal to go from the current status to this new status