Rice Pastry API

rice.pastry.transport
Class BogusNodeHandle

java.lang.Object
  extended by java.util.Observable
      extended by rice.p2p.commonapi.NodeHandle
          extended by rice.pastry.NodeHandle
              extended by rice.pastry.socket.TransportLayerNodeHandle<java.util.Collection<java.net.InetSocketAddress>>
                  extended by rice.pastry.transport.BogusNodeHandle
All Implemented Interfaces:
java.io.Serializable, RawSerializable

public class BogusNodeHandle
extends TransportLayerNodeHandle<java.util.Collection<java.net.InetSocketAddress>>

See Also:
Serialized Form

Field Summary
 java.util.Collection<java.net.InetSocketAddress> addresses
           
 
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
BogusNodeHandle(java.net.InetSocketAddress address)
           
BogusNodeHandle(java.net.InetSocketAddress[] bootstraps)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Equality operator for nodehandles.
 java.util.Collection<java.net.InetSocketAddress> getAddress()
           
 long getEpoch()
           
 int getLiveness()
          A more detailed version of isAlive().
 Id 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 msg)
           
 void serialize(OutputBuffer buf)
           
 java.lang.String toString()
           
 
Methods inherited from class rice.pastry.NodeHandle
addObserver, addObserver, assertLocalNode, bootstrap, checkLiveness, countObservers, deleteObserver, deleteObservers, getId, getLocalNode, isAlive, notifyObservers, update
 
Methods inherited from class java.util.Observable
clearChanged, hasChanged, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

addresses

public java.util.Collection<java.net.InetSocketAddress> addresses
Constructor Detail

BogusNodeHandle

public BogusNodeHandle(java.net.InetSocketAddress address)

BogusNodeHandle

public BogusNodeHandle(java.net.InetSocketAddress[] bootstraps)
Method Detail

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.

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

getNodeId

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

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

toString

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

hashCode

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

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

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.

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

receiveMessage

public void receiveMessage(Message msg)
Specified by:
receiveMessage in class NodeHandle

serialize

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

getAddress

public java.util.Collection<java.net.InetSocketAddress> getAddress()
Specified by:
getAddress in class TransportLayerNodeHandle<java.util.Collection<java.net.InetSocketAddress>>

getEpoch

public long getEpoch()
Specified by:
getEpoch in class TransportLayerNodeHandle<java.util.Collection<java.net.InetSocketAddress>>

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection