Package org.springframework.batch.core
Enum Class BatchStatus
- All Implemented Interfaces:
Serializable
,Comparable<BatchStatus>
,Constable
Enumeration representing the status of an execution.
- Author:
- Lucas Ward, Dave Syer, Michael Minella, Mahmoud Ben Hassine
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionStatus of a batch job that did not stop properly and can not be restarted.The batch job has successfully completed its execution.Status of a batch job that has failed during its execution.Status of a batch job that is running.Status of a batch job prior to its execution.Status of a batch job that has been stopped by request.Status of batch job waiting for a step to complete before stopping the batch job.Status of a batch job that is in an uncertain state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isGreaterThan
(BatchStatus other) boolean
isLessThan
(BatchStatus other) boolean
isLessThanOrEqualTo
(BatchStatus other) boolean
Convenience method to decide if a status indicates that work is in progress.boolean
Convenience method to decide if a status indicates execution was unsuccessful.static BatchStatus
Find aBatchStatus
that matches the beginning of the given value.static BatchStatus
max
(BatchStatus status1, BatchStatus status2) Convenience method to return the higher value status of the statuses passed to the method.upgradeTo
(BatchStatus other) Method used to move status values through their logical progression, and override less severe failures with more severe ones.static BatchStatus
Returns the enum constant of this class with the specified name.static BatchStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMPLETED
The batch job has successfully completed its execution. -
STARTING
Status of a batch job prior to its execution. -
STARTED
Status of a batch job that is running. -
STOPPING
Status of batch job waiting for a step to complete before stopping the batch job. -
STOPPED
Status of a batch job that has been stopped by request. -
FAILED
Status of a batch job that has failed during its execution. -
ABANDONED
Status of a batch job that did not stop properly and can not be restarted. -
UNKNOWN
Status of a batch job that is in an uncertain state.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
max
Convenience method to return the higher value status of the statuses passed to the method.- Parameters:
status1
- The first status to check.status2
- The second status to check.- Returns:
- The higher value status of the two statuses.
-
isRunning
public boolean isRunning()Convenience method to decide if a status indicates that work is in progress.- Returns:
- true if the status is STARTING, STARTED
-
isUnsuccessful
public boolean isUnsuccessful()Convenience method to decide if a status indicates execution was unsuccessful.- Returns:
true
if the status isFAILED
or greater.
-
upgradeTo
Method used to move status values through their logical progression, and override less severe failures with more severe ones. This value is compared with the parameter, and the one that has higher priority is returned. If both areSTARTED
or less than the value returned is the largest in the sequenceSTARTING
,STARTED
,COMPLETED
. Otherwise, the value returned is the maximum of the two.- Parameters:
other
- Another status to which to compare.- Returns:
- either this or the other status, depending on their priority.
-
isGreaterThan
- Parameters:
other
- A status value to which to compare.- Returns:
true
if this is greater thanother
.
-
isLessThan
- Parameters:
other
- A status value to which to compare.- Returns:
true
if this is less thanother
.
-
isLessThanOrEqualTo
- Parameters:
other
- A status value to which to compare.- Returns:
true
if this is less thanother
.
-
match
Find aBatchStatus
that matches the beginning of the given value. If no match is found, returnCOMPLETED
as the default because it has low precedence.- Parameters:
value
- A string representing a status.- Returns:
- a {BatchStatus} object.
-