dk.netarkivet.harvester.datamodel
Enum JobPriority

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

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

Enum of the possible priorities of a job. Jobs with a given priority are sent to the same queue, and each harvester listens to one if them.


Enum Constant Summary
HIGHPRIORITY
          High priority jobs.
LOWPRIORITY
          Low priority jobs.
 
Method Summary
static JobPriority 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 a job with this priority.
static JobPriority valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static JobPriority[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LOWPRIORITY

public static final JobPriority LOWPRIORITY
Low priority jobs. Used for snapshot harvests.


HIGHPRIORITY

public static final JobPriority HIGHPRIORITY
High priority jobs. Used for selected and event harvests.

Method Detail

values

public static JobPriority[] 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 (JobPriority c : JobPriority.values())
    System.out.println(c);

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

valueOf

public static JobPriority 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
java.lang.NullPointerException - if the argument is null

fromOrdinal

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

Parameters:
status - a certain integer
Returns:
the JobPrioroty related to a certain integer

getLocalizedString

public java.lang.String getLocalizedString(java.util.Locale l)
Return a localized human-readable string describing a job with this priority. 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.