|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable rice.p2p.commonapi.NodeHandle rice.pastry.NodeHandle rice.pastry.dist.DistNodeHandle rice.pastry.socket.SocketNodeHandle
Class which represents the address and nodeId of a remote node. In the socket protocol, it simply represents this information - all other details are managed by the local nodes. SocketNodeHandle can now internally exist without a NodeId. This is to get the memory management correct
Field Summary | |
static int |
DEFAULT_PROXIMITY
DESCRIBE THE FIELD |
protected EpochInetSocketAddress |
eaddress
DESCRIBE THE FIELD |
static int |
LIVENESS_DEAD_FOREVER
DESCRIBE THE FIELD |
Fields inherited from class rice.pastry.dist.DistNodeHandle |
address, epoch, nodeId |
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 | |
SocketNodeHandle(EpochInetSocketAddress address,
Id nodeId)
Constructor |
Method Summary | |
void |
bootstrap(Message msg)
Method which is used by Pastry to start the bootstrapping process on the local node using this handle as the bootstrap handle. |
boolean |
checkLiveness()
Method which FORCES a check of liveness of the remote node. |
boolean |
equals(java.lang.Object obj)
Equivalence relation for nodehandles. |
EpochInetSocketAddress |
getEpochAddress()
Gets the EpochAddress attribute of the SocketNodeHandle object |
int |
getLiveness()
Returns the last known liveness information about the Pastry node associated with this handle. |
int |
hashCode()
Hash codes for node handles. |
boolean |
isLocal()
Method which returns whether or not this node handle is on its home node. |
void |
markDeadForever()
You can call this method if the node shuts down nicely. |
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)
Called to send a message to the node corresponding to this handle. |
void |
serialize(OutputBuffer buf)
DESCRIBE THE METHOD |
void |
setLocalNode(SocketPastryNode spn)
Sets the LocalNode attribute of the SocketNodeHandle object |
void |
setNodeId(Id nodeId)
Sets the NodeId attribute of the SocketNodeHandle object |
java.lang.String |
toString()
Returns a String representation of this DistNodeHandle. |
protected void |
update(java.lang.Object update)
Method which allows the observers of this socket node handle to be updated. |
void |
update(java.util.Observable o,
java.lang.Object obj)
DESCRIBE THE METHOD |
Methods inherited from class rice.pastry.dist.DistNodeHandle |
getAddress, getEpoch, getNodeId |
Methods inherited from class rice.pastry.NodeHandle |
assertLocalNode, getId, getLocalNode, isAlive |
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 |
protected EpochInetSocketAddress eaddress
public static final int LIVENESS_DEAD_FOREVER
public static int DEFAULT_PROXIMITY
Constructor Detail |
public SocketNodeHandle(EpochInetSocketAddress address, Id nodeId)
nodeId
- This node handle's node Id.address
- DESCRIBE THE PARAMETERMethod Detail |
public EpochInetSocketAddress getEpochAddress()
public int getLiveness()
getLiveness
in class NodeHandle
public boolean isLocal()
public void setNodeId(Id nodeId)
nodeId
- The new NodeId valuepublic void setLocalNode(SocketPastryNode spn)
spn
- The new LocalNode valuepublic void markDeadForever()
public boolean checkLiveness()
checkLiveness
in class NodeHandle
public void receiveMessage(Message msg)
receiveMessage
in class NodeHandle
msg
- Message to be delivered, may or may not be routeMessage.public void bootstrap(Message msg) throws java.io.IOException
bootstrap
in class NodeHandle
msg
- the bootstrap message.
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic java.lang.String toString()
toString
in class DistNodeHandle
public boolean equals(java.lang.Object obj)
equals
in class DistNodeHandle
obj
- the other nodehandle .
public int hashCode()
hashCode
in class DistNodeHandle
public int proximity()
proximity
in class NodeHandle
public boolean ping()
ping
in class NodeHandle
public void update(java.util.Observable o, java.lang.Object obj)
o
- DESCRIBE THE PARAMETERobj
- DESCRIBE THE PARAMETERprotected void update(java.lang.Object update)
update
- The updatepublic void serialize(OutputBuffer buf) throws java.io.IOException
serialize
in class NodeHandle
buf
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTION
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |