|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.peerreview.PeerReviewCallbackImpl
public class PeerReviewCallbackImpl
Field Summary |
---|
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants |
---|
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED |
Constructor Summary | |
---|---|
|
PeerReviewCallbackImpl(PastryNode pn,
TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> tl,
CallbackFactory nodeFactory)
|
protected |
PeerReviewCallbackImpl(TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> tl)
|
Method Summary | |
---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
void |
destroy()
|
TransportLayerNodeHandle<MultiInetSocketAddress> |
getLocalIdentifier()
The local node. |
java.util.Collection<TransportLayerNodeHandle<MultiInetSocketAddress>> |
getMyWitnessedNodes()
|
PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id> |
getReplayInstance(Verifier<TransportLayerNodeHandle<MultiInetSocketAddress>> v)
Construct a PastryNode down to my layer (figure out how to borrow the code from the PastryNodeFactory) Construct a PeerReviewCallbackImpl with the PastryNode/Verifier Construct the layers above self, attach them appropriately. |
void |
getWitnesses(Id subject,
WitnessListener<TransportLayerNodeHandle<MultiInetSocketAddress>,Id> callback)
|
void |
incomingSocket(P2PSocket<TransportLayerNodeHandle<MultiInetSocketAddress>> s)
Notification of a new socket. |
void |
init()
|
boolean |
loadCheckpoint(InputBuffer buffer)
Load rt/leafset |
void |
messageReceived(TransportLayerNodeHandle<MultiInetSocketAddress> i,
java.nio.ByteBuffer m,
java.util.Map<java.lang.String,java.lang.Object> options)
Called when a new message is received. |
void |
notifyCertificateAvailable(Id id)
|
void |
notifyStatusChange(Id id,
int newStatus)
|
SocketRequestHandle<TransportLayerNodeHandle<MultiInetSocketAddress>> |
openSocket(TransportLayerNodeHandle<MultiInetSocketAddress> i,
SocketCallback<TransportLayerNodeHandle<MultiInetSocketAddress>> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Open a socket to the Identifier |
MessageRequestHandle<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> |
sendMessage(TransportLayerNodeHandle<MultiInetSocketAddress> i,
java.nio.ByteBuffer m,
MessageCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Send the message to the identifier |
void |
setCallback(TransportLayerCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> callback)
Set the callback for incoming sockets/messages |
void |
setErrorHandler(ErrorHandler<TransportLayerNodeHandle<MultiInetSocketAddress>> handler)
To be notified of problems not related to an outgoing messaage/socket. |
void |
storeCheckpoint(OutputBuffer buffer)
Store rt/leafset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeerReviewCallbackImpl(PastryNode pn, TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> tl, CallbackFactory nodeFactory)
protected PeerReviewCallbackImpl(TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> tl)
Method Detail |
---|
public PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id> getReplayInstance(Verifier<TransportLayerNodeHandle<MultiInetSocketAddress>> v)
getReplayInstance
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
public void storeCheckpoint(OutputBuffer buffer) throws java.io.IOException
storeCheckpoint
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
java.io.IOException
public boolean loadCheckpoint(InputBuffer buffer) throws java.io.IOException
loadCheckpoint
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
java.io.IOException
public java.util.Collection<TransportLayerNodeHandle<MultiInetSocketAddress>> getMyWitnessedNodes()
getMyWitnessedNodes
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
public void init()
init
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
public void destroy()
destroy
in interface Destructable
public void notifyCertificateAvailable(Id id)
notifyCertificateAvailable
in interface IdentityTransportCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
public void incomingSocket(P2PSocket<TransportLayerNodeHandle<MultiInetSocketAddress>> s) throws java.io.IOException
TransportLayerCallback
incomingSocket
in interface TransportLayerCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
s
- the incoming socket
java.io.IOException
public void messageReceived(TransportLayerNodeHandle<MultiInetSocketAddress> i, java.nio.ByteBuffer m, java.util.Map<java.lang.String,java.lang.Object> options) throws java.io.IOException
TransportLayerCallback
messageReceived
in interface TransportLayerCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
i
- The node it is coming fromm
- the messageoptions
- describe how the message arrived (udp/tcp, encrypted etc)
java.io.IOException
- if there is a problem decoding the messagepublic void notifyStatusChange(Id id, int newStatus)
notifyStatusChange
in interface StatusChangeListener<Id>
public void acceptMessages(boolean b)
TransportLayer
acceptMessages
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
public void acceptSockets(boolean b)
TransportLayer
acceptSockets
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
public void getWitnesses(Id subject, WitnessListener<TransportLayerNodeHandle<MultiInetSocketAddress>,Id> callback)
getWitnesses
in interface PeerReviewCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,Id>
public TransportLayerNodeHandle<MultiInetSocketAddress> getLocalIdentifier()
TransportLayer
getLocalIdentifier
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
public SocketRequestHandle<TransportLayerNodeHandle<MultiInetSocketAddress>> openSocket(TransportLayerNodeHandle<MultiInetSocketAddress> i, SocketCallback<TransportLayerNodeHandle<MultiInetSocketAddress>> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
openSocket
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,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)
public void setCallback(TransportLayerCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> callback)
TransportLayer
setCallback
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
callback
- the callback for incoming sockets/messagespublic void setErrorHandler(ErrorHandler<TransportLayerNodeHandle<MultiInetSocketAddress>> handler)
TransportLayer
setErrorHandler
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
handler
- to be notified of problems not related to a specific messaage/socket.public MessageRequestHandle<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> sendMessage(TransportLayerNodeHandle<MultiInetSocketAddress> i, java.nio.ByteBuffer m, MessageCallback<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
sendMessage
in interface TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>
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)
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |