Enum WorkerStatus
- All Implemented Interfaces:
Serializable
,Comparable<WorkerStatus>
,java.lang.constant.Constable
Describes the current status of a Worker.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe Worker has been instructed to execute a task.The Worker was considered to be lost but its heartbeat has returned, however it has not yet requested instruction.The Worker's heartbeat is late.The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost.The Worker has been instructed to shut down.The Worker has been instructed to sleep for a specified period of time.The Agent has been instructed to start the Worker.The Worker has been instructed to stop. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkerStatus
fromAction
(@NonNull WorkerAction action) Returns a WorkerStatus value based on the specified WorkerAction value.boolean
Returns true, if the status indicates the Worker is currently available; otherwise, false.boolean
Returns true, if the status indicates the Worker is currently healthy; otherwise, false.static WorkerStatus
Returns the enum constant of this type with the specified name.static WorkerStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DOING_TASK
The Worker has been instructed to execute a task. -
SLEEPING
The Worker has been instructed to sleep for a specified period of time. -
STOPPED
The Worker has been instructed to stop. -
STARTING
The Agent has been instructed to start the Worker. -
LATE
The Worker's heartbeat is late. -
LOST
The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost. -
FOUND
The Worker was considered to be lost but its heartbeat has returned, however it has not yet requested instruction. -
SHUTDOWN
The Worker has been instructed to shut down.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
fromAction
Returns a WorkerStatus value based on the specified WorkerAction value.- Parameters:
action
- the WorkerAction value- Returns:
- a WorkerStatus value based on the specified WorkerAction value
-
isAvailable
public boolean isAvailable()Returns true, if the status indicates the Worker is currently available; otherwise, false.- Returns:
- true, if the status indicates the Worker is currently available; otherwise, false
-
isHealthy
public boolean isHealthy()Returns true, if the status indicates the Worker is currently healthy; otherwise, false.- Returns:
- true, if the status indicates the Worker is currently healthy; otherwise, false
-