|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.tomp2p.p2p.Peer
public class Peer
TomP2P implements besides the following distributed hash table (DHT) operations:
| Field Summary | |
|---|---|
static int |
BLOOMFILTER_SIZE
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BLOOMFILTER_SIZE
| Method Detail |
|---|
public void addPeerListener(PeerListener listener)
listener - The listenerpublic void removePeerListener(PeerListener listener)
listener - The listenerpublic List<PeerListener> getListeners()
public void shutdown()
InterruptedExceptionpublic Map<BaseFuture,Long> getPendingFutures()
public boolean isRunning()
public boolean isListening()
public void customLoggerMessage(String customMessage)
public HandshakeRPC getHandshakeRPC()
public void setHandshakeRPC(HandshakeRPC handshakeRPC)
public StorageRPC getStoreRPC()
public void setStorageRPC(StorageRPC storageRPC)
public NeighborRPC getNeighborRPC()
public void setNeighborRPC(NeighborRPC neighborRPC)
public QuitRPC getQuitRPC()
public void setQuitRPC(QuitRPC quitRCP)
public PeerExchangeRPC getPeerExchangeRPC()
public void setPeerExchangeRPC(PeerExchangeRPC peerExchangeRPC)
public DirectDataRPC getDirectDataRPC()
public void setDirectDataRPC(DirectDataRPC directDataRPC)
public TrackerRPC getTrackerRPC()
public void setTrackerRPC(TrackerRPC trackerRPC)
public TaskRPC getTaskRPC()
public void setTaskRPC(TaskRPC taskRPC)
public DistributedRouting getDistributedRouting()
public void setDistributedRouting(DistributedRouting distributedRouting)
public DistributedHashTable getDistributedHashMap()
public void setDistributedHashMap(DistributedHashTable distributedHashMap)
public DistributedTracker getDistributedTracker()
public void setDistributedTracker(DistributedTracker distributedTracker)
public AsyncTask getAsyncTask()
public void setAsyncTask(AsyncTask asyncTask)
public DistributedTask getDistributedTask()
public void setDistributedTask(DistributedTask task)
public List<ScheduledFuture<?>> getScheduledFutures()
public ConnectionHandler getConnectionHandler()
public PeerBean getPeerBean()
public ConnectionBean getConnectionBean()
public Number160 getPeerID()
public int getP2PID()
public PeerAddress getPeerAddress()
public ConnectionConfiguration getConfiguration()
public void setRawDataReply(RawDataReply rawDataReply)
public void setObjectDataReply(ObjectDataReply objectDataReply)
public PeerConnection createPeerConnection(PeerAddress destination,
int idleTCPMillis)
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.
public FutureData send(PeerAddress remotePeer,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
public FutureData send(PeerConnection connection,
org.jboss.netty.buffer.ChannelBuffer requestBuffer)
public FutureData send(PeerAddress remotePeer,
Object object)
throws IOException
IOException
public FutureData send(PeerConnection connection,
Object object)
throws IOException
IOExceptionpublic FutureBootstrap bootstrapBroadcast()
public FutureBootstrap bootstrapBroadcast(int port)
public FutureResponse ping(InetSocketAddress address)
address - The address of the remote peer.
public FutureResponse ping(InetSocketAddress address,
boolean isUDP)
address - The address of the remote peer.isUDP - Set to true if UDP should be used, false for TCP.
public FutureBootstrap bootstrap(InetSocketAddress address)
discover(PeerAddress).
address - InetAddress and the UDP port of the peer to boostrap to
public FutureBootstrap bootstrap(PeerAddress peerAddress)
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).
peerAddress - The peer address to bootstrap to
IllegalArgumentException - If the peer ID is Number160.ZERO,
because routing would fail.
public FutureBootstrap bootstrap(PeerAddress discoveryPeerAddress,
Collection<PeerAddress> bootstrapTo,
ConfigurationBootstrap config)
discoveryPeerAddress - The peer address to use for discoverybootstrapTo - The peers used to bootstrapconfig - The configuration
public boolean setupPortForwanding(String internalHost)
internalHost - port -
public FutureDiscover discover(InetAddress inetAddress,
int portUDP,
int portTCP)
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
public FutureDiscover discover(PeerAddress peerAddress)
peerAddress - The peer address. Since pings are used the peer ID can
be Number160.ZERO
public FutureDHT put(Number160 locationKey,
Data data)
public FutureDHT put(Number160 locationKey,
Data data,
ConfigurationStore config)
public FutureDHT put(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
public FutureDHT put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config)
public FutureDHT put(Number160 locationKey,
Map<Number160,Data> dataMap,
ConfigurationStore config,
FutureChannelCreator channelCreator)
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
public FutureDHT add(Number160 locationKey,
Data data)
public FutureDHT add(Number160 locationKey,
Data data,
ConfigurationStore config)
public FutureDHT add(Number160 locationKey,
Data data,
ConfigurationStore config,
FutureChannelCreator channelCreator)
public FutureDHT add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config)
public FutureDHT add(Number160 locationKey,
Collection<Data> dataCollection,
ConfigurationStore config,
FutureChannelCreator channelCreator)
public FutureDHT getAll(Number160 locationKey)
public FutureDHT getAll(Number160 locationKey,
ConfigurationGet config)
public FutureDHT getAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT get(Number160 locationKey)
public FutureDHT get(Number160 locationKey,
ConfigurationGet config)
public FutureDHT get(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
public FutureDHT get(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
public FutureDHT parallelRequests(Number160 locationKey,
ConfigurationBaseDHT config,
FutureChannelCreator channelCreator,
boolean cancleOnFinish,
NavigableSet<PeerAddress> queue,
DistributedHashTable.Operation operation)
public FutureDHT digestAll(Number160 locationKey)
public FutureDHT digestAll(Number160 locationKey,
ConfigurationGet config)
public FutureDHT digestAll(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT digest(Number160 locationKey)
public FutureDHT digest(Number160 locationKey,
ConfigurationGet config)
public FutureDHT digest(Number160 locationKey,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config)
public FutureDHT digest(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationGet config,
FutureChannelCreator channelCreator)
public FutureDHT removeAll(Number160 locationKey)
public FutureDHT removeAll(Number160 locationKey,
ConfigurationRemove config)
public FutureDHT removeAll(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
public FutureDHT remove(Number160 locationKey)
public FutureDHT remove(Number160 locationKey,
ConfigurationRemove config)
public FutureDHT remove(Number160 locationKey,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
public FutureDHT remove(Number160 locationKey,
Number160 contentKey)
public FutureDHT remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config)
public FutureDHT remove(Number160 locationKey,
Set<Number160> keyCollection,
ConfigurationRemove config,
FutureChannelCreator channelCreator)
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer)
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config)
public FutureDHT send(Number160 locationKey,
org.jboss.netty.buffer.ChannelBuffer buffer,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
public FutureDHT send(Number160 locationKey,
Object object)
throws IOException
IOException
public FutureDHT send(Number160 locationKey,
Object object,
ConfigurationDirect config)
throws IOException
IOException
public FutureDHT send(Number160 locationKey,
Object object,
ConfigurationDirect config,
FutureChannelCreator channelCreator)
throws IOException
IOException
public FutureTracker getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config)
public FutureTracker getFromTrackerCreateBloomfilter1(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<PeerAddress> knownPeers)
public FutureTracker getFromTrackerCreateBloomfilter2(Number160 locationKey,
ConfigurationTrackerGet config,
Collection<Number160> knownPeers)
public FutureTracker getFromTracker(Number160 locationKey,
ConfigurationTrackerGet config,
Set<Number160> knownPeers)
public FutureTracker addToTracker(Number160 locationKey,
ConfigurationTrackerStore config)
public FutureChannelCreator reserve(ConfigurationBaseDHT configurationBaseDHT,
String name)
configurationBaseDHT - The information about the routing and the DHT
operationname - The name of the ChannelCreator, used for easier debugging
public FutureChannelCreator reserve(ConfigurationBaseDHT configurationBaseDHT)
configurationBaseDHT - The information about the routing and the DHT
operation
public FutureChannelCreator reserve(RoutingConfiguration routingConfiguration,
RequestP2PConfiguration requestP2PConfiguration,
String name)
routingConfiguration - The information about the routingrequestP2PConfiguration - The information about the DHT operationname - The name of the ChannelCreator, used for easier debugging
IllegalArgumentException - If both arguments routingConfiguration
and requestP2PConfiguration are nullpublic void release(ChannelCreator channelCreator)
channelCreator - The ChannelCreator that is not used anymore
public void setFutureTimeout(BaseFuture baseFuture,
int millis,
String reason)
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||