|
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.VerifierImpl<Handle,Identifier>
public class VerifierImpl<Handle extends RawSerializable,Identifier extends RawSerializable>
Field Summary | |
---|---|
protected SecureHistory |
history
|
protected Handle |
localHandle
|
protected Logger |
logger
|
protected IdentityTransport<Handle,Identifier> |
transport
|
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants |
---|
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED |
Constructor Summary | |
---|---|
VerifierImpl(PeerReview<Handle,Identifier> peerreview,
Environment env,
SecureHistory history,
Handle localHandle,
long firstEntryToReplay,
java.lang.Object extInfo)
|
Method Summary | |
---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
void |
close(int socketId)
|
protected java.io.IOException |
deserializeException(InputBuffer nextEvent)
|
void |
destroy()
|
protected void |
fetchNextEvent()
Fetch the next log entry, or set the EOF flag |
void |
generatedSocketException(int socketId,
java.io.IOException ioe)
|
Environment |
getEnvironment()
|
java.lang.Object |
getExtInfo()
|
Handle |
getLocalIdentifier()
The local node. |
IndexEntry |
getNextEvent()
|
long |
getNextEventTime()
|
protected void |
incomingSocket(Handle from,
int socketId)
|
boolean |
isSuccess()
|
boolean |
makeProgress()
This is called by the Audit protocol to make another replay step; it returns true if further calls are necessary, and false if the replay has finished. |
int |
openSocket(Handle target)
Return the new socketId |
SocketRequestHandle<Handle> |
openSocket(Handle i,
SocketCallback<Handle> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Open a socket to the Identifier |
int |
readSocket(int socketId,
java.nio.ByteBuffer dst)
Return the bytes read. |
void |
registerEvent(EventCallback callback,
short... eventType)
This binds specific event types to one of the handlers |
void |
registerEvent(EventCallback callback,
short eventType)
|
MessageRequestHandle<Handle,java.nio.ByteBuffer> |
sendMessage(Handle target,
java.nio.ByteBuffer message,
MessageCallback<Handle,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Called by the state machine when it wants to send a message |
void |
setApplication(PeerReviewCallback app)
|
void |
setCallback(TransportLayerCallback<Handle,java.nio.ByteBuffer> callback)
Set the callback for incoming sockets/messages |
void |
setErrorHandler(ErrorHandler<Handle> handler)
To be notified of problems not related to an outgoing messaage/socket. |
void |
shutdownOutput(int socketId)
|
protected void |
socketException(int socketId,
java.io.IOException ioe)
|
protected void |
socketIO(int socketId,
boolean canRead,
boolean canWrite)
|
protected void |
socketOpened(int socketId)
|
boolean |
verifiedOK()
|
int |
writeSocket(int socketId,
java.nio.ByteBuffer src)
Return the bytes written. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Handle extends RawSerializable localHandle
protected SecureHistory history
protected Logger logger
protected IdentityTransport<Handle extends RawSerializable,Identifier extends RawSerializable> transport
Constructor Detail |
---|
public VerifierImpl(PeerReview<Handle,Identifier> peerreview, Environment env, SecureHistory history, Handle localHandle, long firstEntryToReplay, java.lang.Object extInfo) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public java.lang.Object getExtInfo()
protected void fetchNextEvent()
public boolean verifiedOK()
verifiedOK
in interface Verifier<Handle extends RawSerializable>
public IndexEntry getNextEvent()
public void setApplication(PeerReviewCallback app)
setApplication
in interface Verifier<Handle extends RawSerializable>
public void registerEvent(EventCallback callback, short... eventType)
public void registerEvent(EventCallback callback, short eventType)
public boolean makeProgress()
makeProgress
in interface Verifier<Handle extends RawSerializable>
public MessageRequestHandle<Handle,java.nio.ByteBuffer> sendMessage(Handle target, java.nio.ByteBuffer message, MessageCallback<Handle,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
sendMessage
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
target
- the destinationmessage
- 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 long getNextEventTime()
getNextEventTime
in interface Verifier<Handle extends RawSerializable>
public boolean isSuccess()
isSuccess
in interface Verifier<Handle extends RawSerializable>
protected java.io.IOException deserializeException(InputBuffer nextEvent) throws java.io.IOException
java.io.IOException
public SocketRequestHandle<Handle> openSocket(Handle i, SocketCallback<Handle> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
openSocket
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
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)
protected void socketIO(int socketId, boolean canRead, boolean canWrite) throws java.io.IOException
java.io.IOException
protected void incomingSocket(Handle from, int socketId) throws java.io.IOException
java.io.IOException
protected void socketOpened(int socketId) throws java.io.IOException
java.io.IOException
protected void socketException(int socketId, java.io.IOException ioe) throws java.io.IOException
java.io.IOException
public int openSocket(Handle target) throws java.io.IOException
i
-
java.io.IOException
public int readSocket(int socketId, java.nio.ByteBuffer dst) throws java.io.IOException
socketId
-
java.io.IOException
public void generatedSocketException(int socketId, java.io.IOException ioe)
public int writeSocket(int socketId, java.nio.ByteBuffer src) throws java.io.IOException
socketId
-
java.io.IOException
public void close(int socketId)
public void shutdownOutput(int socketId)
public Environment getEnvironment()
getEnvironment
in interface Verifier<Handle extends RawSerializable>
public void acceptMessages(boolean b)
TransportLayer
acceptMessages
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
public void acceptSockets(boolean b)
TransportLayer
acceptSockets
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
public Handle getLocalIdentifier()
TransportLayer
getLocalIdentifier
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
public void setCallback(TransportLayerCallback<Handle,java.nio.ByteBuffer> callback)
TransportLayer
setCallback
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
callback
- the callback for incoming sockets/messagespublic void setErrorHandler(ErrorHandler<Handle> handler)
TransportLayer
setErrorHandler
in interface TransportLayer<Handle extends RawSerializable,java.nio.ByteBuffer>
handler
- to be notified of problems not related to a specific messaage/socket.public void destroy()
destroy
in interface Destructable
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |