public class StorageRPC extends DispatchHandler
| Constructor and Description |
|---|
StorageRPC(PeerBean peerBean,
ConnectionBean connectionBean,
StorageLayer storageLayer)
Register the store rpc for put, compare put, get, add, and remove.
|
| Modifier and Type | Method and Description |
|---|---|
FutureResponse |
add(PeerAddress remotePeer,
AddBuilder addBuilder,
ChannelCreator channelCreator)
Adds data on a remote peer.
|
FutureResponse |
digest(PeerAddress remotePeer,
DigestBuilder getBuilder,
ChannelCreator channelCreator) |
FutureResponse |
get(PeerAddress remotePeer,
GetBuilder getBuilder,
ChannelCreator channelCreator) |
FutureResponse |
getLatest(PeerAddress remotePeer,
GetBuilder getBuilder,
ChannelCreator channelCreator,
RPC.Commands command) |
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder) |
FutureResponse |
put(PeerAddress remotePeer,
PutBuilder putBuilder,
ChannelCreator channelCreator)
Stores data on a remote peer.
|
FutureResponse |
putConfirm(PeerAddress remotePeer,
PutBuilder putBuilder,
ChannelCreator channelCreator) |
FutureResponse |
putIfAbsent(PeerAddress remotePeer,
PutBuilder putBuilder,
ChannelCreator channelCreator)
Stores data on a remote peer.
|
FutureResponse |
putMeta(PeerAddress remotePeer,
PutBuilder putBuilder,
ChannelCreator channelCreator) |
FutureResponse |
remove(PeerAddress remotePeer,
RemoveBuilder removeBuilder,
ChannelCreator channelCreator)
Removes data from a peer.
|
ReplicationListener |
replicationListener() |
StorageRPC |
replicationListener(ReplicationListener replicationListener) |
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, signpublic StorageRPC(PeerBean peerBean, ConnectionBean connectionBean, StorageLayer storageLayer)
peerBean - The peer beanconnectionBean - The connection beanpublic StorageRPC replicationListener(ReplicationListener replicationListener)
public ReplicationListener replicationListener()
public FutureResponse put(PeerAddress remotePeer, PutBuilder putBuilder, ChannelCreator channelCreator)
remotePeer - The remote peer to store the datalocationKey - The location of the datadomainKey - The domain of the datadataMap - The map with the content key and dataprotectDomain - Set to true if the domain should be set to protected. This means that this domain is flagged an a
public key is stored for this entry. An update or removal can only be made with the matching private
key.protectEntry - Set to true if the entry should be set to protected. This means that this domain is flagged an a
public key is stored for this entry. An update or removal can only be made with the matching private
key.signMessage - Set to true if the message should be signed. For protecting an entry, this needs to be set to true.channelCreator - The channel creatorforceUDP - Set to true if the communication should be UDP, default is TCPpublic FutureResponse putIfAbsent(PeerAddress remotePeer, PutBuilder putBuilder, ChannelCreator channelCreator)
remotePeer - The remote peer to store the datalocationKey - The location of the datadomainKey - The domain of the datadataMap - The map with the content key and dataprotectDomain - Set to true if the domain should be set to protected. This means that this domain is flagged an a
public key is stored for this entry. An update or removal can only be made with the matching private
key.protectEntry - Set to true if the entry should be set to protected. This means that this domain is flagged an a
public key is stored for this entry. An update or removal can only be made with the matching private
key.signMessage - Set to true if the message should be signed. For protecting an entry, this needs to be set to true.channelCreator - The channel creatorforceUDP - Set to true if the communication should be UDP, default is TCPpublic FutureResponse putMeta(PeerAddress remotePeer, PutBuilder putBuilder, ChannelCreator channelCreator)
public FutureResponse putConfirm(PeerAddress remotePeer, PutBuilder putBuilder, ChannelCreator channelCreator)
public FutureResponse add(PeerAddress remotePeer, AddBuilder addBuilder, ChannelCreator channelCreator)
#put(PeerAddress, Number160, Number160, Map, Type, boolean, ChannelCreator, boolean) and
#putIfAbsent(PeerAddress, Number160, Number160, Map, boolean, boolean, boolean, ChannelCreator, boolean)
is that it will convert the data collection to map. The key for the map will be the SHA-1 hash of the data. This
is an RPC.remotePeer - The remote peer to store the datalocationKey - The location keydomainKey - The domain keydataSet - The set with data. This will be converted to a map. The key for the map is the SHA-1 of the data.protectDomain - Set to true if the domain should be set to protected. This means that this domain is flagged an a
public key is stored for this entry. An update or removal can only be made with the matching private
key.signMessage - Set to true if the message should be signed. For protecting an entry, this needs to be set to true.channelCreator - The channel creatorforceUDP - Set to true if the communication should be UDP, default is TCPpublic FutureResponse digest(PeerAddress remotePeer, DigestBuilder getBuilder, ChannelCreator channelCreator)
public FutureResponse get(PeerAddress remotePeer, GetBuilder getBuilder, ChannelCreator channelCreator)
public FutureResponse getLatest(PeerAddress remotePeer, GetBuilder getBuilder, ChannelCreator channelCreator, RPC.Commands command)
public FutureResponse remove(PeerAddress remotePeer, RemoveBuilder removeBuilder, ChannelCreator channelCreator)
remotePeer - The remote peer to send this requestlocationKey - The location keydomainKey - The domain keycontentKeys - The content keys or null if requested allsendBackResults - Set to true if the removed data should be sent backsignMessage - Adds a public key and signs the message. For protected entry and domains, this needs to be provided.channelCreator - The channel creator that creates connectionsforceUDP - Set to true if the communication should be UDP, default is TCPpublic void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws Exception
handleResponse in class DispatchHandlerExceptionCopyright © 2014. All rights reserved.