Enum JobStatus
- java.lang.Object
-
- java.lang.Enum<JobStatus>
-
- dk.netarkivet.harvester.datamodel.JobStatus
-
- All Implemented Interfaces:
Serializable
,Comparable<JobStatus>
public enum JobStatus extends Enum<JobStatus>
Enumeration of the possible states (alt.: status) a Job can be in.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description 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.FAILED_REJECTED
Job status for a job which has failed and which has been rejected for resubmission.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.
-
Field Summary
Fields Modifier and Type Field Description static int
ALL_STATUS_CODE
Constant representing ALL states.static String
JOBSTATUS_DONE_KEY
Localization key for the DONE JobStatus.static String
JOBSTATUS_FAILED_KEY
Localization key for the FAILED JobStatus.static String
JOBSTATUS_FAILED_REJECTED_KEY
Localization key for a JobStatus FAILED_REJECTED.static String
JOBSTATUS_NEW_KEY
Localization key for the NEW JobStatus.static String
JOBSTATUS_RESUBMITTED_KEY
Localization key for the RESUBMITTED JobStatus.static String
JOBSTATUS_STARTED_KEY
Localization key for the STARTED JobStatus.static String
JOBSTATUS_SUBMITTED_KEY
Localization key for the SUBMITTED JobStatus.static String
JOBSTATUS_UNKNOWN_KEY
Localization key for a unknown JobStatus.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JobStatus
fromOrdinal(int status)
Helper method that gives a proper object from e.g.String
getLocalizedString(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
parse(String status)
Helper method that gives a proper object from e.g.static JobStatus
valueOf(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 are declared.
-
-
-
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.
-
FAILED_REJECTED
public static final JobStatus FAILED_REJECTED
Job status for a job which has failed and which has been rejected for resubmission. A Job in this status can be returned to status FAILED if it has been rejected in error.
-
-
Field Detail
-
ALL_STATUS_CODE
public static final int ALL_STATUS_CODE
Constant representing ALL states.- See Also:
- Constant Field Values
-
JOBSTATUS_NEW_KEY
public static String JOBSTATUS_NEW_KEY
Localization key for the NEW JobStatus.
-
JOBSTATUS_SUBMITTED_KEY
public static String JOBSTATUS_SUBMITTED_KEY
Localization key for the SUBMITTED JobStatus.
-
JOBSTATUS_STARTED_KEY
public static String JOBSTATUS_STARTED_KEY
Localization key for the STARTED JobStatus.
-
JOBSTATUS_DONE_KEY
public static String JOBSTATUS_DONE_KEY
Localization key for the DONE JobStatus.
-
JOBSTATUS_FAILED_KEY
public static String JOBSTATUS_FAILED_KEY
Localization key for the FAILED JobStatus.
-
JOBSTATUS_RESUBMITTED_KEY
public static String JOBSTATUS_RESUBMITTED_KEY
Localization key for the RESUBMITTED JobStatus.
-
JOBSTATUS_UNKNOWN_KEY
public static String JOBSTATUS_UNKNOWN_KEY
Localization key for a unknown JobStatus.
-
JOBSTATUS_FAILED_REJECTED_KEY
public static String JOBSTATUS_FAILED_REJECTED_KEY
Localization key for a JobStatus FAILED_REJECTED.
-
-
Method Detail
-
values
public static JobStatus[] values()
Returns an array containing the constants of this enum type, in the order they are 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 are declared
-
valueOf
public static JobStatus valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
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
-
parse
public static JobStatus parse(String status)
Helper method that gives a proper object from e.g. a DB-stored value.- Parameters:
status
- a status string- Returns:
- the JobStatus related to a string
- Throws:
ArgumentNotValid
-
getLocalizedString
public String getLocalizedString(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
-
-