|
||||||||||
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()
InterruptedException
public 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 void setBroadcastRPC(BroadcastRPC broadcastRPC)
public BroadcastRPC getBroadcastRPC()
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 Bindings getBindings()
public org.jboss.netty.util.Timer getTimer()
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 boolean setupPortForwanding(String internalHost)
internalHost
- port
-
public SubmitBuilder submit(Number160 locationKey, Worker worker)
public AddBuilder add(Number160 locationKey)
public PutBuilder put(Number160 locationKey)
public GetBuilder get(Number160 locationKey)
public RemoveBuilder remove(Number160 locationKey)
public SendBuilder send(Number160 locationKey)
1. routing: find close peers to the content hash. You can control the routing behavior with setRoutingConfiguration() 2. sending: send the data to the n closest peers. N is set via setRequestP2PConfiguration(). If you want to send it to the closest one, use setRequestP2PConfiguration(1, 5, 0)
locationKey
- The target hash to search for during the routing process
public SendDirectBuilder sendDirect(PeerAddress recipientAddress)
public SendDirectBuilder sendDirect(PeerConnection recipientConnection)
@Deprecated public SendDirectBuilder sendDirect()
public BootstrapBuilder bootstrap()
public PingBuilder ping()
public DiscoverBuilder discover()
public AddTrackerBuilder addTracker(Number160 locationKey)
public GetTrackerBuilder getTracker(Number160 locationKey)
public ParallelRequestBuilder parallelRequest(Number160 locationKey)
public BroadcastBuilder broadcast(Number160 messageKey)
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 anymorepublic 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 failedpublic boolean isShutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |