|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.transport.NodeHandleAdapter
public class NodeHandleAdapter
Field Summary |
---|
Fields inherited from interface org.mpisws.p2p.transport.liveness.LivenessTypes |
---|
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_DEAD_FOREVER, LIVENESS_SUSPECTED |
Fields inherited from interface org.mpisws.p2p.transport.proximity.ProximityProvider |
---|
DEFAULT_PROXIMITY |
Constructor Summary | |
---|---|
NodeHandleAdapter(TransportLayer tl,
LivenessProvider livenessProvider,
ProximityProvider proxProvider)
|
Method Summary | |
---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
void |
addLivenessListener(LivenessListener<NodeHandle> name)
|
void |
addProximityListener(ProximityListener<NodeHandle> listener)
|
boolean |
checkLiveness(NodeHandle i,
java.util.Map<java.lang.String,java.lang.Object> options)
Returns whether a new notification will occur. |
void |
clearState(NodeHandle i)
Force layer to clear the existing state related to the Identifier. |
void |
destroy()
|
int |
getLiveness(NodeHandle i,
java.util.Map<java.lang.String,java.lang.Object> options)
|
NodeHandle |
getLocalIdentifier()
The local node. |
TransportLayer |
getTL()
|
SocketRequestHandle<NodeHandle> |
openSocket(NodeHandle i,
SocketCallback<NodeHandle> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Open a socket to the Identifier |
int |
proximity(NodeHandle i,
java.util.Map<java.lang.String,java.lang.Object> options)
|
boolean |
removeLivenessListener(LivenessListener<NodeHandle> name)
|
boolean |
removeProximityListener(ProximityListener<NodeHandle> listener)
|
MessageRequestHandle<NodeHandle,RawMessage> |
sendMessage(NodeHandle i,
RawMessage m,
MessageCallback<NodeHandle,RawMessage> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Send the message to the identifier |
void |
setCallback(TransportLayerCallback<NodeHandle,RawMessage> callback)
Set the callback for incoming sockets/messages |
void |
setErrorHandler(ErrorHandler<NodeHandle> handler)
To be notified of problems not related to an outgoing messaage/socket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeHandleAdapter(TransportLayer tl, LivenessProvider livenessProvider, ProximityProvider proxProvider)
Method Detail |
---|
public void acceptMessages(boolean b)
TransportLayer
acceptMessages
in interface TransportLayer<NodeHandle,RawMessage>
public void acceptSockets(boolean b)
TransportLayer
acceptSockets
in interface TransportLayer<NodeHandle,RawMessage>
public NodeHandle getLocalIdentifier()
TransportLayer
getLocalIdentifier
in interface TransportLayer<NodeHandle,RawMessage>
public SocketRequestHandle<NodeHandle> openSocket(NodeHandle i, SocketCallback<NodeHandle> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
openSocket
in interface TransportLayer<NodeHandle,RawMessage>
i
- who to open the socket todeliverSocketToMe
- the callback when the socket is openedoptions
- options on how to open the socket (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
public MessageRequestHandle<NodeHandle,RawMessage> sendMessage(NodeHandle i, RawMessage m, MessageCallback<NodeHandle,RawMessage> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
sendMessage
in interface TransportLayer<NodeHandle,RawMessage>
i
- the destinationm
- the messagedeliverAckToMe
- layer dependent notification when the message is sent (can indicate placed on the wire, point-to-point acknowledgment, or end-to-end acknowledgement)options
- delivery options (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
public void setCallback(TransportLayerCallback<NodeHandle,RawMessage> callback)
TransportLayer
setCallback
in interface TransportLayer<NodeHandle,RawMessage>
callback
- the callback for incoming sockets/messagespublic void setErrorHandler(ErrorHandler<NodeHandle> handler)
TransportLayer
setErrorHandler
in interface TransportLayer<NodeHandle,RawMessage>
handler
- to be notified of problems not related to a specific messaage/socket.public void destroy()
destroy
in interface Destructable
public void addLivenessListener(LivenessListener<NodeHandle> name)
addLivenessListener
in interface LivenessProvider<NodeHandle>
public boolean checkLiveness(NodeHandle i, java.util.Map<java.lang.String,java.lang.Object> options)
LivenessProvider
checkLiveness
in interface LivenessProvider<NodeHandle>
i
- the node to check
public int getLiveness(NodeHandle i, java.util.Map<java.lang.String,java.lang.Object> options)
getLiveness
in interface LivenessProvider<NodeHandle>
public boolean removeLivenessListener(LivenessListener<NodeHandle> name)
removeLivenessListener
in interface LivenessProvider<NodeHandle>
public void addProximityListener(ProximityListener<NodeHandle> listener)
addProximityListener
in interface ProximityProvider<NodeHandle>
public int proximity(NodeHandle i, java.util.Map<java.lang.String,java.lang.Object> options)
proximity
in interface ProximityProvider<NodeHandle>
public boolean removeProximityListener(ProximityListener<NodeHandle> listener)
removeProximityListener
in interface ProximityProvider<NodeHandle>
public TransportLayer getTL()
public void clearState(NodeHandle i)
LivenessProvider
clearState
in interface LivenessProvider<NodeHandle>
clearState
in interface ProximityProvider<NodeHandle>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |