枚举 BatchStatus
- java.lang.Object
- java.lang.Enum<BatchStatus>
- org.springframework.batch.core.BatchStatus
- 所有已实现的接口:
java.io.Serializable
,java.lang.Comparable<BatchStatus>
public enum BatchStatus extends java.lang.Enum<BatchStatus>
Enumeration representing the status of an Execution.- 作者:
- Lucas Ward, Dave Syer, Michael Minella, Mahmoud Ben Hassine
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 javax.batch.runtime.BatchStatus
getBatchStatus()
Converts the current status to the JSR-352 equivalentboolean
isGreaterThan(BatchStatus other)
boolean
isLessThan(BatchStatus other)
boolean
isLessThanOrEqualTo(BatchStatus other)
boolean
isRunning()
Convenience method to decide if a status indicates work is in progress.boolean
isUnsuccessful()
Convenience method to decide if a status indicates execution was unsuccessful.static BatchStatus
match(java.lang.String value)
Find a BatchStatus that matches the beginning of the given value.static BatchStatus
max(BatchStatus status1, BatchStatus status2)
BatchStatus
upgradeTo(BatchStatus other)
Method used to move status values through their logical progression, and override less severe failures with more severe ones.static BatchStatus
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。static BatchStatus[]
values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
枚举常量详细资料
COMPLETED
public static final BatchStatus COMPLETED
The order of the status values is significant because it can be used to aggregate a set of status values - the result should be the maximum value. Since COMPLETED is first in the order, only if all elements of an execution are COMPLETED will the aggregate status be COMPLETED. A running execution is expected to move from STARTING to STARTED to COMPLETED (through the order defined byupgradeTo(BatchStatus)
). Higher values than STARTED signify more serious failure. ABANDONED is used for steps that have finished processing, but were not successful, and where they should be skipped on a restart (so FAILED is the wrong status).
STARTING
public static final BatchStatus STARTING
STARTED
public static final BatchStatus STARTED
STOPPING
public static final BatchStatus STOPPING
STOPPED
public static final BatchStatus STOPPED
FAILED
public static final BatchStatus FAILED
ABANDONED
public static final BatchStatus ABANDONED
UNKNOWN
public static final BatchStatus UNKNOWN
方法详细资料
values
public static BatchStatus[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (BatchStatus c : BatchStatus.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
valueOf
public static BatchStatus valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name
- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
java.lang.IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException
- 如果参数为空值
max
public static BatchStatus max(BatchStatus status1, BatchStatus status2)
isRunning
public boolean isRunning()
Convenience method to decide if a status indicates work is in progress.- 返回:
- true if the status is STARTING, STARTED
isUnsuccessful
public boolean isUnsuccessful()
Convenience method to decide if a status indicates execution was unsuccessful.- 返回:
- true if the status is FAILED or greater
upgradeTo
public BatchStatus upgradeTo(BatchStatus other)
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 are STARTED or less than the value returned is the largest in the sequence STARTING, STARTED, COMPLETED. Otherwise the value returned is the maximum of the two.- 参数:
other
- another status to compare to- 返回:
- either this or the other status depending on their priority
isGreaterThan
public boolean isGreaterThan(BatchStatus other)
- 参数:
other
- a status value to compare- 返回:
- true if this is greater than other
isLessThan
public boolean isLessThan(BatchStatus other)
- 参数:
other
- a status value to compare- 返回:
- true if this is less than other
isLessThanOrEqualTo
public boolean isLessThanOrEqualTo(BatchStatus other)
- 参数:
other
- a status value to compare- 返回:
- true if this is less than other
getBatchStatus
public javax.batch.runtime.BatchStatus getBatchStatus()
Converts the current status to the JSR-352 equivalent- 返回:
- JSR-352 equivalent to the current status
match
public static BatchStatus match(java.lang.String value)
Find a BatchStatus that matches the beginning of the given value. If no match is found, return COMPLETED as the default because has is low precedence.- 参数:
value
- a string representing a status- 返回:
- a BatchStatus