ePOST API

rice.pastry.testing
Class LeafSetTest.TestNodeHandle

java.lang.Object
  extended by java.util.Observable
      extended by rice.p2p.commonapi.NodeHandle
          extended by rice.pastry.NodeHandle
              extended by rice.pastry.testing.LeafSetTest.TestNodeHandle
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, MessageReceiver
Enclosing class:
LeafSetTest

public static class LeafSetTest.TestNodeHandle
extends NodeHandle
implements java.lang.Comparable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class rice.pastry.NodeHandle
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_SUSPECTED, localnode, logger
 
Fields inherited from class rice.p2p.commonapi.NodeHandle
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED
 
Constructor Summary
LeafSetTest.TestNodeHandle(NodeId id)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
          Equality operator for nodehandles.
 int getLiveness()
          A more detailed version of isAlive().
 NodeId getNodeId()
          Gets the nodeId of this Pastry node.
 int hashCode()
          Hash codes for nodehandles.
 boolean ping()
          Ping the node.
 int proximity()
          Returns the last known proximity information about the Pastry node associated with this handle.
 void receiveMessage(Message m)
          Passes a message along to entity which is this message receiver.
 java.lang.String toString()
           
 
Methods inherited from class rice.pastry.NodeHandle
assertLocalNode, bootstrap, checkLiveness, getId, getLocalNode, isAlive
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LeafSetTest.TestNodeHandle

public LeafSetTest.TestNodeHandle(NodeId id)
Method Detail

getNodeId

public NodeId getNodeId()
Description copied from class: NodeHandle
Gets the nodeId of this Pastry node.

Specified by:
getNodeId in class NodeHandle
Returns:
the node id.

getLiveness

public int getLiveness()
Description copied from class: NodeHandle
A more detailed version of isAlive(). This can return 3 states:

Specified by:
getLiveness in class NodeHandle
Returns:
LIVENESS_ALIVE, LIVENESS_SUSPECTED, LIVENESS_DEAD

proximity

public int proximity()
Description copied from class: NodeHandle
Returns the last known proximity information about the Pastry node associated with this handle. Invoking this method does not cause network activity. Smaller values imply greater proximity. The exact nature and interpretation of the proximity metric implementation-specific.

Specified by:
proximity in class NodeHandle
Returns:
the proximity metric value

ping

public boolean ping()
Description copied from class: NodeHandle
Ping the node. Refreshes the cached liveness status and proximity value of the Pastry node associated with this. Invoking this method causes network activity.

Specified by:
ping in class NodeHandle
Returns:
true if node is currently alive.

equals

public boolean equals(java.lang.Object obj)
Description copied from class: NodeHandle
Equality operator for nodehandles.

Specified by:
equals in class NodeHandle
Parameters:
obj - a nodehandle object
Returns:
true if they are equal, false otherwise.

hashCode

public int hashCode()
Description copied from class: NodeHandle
Hash codes for nodehandles.

Specified by:
hashCode in class NodeHandle
Returns:
a hash code.

receiveMessage

public void receiveMessage(Message m)
Description copied from interface: MessageReceiver
Passes a message along to entity which is this message receiver.

Specified by:
receiveMessage in interface MessageReceiver
Parameters:
m - the message.

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

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

ePOST API

Copyright © 2001-2005 - Rice Pastry.