Rice Pastry API

rice.p2p.multiring
Class MultiringNodeHandle

java.lang.Object
  extended by java.util.Observable
      extended by rice.p2p.commonapi.NodeHandle
          extended by rice.p2p.multiring.MultiringNodeHandle
All Implemented Interfaces:
java.io.Serializable, java.util.Observer

public class MultiringNodeHandle
extends NodeHandle
implements java.util.Observer

Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  NodeHandle handle
          The internal handle
protected  Id ringId
          The handle's ringId
 
Fields inherited from class rice.p2p.commonapi.NodeHandle
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED
 
Constructor Summary
MultiringNodeHandle(Id ringId, NodeHandle handle)
          Constructor
MultiringNodeHandle(InputBuffer buf, Endpoint endpoint)
           
 
Method Summary
 boolean checkLiveness()
          Requests that the underlying transport layer check to ensure that the remote node is live.
 boolean equals(java.lang.Object o)
          Returns whether or not this object is equal to the provided one
protected  NodeHandle getHandle()
          Returns the internal handle
 Id getId()
          Returns this node's id.
 Id getRingId()
          Returns the ringId of this node handle
 int hashCode()
          Returns the hashCode
 boolean isAlive()
          Returns whether or not this node is currently alive
 int proximity()
          Deprecated. use Node.proximity(NodeHandle)
 void serialize(OutputBuffer buf)
           
 java.lang.String toString()
          Prints out the string
 void update(java.util.Observable o, java.lang.Object obj)
          Observable callback.
 
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
 

Field Detail

handle

protected NodeHandle handle
The internal handle


ringId

protected Id ringId
The handle's ringId

Constructor Detail

MultiringNodeHandle

public MultiringNodeHandle(Id ringId,
                           NodeHandle handle)
Constructor

Parameters:
handle - The handle to wrap
ringId - The handle's ringId

MultiringNodeHandle

public MultiringNodeHandle(InputBuffer buf,
                           Endpoint endpoint)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getHandle

protected NodeHandle getHandle()
Returns the internal handle

Returns:
The internal handle

getRingId

public Id getRingId()
Returns the ringId of this node handle

Returns:
This node's ringId

getId

public Id getId()
Returns this node's id.

Specified by:
getId in class NodeHandle
Returns:
The corresponding node's id.

isAlive

public boolean isAlive()
Returns whether or not this node is currently alive

Specified by:
isAlive in class NodeHandle
Returns:
Whether or not this node is currently alive

proximity

public int proximity()
Deprecated. use Node.proximity(NodeHandle)

Returns the current proximity value of this node

Specified by:
proximity in class NodeHandle
Returns:
The current proximity value of this node

update

public void update(java.util.Observable o,
                   java.lang.Object obj)
Observable callback. Simply rebroadcasts

Specified by:
update in interface java.util.Observer
Parameters:
o - the updated object
obj - The paramter

toString

public java.lang.String toString()
Prints out the string

Overrides:
toString in class java.lang.Object
Returns:
A string

equals

public boolean equals(java.lang.Object o)
Returns whether or not this object is equal to the provided one

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare to
Returns:
Whether or not this is object is equal

hashCode

public int hashCode()
Returns the hashCode

Overrides:
hashCode in class java.lang.Object
Returns:
hashCode

checkLiveness

public boolean checkLiveness()
Requests that the underlying transport layer check to ensure that the remote node is live. If the node is found to be live, nothing happens, but if the node does not respond, the transport layer make take steps to verfify that the node is dead. Such steps could include finding an alteranate route to the node.

Specified by:
checkLiveness in class NodeHandle
Returns:
Whether or not the node is currently alive

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Specified by:
serialize in class NodeHandle
Throws:
java.io.IOException

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection