|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
planet.commonapi.NodeHandle
This interface is an abstraction of a node handle from the CommonAPI paper. A node handle is a handle to a known node, which conceptually includes the node's Id, as well as the node's underlying network address (such as IP/port).
Field Summary | |
static java.lang.Integer |
DECLARED_DEAD
|
static java.lang.Integer |
DECLARED_LIVE
|
static java.lang.Integer |
PROXIMITY_CHANGED
|
Constructor Summary | |
NodeHandle()
|
Method Summary | |
abstract Id |
getId()
Returns this node's id. |
abstract int |
getProximity()
Evaluates the proximity between the node who invokes this method, and the node that represents this NodeHandle. |
abstract boolean |
isAlive()
Returns whether or not this node is currently alive |
abstract void |
setAlive(boolean alive)
Updates the alive flag. |
abstract NodeHandle |
setValues(Id newValue)
Sets the new Id for this NodeHandle, and the flag 'alive' to true. |
abstract NodeHandle |
setValues(Id newValue,
boolean alive)
Sets the new Id for this NodeHandle, and the flag 'alive' to the specified value. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Integer PROXIMITY_CHANGED
public static final java.lang.Integer DECLARED_DEAD
public static final java.lang.Integer DECLARED_LIVE
Constructor Detail |
public NodeHandle()
Method Detail |
public abstract Id getId()
public abstract boolean isAlive()
public abstract void setAlive(boolean alive)
alive
- New value for the alive flag.public abstract int getProximity()
public abstract NodeHandle setValues(Id newValue)
newValue
- The new Id
public abstract NodeHandle setValues(Id newValue, boolean alive)
newValue
- The new Idalive
- true if the NodeHandle is alive.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |