|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.direct.DirectTransportLayer<Identifier,MessageType>
public class DirectTransportLayer<Identifier,MessageType>
| Field Summary | |
|---|---|
protected boolean |
acceptMessages
|
protected boolean |
acceptSockets
|
protected TransportLayerCallback<Identifier,MessageType> |
callback
|
protected Environment |
environment
|
protected ErrorHandler<Identifier> |
errorHandler
|
protected LivenessProvider<Identifier> |
livenessProvider
|
protected Identifier |
localIdentifier
|
protected Logger |
logger
|
protected GenericNetworkSimulator<Identifier,MessageType> |
simulator
|
| Constructor Summary | |
|---|---|
DirectTransportLayer(Identifier local,
GenericNetworkSimulator<Identifier,MessageType> simulator,
LivenessProvider<Identifier> liveness,
Environment env)
|
|
| Method Summary | |
|---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
boolean |
canReceiveSocket()
|
void |
clearState(Identifier i)
|
void |
destroy()
|
void |
finishReceiveSocket(P2PSocket<Identifier> acceptorEndpoint)
|
Identifier |
getLocalIdentifier()
The local node. |
Logger |
getLogger()
|
int |
getNextSeq()
|
void |
incomingMessage(Identifier i,
MessageType m,
java.util.Map<java.lang.String,java.lang.Integer> options)
|
SocketRequestHandle<Identifier> |
openSocket(Identifier i,
SocketCallback<Identifier> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Integer> options)
Open a socket to the Identifier |
MessageRequestHandle<Identifier,MessageType> |
sendMessage(Identifier i,
MessageType m,
MessageCallback<Identifier,MessageType> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Integer> options)
Send the message to the identifier |
void |
setCallback(TransportLayerCallback<Identifier,MessageType> callback)
Set the callback for incoming sockets/messages |
void |
setErrorHandler(ErrorHandler<Identifier> 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 |
| Field Detail |
|---|
protected boolean acceptMessages
protected boolean acceptSockets
protected Identifier localIdentifier
protected TransportLayerCallback<Identifier,MessageType> callback
protected GenericNetworkSimulator<Identifier,MessageType> simulator
protected ErrorHandler<Identifier> errorHandler
protected LivenessProvider<Identifier> livenessProvider
protected Environment environment
protected Logger logger
| Constructor Detail |
|---|
public DirectTransportLayer(Identifier local,
GenericNetworkSimulator<Identifier,MessageType> simulator,
LivenessProvider<Identifier> liveness,
Environment env)
| Method Detail |
|---|
public void acceptMessages(boolean b)
TransportLayer
acceptMessages in interface TransportLayer<Identifier,MessageType>public void acceptSockets(boolean b)
TransportLayer
acceptSockets in interface TransportLayer<Identifier,MessageType>public Identifier getLocalIdentifier()
TransportLayer
getLocalIdentifier in interface TransportLayer<Identifier,MessageType>
public SocketRequestHandle<Identifier> openSocket(Identifier i,
SocketCallback<Identifier> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Integer> options)
TransportLayer
openSocket in interface TransportLayer<Identifier,MessageType>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<Identifier,MessageType> sendMessage(Identifier i,
MessageType m,
MessageCallback<Identifier,MessageType> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Integer> options)
TransportLayer
sendMessage in interface TransportLayer<Identifier,MessageType>i - the destinationm - the messagedeliverAckToMe - layer dependent notification when the message is sent (can indicate placed on the wire, point-to-point acknowledgement, 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<Identifier,MessageType> callback)
TransportLayer
setCallback in interface TransportLayer<Identifier,MessageType>callback - the callback for incoming sockets/messagespublic void setErrorHandler(ErrorHandler<Identifier> handler)
TransportLayer
setErrorHandler in interface TransportLayer<Identifier,MessageType>handler - to be notified of problems not related to a specific messaage/socket.public void destroy()
destroy in interface Destructablepublic boolean canReceiveSocket()
public void finishReceiveSocket(P2PSocket<Identifier> acceptorEndpoint)
public Logger getLogger()
public int getNextSeq()
public void incomingMessage(Identifier i,
MessageType m,
java.util.Map<java.lang.String,java.lang.Integer> options)
throws java.io.IOException
java.io.IOExceptionpublic void clearState(Identifier i)
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||