|
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.peerreview.replay.playback.ReplayVerifier<Identifier> org.mpisws.p2p.transport.peerreview.replay.playback.ReplayLayer<Identifier>
public class ReplayLayer<Identifier>
Field Summary |
---|
Fields inherited from class org.mpisws.p2p.transport.peerreview.replay.playback.ReplayVerifier |
---|
hashProv, history, localHandle, logger, serializer |
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants |
---|
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED |
Constructor Summary | |
---|---|
ReplayLayer(Serializer<Identifier> serializer,
HashProvider hashProv,
SecureHistory history,
Identifier localHandle,
Environment environment)
|
Method Summary | |
---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
void |
destroy()
|
static Environment |
generateEnvironment(java.lang.String name,
long startTime,
long randSeed,
LogManager lm2)
|
Environment |
getEnvironment()
|
Identifier |
getLocalIdentifier()
The local node. |
protected void |
incomingSocket(Identifier from,
int socketId)
Callback when a socket comes in from a remote node. |
SocketRequestHandle<Identifier> |
openSocket(Identifier i,
SocketCallback<Identifier> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Open a socket to the Identifier |
protected void |
receive(Identifier from,
java.nio.ByteBuffer msg)
Callback when a message has arrived. |
MessageRequestHandle<Identifier,java.nio.ByteBuffer> |
sendMessage(Identifier i,
java.nio.ByteBuffer m,
MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Send the message to the identifier |
void |
setCallback(TransportLayerCallback<Identifier,java.nio.ByteBuffer> 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. |
protected void |
socketException(int socketId,
java.io.IOException ioe)
|
protected void |
socketIO(int socketId,
boolean canRead,
boolean canWrite)
Callback when a socket is ready to read/write. |
protected void |
socketOpened(int socketId)
|
Methods inherited from class org.mpisws.p2p.transport.peerreview.replay.playback.ReplayVerifier |
---|
close, deserializeException, fetchNextEvent, generatedSocketException, getNextEvent, getNextEventTime, isSuccess, makeProgress, openSocket, readSocket, registerEvent, registerEvent, send, setApplication, shutdownOutput, verifiedOK, writeSocket |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplayLayer(Serializer<Identifier> serializer, HashProvider hashProv, SecureHistory history, Identifier localHandle, Environment environment) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public SocketRequestHandle<Identifier> openSocket(Identifier i, SocketCallback<Identifier> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
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,java.nio.ByteBuffer> sendMessage(Identifier i, java.nio.ByteBuffer m, MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
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 Identifier getLocalIdentifier()
TransportLayer
public void setCallback(TransportLayerCallback<Identifier,java.nio.ByteBuffer> callback)
TransportLayer
callback
- the callback for incoming sockets/messagespublic void setErrorHandler(ErrorHandler<Identifier> handler)
TransportLayer
handler
- to be notified of problems not related to a specific messaage/socket.public void destroy()
public void acceptMessages(boolean b)
TransportLayer
public void acceptSockets(boolean b)
TransportLayer
protected void receive(Identifier from, java.nio.ByteBuffer msg) throws java.io.IOException
ReplayVerifier
receive
in class ReplayVerifier<Identifier>
java.io.IOException
protected void socketIO(int socketId, boolean canRead, boolean canWrite) throws java.io.IOException
ReplayVerifier
socketIO
in class ReplayVerifier<Identifier>
java.io.IOException
protected void incomingSocket(Identifier from, int socketId) throws java.io.IOException
ReplayVerifier
incomingSocket
in class ReplayVerifier<Identifier>
java.io.IOException
public static Environment generateEnvironment(java.lang.String name, long startTime, long randSeed, LogManager lm2)
protected void socketOpened(int socketId) throws java.io.IOException
socketOpened
in class ReplayVerifier<Identifier>
java.io.IOException
protected void socketException(int socketId, java.io.IOException ioe) throws java.io.IOException
socketException
in class ReplayVerifier<Identifier>
java.io.IOException
public Environment getEnvironment()
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |