net.tomp2p.p2p
Class Peer
java.lang.Object
net.tomp2p.p2p.Peer
public class Peer
- extends Object
TomP2P implements besides the following distributed hash table (DHT)
operations:
- value=get(locationKey)
- put(locationKey,value)
- remove(locationKey)
also the following operations:
- value=get(locationKey,contentKey)
- put(locationKey,contentKey,value)
- remove(locationKey,contentKey)
The advantage of TomP2P is that multiple values can be stored in one
location. Furthermore, TomP2P also provides to store keys in different
domains to avoid key collisions.
- Author:
- Thomas Bocek
Method Summary |
FutureDHT |
add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config)
|
FutureDHT |
add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config,
FutureChannelCreator channelCreator)
|
FutureDHT |
add(Number160 locationKey,
Data data)
|
FutureDHT |
add(Number160 locationKey,
Data data,
ConfigurationStore config)
|
FutureDHT |
add(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
|
void |
addPeerListener(PeerListener listener)
Adds a listener to peer events. |
FutureTracker |
addToTracker(Number160 locationKey,
ConfigurationTrackerStore config)
|
FutureBootstrap |
bootstrap(InetSocketAddress address)
Boostraps to a known peer. |
FutureBootstrap |
bootstrap(PeerAddress peerAddress)
Boostraps to a known peer. |
FutureBootstrap |
bootstrap(PeerAddress discoveryPeerAddress,
Collection<PeerAddress> bootstrapTo,
ConfigurationBootstrap config)
Boostraps to a known peer. |
FutureBootstrap |
bootstrapBroadcast()
|
FutureBootstrap |
bootstrapBroadcast(int port)
|
PeerConnection |
createPeerConnection(PeerAddress destination,
int idleTCPMillis)
Opens a TCP connection and keeps it open. |
void |
customLoggerMessage(String customMessage)
|
FutureDHT |
digest(Number160 locationKey)
|
FutureDHT |
digest(Number160 locationKey,
ConfigurationGet config)
|
FutureDHT |
digest(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
FutureDHT |
digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
|
FutureDHT |
digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
FutureDHT |
digestAll(Number160 locationKey)
|
FutureDHT |
digestAll(Number160 locationKey,
ConfigurationGet config)
|
FutureDHT |
digestAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
FutureDiscover |
discover(InetAddress inetAddress,
int portUDP,
int portTCP)
Discover attempts to find the external IP address of this peer. |
FutureDiscover |
discover(PeerAddress peerAddress)
Discover attempts to find the external IP address of this peer. |
FutureDHT |
get(Number160 locationKey)
|
FutureDHT |
get(Number160 locationKey,
ConfigurationGet config)
|
FutureDHT |
get(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
FutureDHT |
get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
|
FutureDHT |
get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
FutureDHT |
getAll(Number160 locationKey)
|
FutureDHT |
getAll(Number160 locationKey,
ConfigurationGet config)
|
FutureDHT |
getAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
|
AsyncTask |
getAsyncTask()
|
ConnectionConfiguration |
getConfiguration()
|
ConnectionBean |
getConnectionBean()
|
ConnectionHandler |
getConnectionHandler()
|
DirectDataRPC |
getDirectDataRPC()
|
DistributedHashTable |
getDistributedHashMap()
|
DistributedRouting |
getDistributedRouting()
|
DistributedTask |
getDistributedTask()
|
DistributedTracker |
getDistributedTracker()
|
FutureTracker |
getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config)
|
FutureTracker |
getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config,
Set<Number160> knownPeers)
|
FutureTracker |
getFromTrackerCreateBloomfilter1(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<PeerAddress> knownPeers)
|
FutureTracker |
getFromTrackerCreateBloomfilter2(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<Number160> knownPeers)
|
HandshakeRPC |
getHandshakeRPC()
|
List<PeerListener> |
getListeners()
|
NeighborRPC |
getNeighborRPC()
|
int |
getP2PID()
|
PeerAddress |
getPeerAddress()
|
PeerBean |
getPeerBean()
|
PeerExchangeRPC |
getPeerExchangeRPC()
|
Number160 |
getPeerID()
|
Map<BaseFuture,Long> |
getPendingFutures()
|
QuitRPC |
getQuitRPC()
|
List<ScheduledFuture<?>> |
getScheduledFutures()
|
StorageRPC |
getStoreRPC()
|
TaskRPC |
getTaskRPC()
|
TrackerRPC |
getTrackerRPC()
|
boolean |
isListening()
|
boolean |
isRunning()
|
FutureDHT |
parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
|
FutureDHT |
parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
FutureChannelCreator channelCreator,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
|
FutureResponse |
ping(InetSocketAddress address)
Pings a peer. |
FutureResponse |
ping(InetSocketAddress address,
boolean isUDP)
Pings a peer. |
FutureDHT |
put(Number160 locationKey,
Data data)
|
FutureDHT |
put(Number160 locationKey,
Data data,
ConfigurationStore config)
|
FutureDHT |
put(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
|
FutureDHT |
put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config)
|
FutureDHT |
put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config,
FutureChannelCreator channelCreator)
Stores values in the DHT. |
void |
release(ChannelCreator channelCreator)
Release a ChannelCreator. |
FutureDHT |
remove(Number160 locationKey)
|
FutureDHT |
remove(Number160 locationKey,
ConfigurationRemove config)
|
FutureDHT |
remove(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
|
FutureDHT |
remove(Number160 locationKey,
Number160 contentKey)
|
FutureDHT |
remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config)
|
FutureDHT |
remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
|
FutureDHT |
removeAll(Number160 locationKey)
|
FutureDHT |
removeAll(Number160 locationKey,
ConfigurationRemove config)
|
FutureDHT |
removeAll(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
|
void |
removePeerListener(PeerListener listener)
Removes a peer listener. |
FutureChannelCreator |
reserve(ConfigurationBaseDHT configurationBaseDHT)
Reserves a connection for a routing and DHT operation. |
FutureChannelCreator |
reserve(ConfigurationBaseDHT configurationBaseDHT,
String name)
Reserves a connection for a routing and DHT operation. |
FutureChannelCreator |
reserve(RoutingConfiguration routingConfiguration,
RequestP2PConfiguration requestP2PConfiguration,
String name)
Reserves a connection for a routing and DHT operation. |
FutureDHT |
send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer)
|
FutureDHT |
send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config)
|
FutureDHT |
send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
|
FutureDHT |
send(Number160 locationKey,
Object object)
|
FutureDHT |
send(Number160 locationKey,
Object object,
ConfigurationDirect config)
|
FutureDHT |
send(Number160 locationKey,
Object object,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
|
FutureData |
send(PeerAddress remotePeer,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
|
FutureData |
send(PeerAddress remotePeer,
Object object)
|
FutureData |
send(PeerConnection connection,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
|
FutureData |
send(PeerConnection connection,
Object object)
|
void |
setAsyncTask(AsyncTask asyncTask)
|
void |
setDirectDataRPC(DirectDataRPC directDataRPC)
|
void |
setDistributedHashMap(DistributedHashTable distributedHashMap)
|
void |
setDistributedRouting(DistributedRouting distributedRouting)
|
void |
setDistributedTask(DistributedTask task)
|
void |
setDistributedTracker(DistributedTracker distributedTracker)
|
void |
setFutureTimeout(BaseFuture baseFuture,
int millis,
String reason)
Sets a timeout for this future. |
void |
setHandshakeRPC(HandshakeRPC handshakeRPC)
|
void |
setNeighborRPC(NeighborRPC neighborRPC)
|
void |
setObjectDataReply(ObjectDataReply objectDataReply)
|
void |
setPeerExchangeRPC(PeerExchangeRPC peerExchangeRPC)
|
void |
setQuitRPC(QuitRPC quitRCP)
|
void |
setRawDataReply(RawDataReply rawDataReply)
|
void |
setStorageRPC(StorageRPC storageRPC)
|
void |
setTaskRPC(TaskRPC taskRPC)
|
void |
setTrackerRPC(TrackerRPC trackerRPC)
|
boolean |
setupPortForwanding(String internalHost)
The Dynamic and/or Private Ports are those from 49152 through 65535
(http://www.iana.org/assignments/port-numbers) |
void |
shutdown()
Closes all connections of this node |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BLOOMFILTER_SIZE
public static final int BLOOMFILTER_SIZE
- See Also:
- Constant Field Values
addPeerListener
public void addPeerListener(PeerListener listener)
- Adds a listener to peer events. The events being triggered are: startup,
shutdown, change of peer address. The change of the peer address is due
to the discovery process. Since this process runs in an other thread,
this method is thread safe.
- Parameters:
listener
- The listener
removePeerListener
public void removePeerListener(PeerListener listener)
- Removes a peer listener. This method is thread safe.
- Parameters:
listener
- The listener
getListeners
public List<PeerListener> getListeners()
shutdown
public void shutdown()
- Closes all connections of this node
- Throws:
InterruptedException
getPendingFutures
public Map<BaseFuture,Long> getPendingFutures()
isRunning
public boolean isRunning()
isListening
public boolean isListening()
customLoggerMessage
public void customLoggerMessage(String customMessage)
getHandshakeRPC
public HandshakeRPC getHandshakeRPC()
setHandshakeRPC
public void setHandshakeRPC(HandshakeRPC handshakeRPC)
getStoreRPC
public StorageRPC getStoreRPC()
setStorageRPC
public void setStorageRPC(StorageRPC storageRPC)
getNeighborRPC
public NeighborRPC getNeighborRPC()
setNeighborRPC
public void setNeighborRPC(NeighborRPC neighborRPC)
getQuitRPC
public QuitRPC getQuitRPC()
setQuitRPC
public void setQuitRPC(QuitRPC quitRCP)
getPeerExchangeRPC
public PeerExchangeRPC getPeerExchangeRPC()
setPeerExchangeRPC
public void setPeerExchangeRPC(PeerExchangeRPC peerExchangeRPC)
getDirectDataRPC
public DirectDataRPC getDirectDataRPC()
setDirectDataRPC
public void setDirectDataRPC(DirectDataRPC directDataRPC)
getTrackerRPC
public TrackerRPC getTrackerRPC()
setTrackerRPC
public void setTrackerRPC(TrackerRPC trackerRPC)
getTaskRPC
public TaskRPC getTaskRPC()
setTaskRPC
public void setTaskRPC(TaskRPC taskRPC)
getDistributedRouting
public DistributedRouting getDistributedRouting()
setDistributedRouting
public void setDistributedRouting(DistributedRouting distributedRouting)
getDistributedHashMap
public DistributedHashTable getDistributedHashMap()
setDistributedHashMap
public void setDistributedHashMap(DistributedHashTable distributedHashMap)
getDistributedTracker
public DistributedTracker getDistributedTracker()
setDistributedTracker
public void setDistributedTracker(DistributedTracker distributedTracker)
getAsyncTask
public AsyncTask getAsyncTask()
setAsyncTask
public void setAsyncTask(AsyncTask asyncTask)
getDistributedTask
public DistributedTask getDistributedTask()
setDistributedTask
public void setDistributedTask(DistributedTask task)
getScheduledFutures
public List<ScheduledFuture<?>> getScheduledFutures()
getConnectionHandler
public ConnectionHandler getConnectionHandler()
getPeerBean
public PeerBean getPeerBean()
getConnectionBean
public ConnectionBean getConnectionBean()
getPeerID
public Number160 getPeerID()
getP2PID
public int getP2PID()
getPeerAddress
public PeerAddress getPeerAddress()
getConfiguration
public ConnectionConfiguration getConfiguration()
setRawDataReply
public void setRawDataReply(RawDataReply rawDataReply)
setObjectDataReply
public void setObjectDataReply(ObjectDataReply objectDataReply)
createPeerConnection
public PeerConnection createPeerConnection(PeerAddress destination,
int idleTCPMillis)
- Opens a TCP connection and keeps it open. The user can provide the idle
timeout, which means that the connection gets closed after that time of
inactivity. If the other peer goes offline or closes the connection (due
to inactivity), further requests with this connections reopens the
connection. This methods blocks until a connection can be reserver.
- Parameters:
destination
- The end-point to connect toidleSeconds
- time in seconds after a connection gets closed if
idle, -1 if it should remain always open until the user closes the
connection manually.
- Returns:
- A class that needs to be passed to those methods that should use
the already open connection. If the connection could not be reserved,
maybe due to a shutdown, null is returned.
send
public FutureData send(PeerAddress remotePeer,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
send
public FutureData send(PeerConnection connection,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
send
public FutureData send(PeerAddress remotePeer,
Object object)
throws IOException
- Throws:
IOException
send
public FutureData send(PeerConnection connection,
Object object)
throws IOException
- Throws:
IOException
bootstrapBroadcast
public FutureBootstrap bootstrapBroadcast()
bootstrapBroadcast
public FutureBootstrap bootstrapBroadcast(int port)
ping
public FutureResponse ping(InetSocketAddress address)
- Pings a peer. Default is to use UDP
- Parameters:
address
- The address of the remote peer.
- Returns:
- The future response
ping
public FutureResponse ping(InetSocketAddress address,
boolean isUDP)
- Pings a peer.
- Parameters:
address
- The address of the remote peer.isUDP
- Set to true if UDP should be used, false for TCP.
- Returns:
- The future response
bootstrap
public FutureBootstrap bootstrap(InetSocketAddress address)
- Boostraps to a known peer. First the ID of the peer is searched. Then
channels are reserved, then #discover(PeerAddress) is called to verify
this Internet connection settings. Then the routing is initiated to the
same peer as used for
discover(PeerAddress)
.
- Parameters:
address
- InetAddress and the UDP port of the peer to boostrap to
- Returns:
- The future bootstrap
bootstrap
public FutureBootstrap bootstrap(PeerAddress peerAddress)
- Boostraps to a known peer. First channels are reserved, then
#discover(PeerAddress) is called to verify this Internet connection
settings. Then the routing is initiated to the same peer as used for
discover(PeerAddress)
. Please be aware that in order to boostrap
you need to know the peer ID of the remote peer. Passing Number160.ZERO
does *not* work. If the peerID is not known, use
bootstrap(InetSocketAddress)
.
- Parameters:
peerAddress
- The peer address to bootstrap to
- Returns:
- The future bootstrap
- Throws:
IllegalArgumentException
- If the peer ID is Number160.ZERO,
because routing would fail.
bootstrap
public FutureBootstrap bootstrap(PeerAddress discoveryPeerAddress,
Collection<PeerAddress> bootstrapTo,
ConfigurationBootstrap config)
- Boostraps to a known peer. First channels are reserved, then
#discover(PeerAddress) is called to verify this Internet connection
settings using the argument peerAddress. Then the routing is initiated to
the peers specified in bootstrapTo. Please be aware that in order to
boostrap you need to know the peer ID of all peers in the collection
bootstrapTo. Passing Number160.ZERO does *not* work.
- Parameters:
discoveryPeerAddress
- The peer address to use for discoverybootstrapTo
- The peers used to bootstrapconfig
- The configuration
- Returns:
- The future bootstrap
setupPortForwanding
public boolean setupPortForwanding(String internalHost)
- The Dynamic and/or Private Ports are those from 49152 through 65535
(http://www.iana.org/assignments/port-numbers)
- Parameters:
internalHost
- port
-
- Returns:
discover
public FutureDiscover discover(InetAddress inetAddress,
int portUDP,
int portTCP)
- Discover attempts to find the external IP address of this peer. This is
done by first trying to set UPNP with port forwarding (gives us the
external address), query UPNP for the external address, and pinging a
well known peer. The fallback is NAT-PMP.
- Parameters:
inetAddress
- The Internet address of the peer to send the discover requestportUDP
- The UDP port of the peer to send the discover requestportTCP
- The TCP port of the peer to send the discover request
- Returns:
- The future discover. This future holds also the real ID of the
peer we send the discover request
discover
public FutureDiscover discover(PeerAddress peerAddress)
- Discover attempts to find the external IP address of this peer. This is
done by first trying to set UPNP with port forwarding (gives us the
external address), query UPNP for the external address, and pinging a
well known peer. The fallback is NAT-PMP.
- Parameters:
peerAddress
- The peer address. Since pings are used the peer ID can
be Number160.ZERO
- Returns:
- The future discover. This future holds also the real ID of the
peer we send the discover request
put
public FutureDHT put(Number160 locationKey,
Data data)
put
public FutureDHT put(Number160 locationKey,
Data data,
ConfigurationStore config)
put
public FutureDHT put(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
put
public FutureDHT put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config)
put
public FutureDHT put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config,
FutureChannelCreator channelCreator)
- Stores values in the DHT. First the closest n peers are found, then the
values provided in the dataMap are stored on those peers. A future object
will track the progress since this method returns immediately and the
operations are performed in an other thread.
- Parameters:
locationKey
- The location in the DHTdataMap
- If multiple keys and values are provided, then this method
behaves as putAll()config
- The configuration, which be used to configure the
protection mode, putIfAbsent, and repetitionschannelCreator
- The future channel creator
- Returns:
- The future state of this operation.
add
public FutureDHT add(Number160 locationKey,
Data data)
add
public FutureDHT add(Number160 locationKey,
Data data,
ConfigurationStore config)
add
public FutureDHT add(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
add
public FutureDHT add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config)
add
public FutureDHT add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config,
FutureChannelCreator channelCreator)
getAll
public FutureDHT getAll(Number160 locationKey)
getAll
public FutureDHT getAll(Number160 locationKey,
ConfigurationGet config)
getAll
public FutureDHT getAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
get
public FutureDHT get(Number160 locationKey)
get
public FutureDHT get(Number160 locationKey,
ConfigurationGet config)
get
public FutureDHT get(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
get
public FutureDHT get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
get
public FutureDHT get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
parallelRequests
public FutureDHT parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
parallelRequests
public FutureDHT parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
FutureChannelCreator channelCreator,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
digestAll
public FutureDHT digestAll(Number160 locationKey)
digestAll
public FutureDHT digestAll(Number160 locationKey,
ConfigurationGet config)
digestAll
public FutureDHT digestAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
digest
public FutureDHT digest(Number160 locationKey)
digest
public FutureDHT digest(Number160 locationKey,
ConfigurationGet config)
digest
public FutureDHT digest(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
digest
public FutureDHT digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
digest
public FutureDHT digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
removeAll
public FutureDHT removeAll(Number160 locationKey)
removeAll
public FutureDHT removeAll(Number160 locationKey,
ConfigurationRemove config)
removeAll
public FutureDHT removeAll(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
remove
public FutureDHT remove(Number160 locationKey)
remove
public FutureDHT remove(Number160 locationKey,
ConfigurationRemove config)
remove
public FutureDHT remove(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
remove
public FutureDHT remove(Number160 locationKey,
Number160 contentKey)
remove
public FutureDHT remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config)
remove
public FutureDHT remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
send
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer)
send
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config)
send
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
send
public FutureDHT send(Number160 locationKey,
Object object)
throws IOException
- Throws:
IOException
send
public FutureDHT send(Number160 locationKey,
Object object,
ConfigurationDirect config)
throws IOException
- Throws:
IOException
send
public FutureDHT send(Number160 locationKey,
Object object,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
throws IOException
- Throws:
IOException
getFromTracker
public FutureTracker getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config)
getFromTrackerCreateBloomfilter1
public FutureTracker getFromTrackerCreateBloomfilter1(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<PeerAddress> knownPeers)
getFromTrackerCreateBloomfilter2
public FutureTracker getFromTrackerCreateBloomfilter2(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<Number160> knownPeers)
getFromTracker
public FutureTracker getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config,
Set<Number160> knownPeers)
addToTracker
public FutureTracker addToTracker(Number160 locationKey,
ConfigurationTrackerStore config)
reserve
public FutureChannelCreator reserve(ConfigurationBaseDHT configurationBaseDHT,
String name)
- Reserves a connection for a routing and DHT operation. This call blocks
until connections have been reserved.
- Parameters:
configurationBaseDHT
- The information about the routing and the DHT
operationname
- The name of the ChannelCreator, used for easier debugging
- Returns:
- A ChannelCreator that can create channel according to
routingConfiguration and requestP2PConfiguration
reserve
public FutureChannelCreator reserve(ConfigurationBaseDHT configurationBaseDHT)
- Reserves a connection for a routing and DHT operation. This call blocks
until connections have been reserved.
- Parameters:
configurationBaseDHT
- The information about the routing and the DHT
operation
- Returns:
- A ChannelCreator that can create channel according to
routingConfiguration and requestP2PConfiguration
reserve
public FutureChannelCreator reserve(RoutingConfiguration routingConfiguration,
RequestP2PConfiguration requestP2PConfiguration,
String name)
- Reserves a connection for a routing and DHT operation. This call does not
blocks. At least one of the arguments routingConfiguration or
requestP2PConfiguration must not be null.
- Parameters:
routingConfiguration
- The information about the routingrequestP2PConfiguration
- The information about the DHT operationname
- The name of the ChannelCreator, used for easier debugging
- Returns:
- A ChannelCreator that can create channel according to
routingConfiguration and requestP2PConfiguration
- Throws:
IllegalArgumentException
- If both arguments routingConfiguration
and requestP2PConfiguration are null
release
public void release(ChannelCreator channelCreator)
- Release a ChannelCreator. The permits will be returned so that they can
be used again. This is a wrapper for ConnectionReservation.
- Parameters:
channelCreator
- The ChannelCreator that is not used anymore
setFutureTimeout
public void setFutureTimeout(BaseFuture baseFuture,
int millis,
String reason)
- Sets a timeout for this future. If the timeout passes, the future fails
with the reason provided
- Parameters:
baseFuture
- The future to set the timeoutmillis
- The time in milliseconds until this future is considered a
failure.reason
- The reason why this future failed
Copyright © 2012. All Rights Reserved.