public class Peer extends Object
#put(Number160),
#get(Number160), #add(Number160), #addTracker(Number160), #getTracker(Number160),
#remove(Number160), #submit(Number160, Worker), #send(Number160), #sendDirect(),
broadcast(Number160). Each of those operations return a builder that offers more options. One of the main
difference to a "regular" DHT is that TomP2P can store a map (key-values) instead of just values. To distinguish
those, the keys are termed location key (for finding the right peer in the network), and content key (to store more
than one value on a peer). For the put builder e.g. the following options can be set:
PutBuilder#setData(Number160, net.tomp2p.storage.Data) - puts a content key with a valuepublic PingRPC pingRPC()
public QuitRPC quitRPC()
public NeighborRPC neighborRPC()
public Peer neighborRPC(NeighborRPC neighborRPC)
public DirectDataRPC directDataRPC()
public Peer directDataRPC(DirectDataRPC directDataRPC)
public BroadcastRPC broadcastRPC()
public Peer broadcastRPC(BroadcastRPC broadcastRPC)
public AnnounceRPC announceRPC()
public Peer announceRPC(AnnounceRPC announceRPC)
public DistributedRouting distributedRouting()
public void distributedRouting(DistributedRouting distributedRouting)
public PeerBean peerBean()
public ConnectionBean connectionBean()
public Number160 peerID()
public int p2pId()
public PeerAddress peerAddress()
public Peer notifyAutomaticFutures(BaseFuture future)
public void rawDataReply(RawDataReply rawDataReply)
public void objectDataReply(ObjectDataReply objectDataReply)
public FuturePeerConnection createPeerConnection(PeerAddress destination)
public FuturePeerConnection createPeerConnection(PeerAddress destination, int heartBeatMillis)
destination - The end-point to connect toheartBeatMillis - // TODO update doc
time in milliseconds after a connection gets closed if idle, -1 if it should remain always open until
the user closes the connection manually.public SendDirectBuilder sendDirect(PeerAddress recipientAddress)
public SendDirectBuilder sendDirect(FuturePeerConnection recipientConnection)
public SendDirectBuilder sendDirect(PeerConnection peerConnection)
public BootstrapBuilder bootstrap()
public ShutdownBuilder announceShutdown()
public PingBuilder ping()
public DiscoverBuilder discover()
public BroadcastBuilder broadcast(Number160 messageKey)
public BaseFuture shutdown()
public boolean isShutdown()
public Peer addAutomaticFuture(AutomaticFuture automaticFuture)
public Peer removeAutomaticFuture(AutomaticFuture automaticFuture)
public AnnounceBuilder localAnnounce()
Copyright © 2014. All rights reserved.