Package net.sf.basedb.core
Enum Job.ExecutionTime
- java.lang.Object
-
- java.lang.Enum<Job.ExecutionTime>
-
- net.sf.basedb.core.Job.ExecutionTime
-
- All Implemented Interfaces:
Serializable
,Comparable<Job.ExecutionTime>
- Enclosing class:
- Job
public static enum Job.ExecutionTime extends Enum<Job.ExecutionTime>
A rough estimate of the execution time of a job.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LONG
The job takes more than 1 hour to execute.MEDIUM
The job shouldn't take less than 1 hour to execute.SHORT
The job shouldn't take more than 10 minutes to execute.SHORTEST
The job is fast and should not take more than a minute to execute.
-
Field Summary
Fields Modifier and Type Field Description private int
defaultPriority
private int
defaultSlots
private String
displayValue
private int
value
private static Map<Integer,Job.ExecutionTime>
valueMapping
Maps the integer that is stored in the database.
-
Constructor Summary
Constructors Modifier Constructor Description private
ExecutionTime(int value, String displayValue, int defaultSlots, int defaultPriority)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Job.ExecutionTime
fromValue(int value)
Get theJob.Status
object when you know the integer code.int
getDefaultPriority()
The default thread priority to use when executing jobs in with this execution time.int
getDefaultSlots()
The default number of execution slots available for jobs with this execution time in the internal job queue.int
getValue()
Get the integer value that is used when storing aJob.ExecutionTime
in the database.String
toString()
static Job.ExecutionTime
valueOf(String name)
Returns the enum constant of this type with the specified name.static Job.ExecutionTime[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHORTEST
public static final Job.ExecutionTime SHORTEST
The job is fast and should not take more than a minute to execute.
-
SHORT
public static final Job.ExecutionTime SHORT
The job shouldn't take more than 10 minutes to execute.
-
MEDIUM
public static final Job.ExecutionTime MEDIUM
The job shouldn't take less than 1 hour to execute.
-
LONG
public static final Job.ExecutionTime LONG
The job takes more than 1 hour to execute.
-
-
Field Detail
-
valueMapping
private static final Map<Integer,Job.ExecutionTime> valueMapping
Maps the integer that is stored in the database.
-
value
private final int value
-
displayValue
private final String displayValue
-
defaultSlots
private final int defaultSlots
-
defaultPriority
private final int defaultPriority
-
-
Constructor Detail
-
ExecutionTime
private ExecutionTime(int value, String displayValue, int defaultSlots, int defaultPriority)
-
-
Method Detail
-
values
public static Job.ExecutionTime[] 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 (Job.ExecutionTime c : Job.ExecutionTime.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Job.ExecutionTime 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
-
fromValue
public static Job.ExecutionTime fromValue(int value)
Get theJob.Status
object when you know the integer code.- Parameters:
value
- The integer value.- Returns:
- The type object or null if the value is unknown
-
toString
public String toString()
- Overrides:
toString
in classEnum<Job.ExecutionTime>
-
getValue
public int getValue()
Get the integer value that is used when storing aJob.ExecutionTime
in the database.- Returns:
- The integer value of this type
-
getDefaultSlots
public int getDefaultSlots()
The default number of execution slots available for jobs with this execution time in the internal job queue.
-
getDefaultPriority
public int getDefaultPriority()
The default thread priority to use when executing jobs in with this execution time.
-
-