|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.channel.SimpleChannelHandler
net.tomp2p.rpc.ReplyHandler
net.tomp2p.rpc.StorageRPC
public class StorageRPC
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
org.jboss.netty.channel.ChannelHandler.Sharable |
Constructor Summary | |
---|---|
StorageRPC(PeerBean peerBean,
ConnectionBean connectionBean)
|
Method Summary | |
---|---|
FutureResponse |
add(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Collection<Data> dataSet,
boolean protectDomain,
boolean signMessage,
boolean list,
ChannelCreator channelCreator,
boolean forceUDP,
SenderCacheStrategy senderCacheStrategy)
Adds data on a remote peer. |
FutureResponse |
compareAndPut(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Map<Number160,HashData> hashDataMap,
FutureSuccessEvaluator futureSuccessEvaluator,
boolean protectDomain,
boolean protectEntry,
boolean signMessage,
boolean partialPut,
ChannelCreator channelCreator,
boolean forceUDP)
Compares and puts data on a peer. |
FutureResponse |
get(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Collection<Number160> contentKeys,
SimpleBloomFilter<Number160> keyBloomFilter,
SimpleBloomFilter<Number160> contentBloomFilter,
boolean signMessage,
boolean digest,
boolean returnBloomFilter,
boolean range,
ChannelCreator channelCreator,
boolean forceUDP)
Get the data from a remote peer. |
PeerAddress |
getPeerAddress()
|
Message |
handleResponse(Message message,
boolean sign)
If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is generated here. |
FutureResponse |
put(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Map<Number160,Data> dataMap,
boolean protectDomain,
boolean protectEntry,
boolean signMessage,
ChannelCreator channelCreator,
boolean forceUDP,
SenderCacheStrategy senderCacheStrategy)
Stores data on a remote peer. |
FutureResponse |
putIfAbsent(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Map<Number160,Data> dataMap,
boolean protectDomain,
boolean protectEntry,
boolean signMessage,
ChannelCreator channelCreator,
boolean forceUDP,
SenderCacheStrategy senderCacheStrategy)
Stores data on a remote peer. |
FutureResponse |
remove(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
Collection<Number160> contentKeys,
boolean sendBackResults,
boolean signMessage,
ChannelCreator channelCreator,
boolean forceUDP)
Removes data from a peer. |
Methods inherited from class net.tomp2p.rpc.ReplyHandler |
---|
createMessage, createResponseMessage, exceptionCaught, forwardMessage, getConnectionBean, getPeerBean, registerIoHandler, setSignReply |
Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler |
---|
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, handleUpstream, messageReceived, setInterestOpsRequested, unbindRequested, writeComplete, writeRequested |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StorageRPC(PeerBean peerBean, ConnectionBean connectionBean)
Method Detail |
---|
public PeerAddress getPeerAddress()
public FutureResponse put(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Map<Number160,Data> dataMap, boolean protectDomain, boolean protectEntry, boolean signMessage, ChannelCreator channelCreator, boolean forceUDP, SenderCacheStrategy senderCacheStrategy)
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 TCP
public FutureResponse putIfAbsent(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Map<Number160,Data> dataMap, boolean protectDomain, boolean protectEntry, boolean signMessage, ChannelCreator channelCreator, boolean forceUDP, SenderCacheStrategy senderCacheStrategy)
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 TCP
public FutureResponse compareAndPut(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Map<Number160,HashData> hashDataMap, FutureSuccessEvaluator futureSuccessEvaluator, boolean protectDomain, boolean protectEntry, boolean signMessage, boolean partialPut, ChannelCreator channelCreator, boolean forceUDP)
remotePeer
- The remote peer to store the datalocationKey
- The location keydomainKey
- The domain keyhashDataMap
- The map with the data and the hashes to compare tofutureSuccessEvaluator
- The evaluator that determines if a future was a success.protectDomain
- Protect the domainprotectEntry
- Protect the entrysignMessage
- Set to true if the message should be signed. For protecting an entry, this needs to be set to
true.partialPut
- Set to true if partial puts should be allowed. If set to false, then the complete map must
match the hash, otherwise it wont be stored.channelCreator
- The channel creatorforceUDP
- Set to true if the communication should be UDP, default is TCP
public FutureResponse add(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Collection<Data> dataSet, boolean protectDomain, boolean signMessage, boolean list, ChannelCreator channelCreator, boolean forceUDP, SenderCacheStrategy senderCacheStrategy)
#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 TCP
public FutureResponse get(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Collection<Number160> contentKeys, SimpleBloomFilter<Number160> keyBloomFilter, SimpleBloomFilter<Number160> contentBloomFilter, boolean signMessage, boolean digest, boolean returnBloomFilter, boolean range, ChannelCreator channelCreator, boolean forceUDP)
remotePeer
- The remote peer to send this requestlocationKey
- The location keydomainKey
- The domain keycontentKeys
- The content keys or null if requested allsignMessage
- Adds a public key and signs the messagedigest
- Returns a list of hashes of the data stored on this peerchannelCreator
- The channel creator that creates connections. Typically we need one connection here.forceUDP
- Set to true if the communication should be UDP, default is TCP
public FutureResponse remove(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, Collection<Number160> contentKeys, boolean sendBackResults, boolean signMessage, ChannelCreator channelCreator, boolean forceUDP)
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 TCP
public Message handleResponse(Message message, boolean sign) throws IOException
ReplyHandler
handleResponse
in class ReplyHandler
message
- Request message
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |