com.sun.sgs.service
Enum Node.Health

java.lang.Object
  extended by java.lang.Enum<Node.Health>
      extended by com.sun.sgs.service.Node.Health
All Implemented Interfaces:
Serializable, Comparable<Node.Health>
Enclosing interface:
Node

public static enum Node.Health
extends Enum<Node.Health>

Health of a node.


Enum Constant Summary
GREEN
          The node is operating normally and is available for additional work.
ORANGE
          The node is operational, but is in need of attention such as offloading some of its work.
RED
          The node has failed, been shutdown, or its state is unknown.
YELLOW
          The node is operating normally but is not available for additional work.
 
Method Summary
 boolean isAlive()
          Returns true if this health represents an operational state.
static Node.Health valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Node.Health[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 boolean worseThan(Node.Health health)
          Returns true if this health is worse than the specified health.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GREEN

public static final Node.Health GREEN
The node is operating normally and is available for additional work.


YELLOW

public static final Node.Health YELLOW
The node is operating normally but is not available for additional work.


ORANGE

public static final Node.Health ORANGE
The node is operational, but is in need of attention such as offloading some of its work.


RED

public static final Node.Health RED
The node has failed, been shutdown, or its state is unknown.

Method Detail

values

public static Node.Health[] 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 (Node.Health c : Node.Health.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Node.Health valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

worseThan

public boolean worseThan(Node.Health health)
Returns true if this health is worse than the specified health.

Parameters:
health - a health object to compare
Returns:
true if this health is worse than the specified health

isAlive

public boolean isAlive()
Returns true if this health represents an operational state.

Returns:
true if this health represents an operational state

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved