rice.pastry.transport
Class BogusNodeHandle
java.lang.Object
java.util.Observable
rice.p2p.commonapi.NodeHandle
rice.pastry.NodeHandle
rice.pastry.socket.TransportLayerNodeHandle<java.util.Collection<java.net.InetSocketAddress>>
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
|
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 |
addresses
public java.util.Collection<java.net.InetSocketAddress> addresses
BogusNodeHandle
public BogusNodeHandle(java.net.InetSocketAddress address)
BogusNodeHandle
public BogusNodeHandle(java.net.InetSocketAddress[] bootstraps)
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>>
Copyright © 2001-2005 - Rice Pastry.