Enum Class ContainerState
- All Implemented Interfaces:
Serializable,Comparable<ContainerState>,Constable
Defines container states.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe container is on the device and ready to be deployed.The container is running.The container is brought to life.The container failed for some reason.The container is not operating as it is about or in the process of being migrated.The container was stopped and may be disposed or started again.The container is going out of operation.The container is about to be removed from this resource.The state of the container is not known.The container is not operating as it is being updated with a more recent version. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddValidTransition(ContainerState source, ContainerState... targets) Adds a valid transition.booleanisValidTransition(ContainerState target) Returns whether a transition from this state totargetis valid.static voidvalidateTransition(ContainerState source, ContainerState target) Validates a container state transition and throws an exception if the transition is invalid.static ContainerStateReturns the enum constant of this class with the specified name.static ContainerState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AVAILABLE
The container is on the device and ready to be deployed. Next state shall beDEPLOYING. -
DEPLOYING
The container is brought to life. Next state shall beDEPLOYED. -
DEPLOYED
-
FAILED
-
MIGRATING
-
UPDATING
-
STOPPING
The container is going out of operation. Next state shall beSTOPPED. -
STOPPED
The container was stopped and may be disposed or started again. Next state may beUNDEPLOYINGorUNDEPLOYING. -
UNDEPLOYING
The container is about to be removed from this resource. Next state may beUNKNOWN. -
UNKNOWN
The state of the container is not known.
-
-
Field Details
-
validTransitions
-
-
Constructor Details
-
ContainerState
private ContainerState()
-
-
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
-
addValidTransition
- Parameters:
source- the source state to transition fromtargets- the target state(s) to transition to
-
isValidTransition
Returns whether a transition from this state totargetis valid.- Parameters:
target- the target state- Returns:
truefor valid,falseelse
-
validateTransition
public static void validateTransition(ContainerState source, ContainerState target) throws ExecutionException Validates a container state transition and throws an exception if the transition is invalid.- Parameters:
source- the source statetarget- the target state- Throws:
ExecutionException- ifsourceis null or a transition fromsourcetotargetis not valid
-