org.ow2.clif.supervisor.api
Class BladeState

java.lang.Object
  extended by org.ow2.clif.supervisor.api.BladeState
All Implemented Interfaces:
java.io.Serializable

public class BladeState
extends java.lang.Object
implements java.io.Serializable

Representation of a blade state

Author:
Bruno Dillenseger, Joan Chaumont
See Also:
Serialized Form

Field Summary
static BladeState ABORTED
           
static BladeState COMPLETED
           
static BladeState DEPLOYED
           
static BladeState DEPLOYING
           
static BladeState INCOHERENT
           
static BladeState INITIALIZED
           
static BladeState INITIALIZING
           
static BladeState NONE
           
static BladeState RESUMING
           
static BladeState RUNNING
           
static BladeState STARTING
           
static BladeState STOPPED
           
static BladeState STOPPING
           
static BladeState SUSPENDED
           
static BladeState SUSPENDING
           
static BladeState UNDEPLOYED
           
 
Constructor Summary
protected BladeState(java.lang.String label)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          equality is based on the state code value
static BladeState get(int code)
           
 int getCode()
           
static BladeState getGlobalState(java.util.Collection<BladeState> states)
          Return the global state for a collection of state
static boolean isRunning(java.util.Collection<BladeState> states)
          Determine if the global state is running.
static boolean isStationaryState(java.util.Collection<BladeState> states)
          Determine if the globalState is a stationary state or a transient state.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDEPLOYED

public static final BladeState UNDEPLOYED

DEPLOYING

public static final BladeState DEPLOYING

DEPLOYED

public static final BladeState DEPLOYED

INITIALIZING

public static final BladeState INITIALIZING

INITIALIZED

public static final BladeState INITIALIZED

STARTING

public static final BladeState STARTING

RUNNING

public static final BladeState RUNNING

SUSPENDING

public static final BladeState SUSPENDING

SUSPENDED

public static final BladeState SUSPENDED

RESUMING

public static final BladeState RESUMING

COMPLETED

public static final BladeState COMPLETED

STOPPING

public static final BladeState STOPPING

STOPPED

public static final BladeState STOPPED

ABORTED

public static final BladeState ABORTED

INCOHERENT

public static final BladeState INCOHERENT

NONE

public static final BladeState NONE
Constructor Detail

BladeState

protected BladeState(java.lang.String label)
Method Detail

get

public static BladeState get(int code)

getGlobalState

public static BladeState getGlobalState(java.util.Collection<BladeState> states)
Return the global state for a collection of state

Parameters:
states - The collection of states.
Returns:
A BladeState corresponding to the global state

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCode

public int getCode()

equals

public boolean equals(java.lang.Object obj)
equality is based on the state code value

Overrides:
equals in class java.lang.Object

isStationaryState

public static boolean isStationaryState(java.util.Collection<BladeState> states)
Determine if the globalState is a stationary state or a transient state.

Parameters:
states - Collection of states
Returns:
true if the global state is stationary, false otherwise

isRunning

public static boolean isRunning(java.util.Collection<BladeState> states)
Determine if the global state is running. Because running is a mix state (transationnal and stationary).

Parameters:
states - Collection of states
Returns:
true if at least one blade is running and the others are stopped or completed