Rice Pastry API

rice.pastry.direct
Class DirectNodeHandle

java.lang.Object
  extended byjava.util.Observable
      extended byrice.p2p.commonapi.NodeHandle
          extended byrice.pastry.NodeHandle
              extended byrice.pastry.direct.DirectNodeHandle
All Implemented Interfaces:
LocalNodeI, MessageReceiver, java.io.Serializable

public class DirectNodeHandle
extends NodeHandle

the node handle used with the direct network

Version:
$Id: DirectNodeHandle.java,v 1.20 2005/06/02 17:23:01 jeffh Exp $
Author:
Andrew Ladd, Rongmei Zhang/Y. Charlie Hu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class rice.pastry.NodeHandle
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_SUSPECTED, localnode
 
Fields inherited from class rice.p2p.commonapi.NodeHandle
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED
 
Constructor Summary
DirectNodeHandle(PastryNode ln, PastryNode rn, NetworkSimulator sim)
          Constructor for DirectNodeHandle.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Equivalence relation for nodehandles.
 int getLiveness()
          Gets the Alive attribute of the DirectNodeHandle object
 NodeId getNodeId()
          Gets the NodeId attribute of the DirectNodeHandle object
 PastryNode getRemote()
          Gets the Remote attribute of the DirectNodeHandle object
 NetworkSimulator getSimulator()
          Gets the Simulator attribute of the DirectNodeHandle object
 int hashCode()
          Hash codes for node handles.It is the hashcode of their corresponding NodeId's.
 void notifyObservers(java.lang.Object arg)
          DESCRIBE THE METHOD
 boolean ping()
          DESCRIBE THE METHOD
 int proximity()
          DESCRIBE THE METHOD
 void receiveMessage(Message msg)
          DESCRIBE THE METHOD
 java.lang.String toString()
          DESCRIBE THE METHOD
 
Methods inherited from class rice.pastry.NodeHandle
afterSetLocalNode, assertLocalNode, bootstrap, checkLiveness, getId, getLocalNode, isAlive, setLocalNode
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectNodeHandle

public DirectNodeHandle(PastryNode ln,
                        PastryNode rn,
                        NetworkSimulator sim)
Constructor for DirectNodeHandle.

Parameters:
ln - The local pastry node
rn - The remote pastry node
sim - The current network simulator
Method Detail

getRemote

public PastryNode getRemote()
Gets the Remote attribute of the DirectNodeHandle object

Returns:
The Remote value

getNodeId

public NodeId getNodeId()
Gets the NodeId attribute of the DirectNodeHandle object

Specified by:
getNodeId in class NodeHandle
Returns:
The NodeId value

getLiveness

public int getLiveness()
Gets the Alive attribute of the DirectNodeHandle object

Specified by:
getLiveness in class NodeHandle
Returns:
The Alive value

getSimulator

public NetworkSimulator getSimulator()
Gets the Simulator attribute of the DirectNodeHandle object

Returns:
The Simulator value

notifyObservers

public void notifyObservers(java.lang.Object arg)
DESCRIBE THE METHOD

Parameters:
arg - DESCRIBE THE PARAMETER

ping

public boolean ping()
DESCRIBE THE METHOD

Specified by:
ping in class NodeHandle
Returns:
DESCRIBE THE RETURN VALUE

proximity

public int proximity()
DESCRIBE THE METHOD

Specified by:
proximity in class NodeHandle
Returns:
DESCRIBE THE RETURN VALUE

receiveMessage

public void receiveMessage(Message msg)
DESCRIBE THE METHOD

Parameters:
msg - DESCRIBE THE PARAMETER

equals

public boolean equals(java.lang.Object obj)
Equivalence relation for nodehandles. They are equal if and only if their corresponding NodeIds are equal.

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

hashCode

public int hashCode()
Hash codes for node handles.It is the hashcode of their corresponding NodeId's.

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

toString

public java.lang.String toString()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection