public class SyncRPC extends DispatchHandler
| Modifier and Type | Field and Description |
|---|---|
static byte |
INFO_COMMAND |
static byte |
SYNC_COMMAND |
| Constructor and Description |
|---|
SyncRPC(PeerBean peerBean,
ConnectionBean connectionBean,
int blockSize,
StorageLayer storageLayer,
ReplicationListener replicationListener)
Constructor that registers this RPC with the message handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder) |
FutureResponse |
infoMessage(PeerAddress remotePeer,
SyncBuilder synchronizationBuilder,
ChannelCreator channelCreator)
Sends info message that asks whether the data is present at replica peer or not.
|
FutureResponse |
syncMessage(PeerAddress remotePeer,
SyncBuilder synchronizationBuilder,
ChannelCreator channelCreator)
Sends sync message that transfers the changed parts of data to a replica peer.
|
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, signpublic static final byte INFO_COMMAND
public static final byte SYNC_COMMAND
public SyncRPC(PeerBean peerBean, ConnectionBean connectionBean, int blockSize, StorageLayer storageLayer, ReplicationListener replicationListener)
peerBean - The peer bean that contains data that is unique for each peerconnectionBean - The connection bean that is unique per connection (multiple peers can share a single connection)storageLayer - public FutureResponse infoMessage(PeerAddress remotePeer, SyncBuilder synchronizationBuilder, ChannelCreator channelCreator)
remotePeer - The remote peer to send this requestsynchronizationBuilder - Used for keeping parameters that are sentchannelCreator - The channel creator that creates connectionspublic FutureResponse syncMessage(PeerAddress remotePeer, SyncBuilder synchronizationBuilder, ChannelCreator channelCreator) throws IOException
remotePeer - The remote peer to send this messagesynchronizationBuilder - Used for keeping parameters that are sentchannelCreator - The channel creator that creates connectionsIOExceptionpublic void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws Exception
handleResponse in class DispatchHandlerExceptionCopyright © 2014. All rights reserved.