|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.sourceroute.manager.SourceRouteManagerImpl.AddressManager
protected class SourceRouteManagerImpl.AddressManager
Internal class which is tasked with maintaining the status of a single remote address. This class is in charge of all source routes to that address, as well as declaring liveness/death of this address
Field Summary | |
---|---|
protected Identifier |
address
|
protected SourceRoute<Identifier> |
best
the current best route to this remote address if best == null, we are already in a CheckDead, which means we are searching for a path |
protected int |
liveness
|
static int |
LIVENESS_UNKNOWN
|
protected java.util.LinkedList<org.mpisws.p2p.transport.sourceroute.manager.SourceRouteManagerImpl.AddressManager.PendingMessage> |
pendingMessages
the queue of messages waiting for a route of SocketBuffer |
protected java.util.LinkedList<org.mpisws.p2p.transport.sourceroute.manager.SourceRouteManagerImpl.AddressManager.PendingSocket> |
pendingSockets
|
protected long |
updated
|
Constructor Summary | |
---|---|
SourceRouteManagerImpl.AddressManager(Identifier address)
Constructor, given an address and whether or not it should attempt to find the best route |
Method Summary | |
---|---|
boolean |
checkLiveness(java.util.Map<java.lang.String,java.lang.Object> options)
Method which suggests a ping to the remote node. |
void |
clearLivenessState()
|
int |
getLiveness(java.util.Map<java.lang.String,java.lang.Object> options)
Method which returns the last cached liveness value for the given address. |
void |
livenessChanged(SourceRoute<Identifier> i,
int val,
java.util.Map<java.lang.String,java.lang.Object> options)
|
protected void |
markAlive(SourceRoute<Identifier> route,
java.util.Map<java.lang.String,java.lang.Object> options)
This method should be called when a known route is declared alive. |
protected void |
markDead(SourceRoute<Identifier> deadRoute,
java.util.Map<java.lang.String,java.lang.Object> options)
This method should be called when a known route is declared dead. |
protected void |
markDeadForever(java.util.Map<java.lang.String,java.lang.Object> options)
This method should be called when a known node is declared dead - this is ONLY called when a new epoch of that node is detected. |
protected void |
markProximity(SourceRoute<Identifier> route,
int proximity,
java.util.Map<java.lang.String,java.lang.Object> options)
This method should be called when a known route has its proximity updated |
protected void |
markSuspected(SourceRoute<Identifier> route,
java.util.Map<java.lang.String,java.lang.Object> options)
This method should be called when a known route is declared suspected. |
SocketRequestHandle<Identifier> |
openSocket(SocketCallback<Identifier> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Method which opens an app socket to this address |
int |
proximity(java.util.Map<java.lang.String,java.lang.Object> options)
Method which returns the last cached proximity value for the given address. |
protected void |
purgeQueue()
|
MessageRequestHandle<Identifier,java.nio.ByteBuffer> |
sendMessage(java.nio.ByteBuffer message,
MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Method which enqueues a message to this address |
protected void |
setAlive(java.util.Map<java.lang.String,java.lang.Object> options)
Internal method which marks this address as being alive. |
protected void |
setDead(java.util.Map<java.lang.String,java.lang.Object> options)
Internal method which marks this address as being dead. |
protected void |
setDeadForever(java.util.Map<java.lang.String,java.lang.Object> options)
Internal method which marks this address as being dead. |
protected void |
setSuspected(java.util.Map<java.lang.String,java.lang.Object> options)
Internal method which marks this address as being suspected. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Identifier address
protected SourceRoute<Identifier> best
protected java.util.LinkedList<org.mpisws.p2p.transport.sourceroute.manager.SourceRouteManagerImpl.AddressManager.PendingMessage> pendingMessages
protected java.util.LinkedList<org.mpisws.p2p.transport.sourceroute.manager.SourceRouteManagerImpl.AddressManager.PendingSocket> pendingSockets
protected int liveness
protected long updated
public static final int LIVENESS_UNKNOWN
Constructor Detail |
---|
public SourceRouteManagerImpl.AddressManager(Identifier address)
address
- The addresssearch
- Whether or not the manager should try and find a routeMethod Detail |
---|
public void clearLivenessState()
public int proximity(java.util.Map<java.lang.String,java.lang.Object> options)
address
- The address to return the value for
public int getLiveness(java.util.Map<java.lang.String,java.lang.Object> options)
address
- The address to return the value for
public MessageRequestHandle<Identifier,java.nio.ByteBuffer> sendMessage(java.nio.ByteBuffer message, MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
message
- The message to sendpublic SocketRequestHandle<Identifier> openSocket(SocketCallback<Identifier> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
message
- The message to sendpublic boolean checkLiveness(java.util.Map<java.lang.String,java.lang.Object> options)
public java.lang.String toString()
toString
in class java.lang.Object
public void livenessChanged(SourceRoute<Identifier> i, int val, java.util.Map<java.lang.String,java.lang.Object> options)
protected void markAlive(SourceRoute<Identifier> route, java.util.Map<java.lang.String,java.lang.Object> options)
route
- The now-live routeprotected void markSuspected(SourceRoute<Identifier> route, java.util.Map<java.lang.String,java.lang.Object> options)
route
- The now-suspected routeprotected void markDead(SourceRoute<Identifier> deadRoute, java.util.Map<java.lang.String,java.lang.Object> options)
route
- The now-dead routeprotected void markDeadForever(java.util.Map<java.lang.String,java.lang.Object> options)
address
- The now-dead addressprotected void markProximity(SourceRoute<Identifier> route, int proximity, java.util.Map<java.lang.String,java.lang.Object> options)
route
- The routeproximity
- The proximityprotected void setAlive(java.util.Map<java.lang.String,java.lang.Object> options)
java.lang.IllegalStateException
- if best is null.protected void setSuspected(java.util.Map<java.lang.String,java.lang.Object> options)
protected void setDead(java.util.Map<java.lang.String,java.lang.Object> options)
protected void setDeadForever(java.util.Map<java.lang.String,java.lang.Object> options)
protected void purgeQueue()
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |