Rice Pastry API

rice.pastry.testing
Class LeafSetTest.TestNodeHandle

java.lang.Object
  |
  +--java.util.Observable
        |
        +--rice.p2p.commonapi.NodeHandle
              |
              +--rice.pastry.NodeHandle
                    |
                    +--rice.pastry.testing.LeafSetTest.TestNodeHandle
All Implemented Interfaces:
java.lang.Comparable, LocalNodeI, MessageReceiver, java.io.Serializable
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
localnode
 
Fields inherited from class rice.p2p.commonapi.NodeHandle
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED
 
Fields inherited from interface rice.pastry.LocalNodeI
pending
 
Constructor Summary
LeafSetTest.TestNodeHandle(rice.pastry.NodeId id)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
          Equality operator for nodehandles.
 rice.pastry.NodeId getNodeId()
          Gets the nodeId of this Pastry node.
 int hashCode()
          Hash codes for nodehandles.
 boolean isAlive()
          Returns the last known liveness information about the Pastry node associated with this handle.
 boolean ping()
          Ping the node.
 int proximity()
          Returns the last known proximity information about the Pastry node associated with this handle.
 void receiveMessage(rice.pastry.messaging.Message m)
          Passes a message along to entity which is this message receiver.
 java.lang.String toString()
           
 
Methods inherited from class rice.pastry.NodeHandle
afterSetLocalNode, assertLocalNode, getId, getLocalNode, setLocalNode
 
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(rice.pastry.NodeId id)
Method Detail

getNodeId

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

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

isAlive

public boolean isAlive()
Description copied from class: NodeHandle
Returns the last known liveness information about the Pastry node associated with this handle. Invoking this method does not cause network activity.

Specified by:
isAlive in class NodeHandle
Returns:
true if the node is alive, false otherwise.

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(rice.pastry.messaging.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

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection