Enum Class ServiceState

java.lang.Object
java.lang.Enum<ServiceState>
de.iip_ecosphere.platform.services.environment.ServiceState
All Implemented Interfaces:
Serializable, Comparable<ServiceState>, Constable

public enum ServiceState extends Enum<ServiceState>
Service states. See also platform handbook, state machine for valid service state transitions.
Author:
Holger Eichelberger, SSE
  • Enum Constant Details

    • 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
      The service is starting. The transition from DEPLOYING to STARTING may be direct/short.
    • 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, or STOPPED.
    • STOPPING

      public static final ServiceState STOPPING
      The service is stopping.
    • STOPPED

      public static final ServiceState STOPPED
      The service is stopped, in particular not RUNNING/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 is PASSIVATED and in progress of being migrated.
    • ACTIVATING

      public static final ServiceState ACTIVATING
      The service is re-activating from PASSIVATED or MIGRATING.
    • RECOVERING

      public static final ServiceState RECOVERING
      The service is recovering from a failure, i.e., not RUNNING/processing.
    • RECOVERED

      public static final ServiceState RECOVERED
      The service is recovered and shall now switch back to the previous non-failure/recovering state, in particular RUNNING/processing.
    • RECONFIGURING

      public static final ServiceState RECONFIGURING
      The service is being reconfigured. Depending on the reconfiguration, this may go via PASSIVATING, PASSIVATED, ACTIVATING or it may directly come from/go to RUNNING.
    • UNDEPLOYING

      public static final ServiceState UNDEPLOYING
      After STOPPED the service is not going back to STARTING rather than being undeployed and disposed.
    • UNKNOWN

      public static final ServiceState UNKNOWN
      The state of the service is not known.
  • Field Details

  • Constructor Details

    • ServiceState

      private ServiceState()
  • Method Details

    • values

      public static ServiceState[] 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

      public static ServiceState valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • addValidTransition

      private static void addValidTransition(ServiceState source, ServiceState... targets)
      Adds a valid transition. Transitions to FAILED or UNKNOWN are implicitly valid.
      Parameters:
      source - the source state to transition from
      targets - the target state(s) to transition to
    • isValidTransition

      public boolean isValidTransition(ServiceState target)
      Returns whether a transition from this state to target is valid.
      Parameters:
      target - the target state
      Returns:
      true for valid, false else
    • validateTransition

      public static void validateTransition(ServiceState source, ServiceState target) throws ExecutionException
      Validates a service state transition and throws an exception if the transition is invalid.
      Parameters:
      source - the source state
      target - the target state
      Throws:
      ExecutionException - if source is null or a transition from source to target is not valid
    • toString

      public static String toString(ServiceState state)
      Turns the given state to a String.
      Parameters:
      state - the state to turn into a String, may be null, UNKNOWN is used then
      Returns:
      the string representation
    • toString

      public static String toString(ServiceState state, ServiceState dflt)
      Turns the given state to a String.
      Parameters:
      state - the state to turn into a String, may be null, state is used then
      dflt - the default value to use if state is null
      Returns:
      the string representation