Enum ServiceState
- java.lang.Object
-
- java.lang.Enum<ServiceState>
-
- de.iip_ecosphere.platform.services.environment.ServiceState
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ServiceState>
public enum ServiceState extends java.lang.Enum<ServiceState>
Service states. See also platform handbook, state machine for valid service state transitions.- Author:
- Holger Eichelberger, SSE
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACTIVATINGThe service is re-activating fromPASSIVATEDorMIGRATING.AVAILABLEThe service implementation is available but not in any other state.CREATEDThe local service instance being observed has been created.DEPLOYINGThe service is being deployed, but it is not "created" and not running.FAILEDSomething failed.MIGRATINGThe service isPASSIVATEDand in progress of being migrated.PASSIVATEDThe service is passivated and can be adapted/migrated safely.PASSIVATINGThe service is passivating for an adaptation.RECONFIGURINGThe service is being reconfigured.RECOVEREDThe service is recovered and shall now switch back to the previous non-failure/recovering state, in particularRUNNING/processing.RECOVERINGThe service is recovering from a failure, i.e., notRUNNING/processing.RUNNINGThe service is running under normal conditions, i.e., processing data.STARTINGThe service is starting.STOPPEDThe service is stopped, in particular notRUNNING/processing..STOPPINGThe service is stopping.UNDEPLOYINGUNKNOWNThe state of the service is not known.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<ServiceState,java.util.Set<ServiceState>>validTransitions
-
Constructor Summary
Constructors Modifier Constructor Description privateServiceState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidaddValidTransition(ServiceState source, ServiceState... targets)Adds a valid transition.booleanisValidTransition(ServiceState target)Returns whether a transition from this state totargetis valid.static voidvalidateTransition(ServiceState source, ServiceState target)Validates a service state transition and throws an exception if the transition is invalid.static ServiceStatevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ServiceState[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AVAILABLE
public static final ServiceState AVAILABLE
The service implementation is available but not in any other state.
-
DEPLOYING
public static final ServiceState DEPLOYING
The service is being deployed, but it is not "created" and not running.
-
CREATED
public static final ServiceState CREATED
The local service instance being observed has been created.
-
STARTING
public static final ServiceState STARTING
-
RUNNING
public static final ServiceState RUNNING
The service is running under normal conditions, i.e., processing data.
-
FAILED
public static final ServiceState FAILED
Something failed. The service is not behaving normally. May go back to#RUNNING,RECOVERING, orSTOPPED.
-
STOPPING
public static final ServiceState STOPPING
The service is stopping.
-
STOPPED
public static final ServiceState STOPPED
The service is stopped, in particular notRUNNING/processing..
-
PASSIVATING
public static final ServiceState PASSIVATING
The service is passivating for an adaptation.
-
PASSIVATED
public static final ServiceState PASSIVATED
The service is passivated and can be adapted/migrated safely.
-
MIGRATING
public static final ServiceState MIGRATING
The service isPASSIVATEDand in progress of being migrated.
-
ACTIVATING
public static final ServiceState ACTIVATING
The service is re-activating fromPASSIVATEDorMIGRATING.
-
RECOVERING
public static final ServiceState RECOVERING
The service is recovering from a failure, i.e., notRUNNING/processing.
-
RECOVERED
public static final ServiceState RECOVERED
The service is recovered and shall now switch back to the previous non-failure/recovering state, in particularRUNNING/processing.
-
RECONFIGURING
public static final ServiceState RECONFIGURING
The service is being reconfigured. Depending on the reconfiguration, this may go viaPASSIVATING,PASSIVATED,ACTIVATINGor it may directly come from/go toRUNNING.
-
UNDEPLOYING
public static final ServiceState UNDEPLOYING
-
UNKNOWN
public static final ServiceState UNKNOWN
The state of the service is not known.
-
-
Field Detail
-
validTransitions
private static java.util.Map<ServiceState,java.util.Set<ServiceState>> validTransitions
-
-
Method Detail
-
values
public static ServiceState[] 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 (ServiceState c : ServiceState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServiceState valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
addValidTransition
private static void addValidTransition(ServiceState source, ServiceState... targets)
- Parameters:
source- the source state to transition fromtargets- the target state(s) to transition to
-
isValidTransition
public boolean isValidTransition(ServiceState target)
Returns whether a transition from this state totargetis valid.- Parameters:
target- the target state- Returns:
truefor valid,falseelse
-
validateTransition
public static void validateTransition(ServiceState source, ServiceState target) throws java.util.concurrent.ExecutionException
Validates a service state transition and throws an exception if the transition is invalid.- Parameters:
source- the source statetarget- the target state- Throws:
java.util.concurrent.ExecutionException- ifsourceis null or a transition fromsourcetotargetis not valid
-
-