public class PeerRegistry extends Object implements IPeerRegistry
Note that this class implements a service. Hence, is not a part of the public API and is a subject to change.
Constructor and Description |
---|
PeerRegistry(IRuntimeLifecycleBinder lifecycleBinder,
EventSource eventSource,
IdentityService idService,
TorrentRegistry torrentRegistry,
ITrackerService trackerService,
EventSink eventSink,
Set<PeerSourceFactory> extraPeerSourceFactories,
Config config) |
Modifier and Type | Method and Description |
---|---|
void |
addPeer(TorrentId torrentId,
Peer peer)
Add peer for a given torrent and notify all peer consumers.
|
void |
addPeerSource(TorrentId torrentId,
AnnounceKey announceKey)
Register a new tracker peer source for a given torrent, based on the provided announce key.
|
Peer |
getLocalPeer()
Returns local peer, that represents current runtime in the swarm.
|
void |
triggerPeerCollection(TorrentId torrentId)
Trigger a collection of peers for the specified torrent.
|
@Inject public PeerRegistry(IRuntimeLifecycleBinder lifecycleBinder, EventSource eventSource, IdentityService idService, TorrentRegistry torrentRegistry, ITrackerService trackerService, EventSink eventSink, Set<PeerSourceFactory> extraPeerSourceFactories, Config config)
public void triggerPeerCollection(TorrentId torrentId)
IPeerRegistry
triggerPeerCollection
in interface IPeerRegistry
torrentId
- the torrent ID to Announcepublic void addPeer(TorrentId torrentId, Peer peer)
IPeerRegistry
addPeer
in interface IPeerRegistry
public void addPeerSource(TorrentId torrentId, AnnounceKey announceKey)
IPeerRegistry
addPeerSource
in interface IPeerRegistry
public Peer getLocalPeer()
IPeerRegistry
getLocalPeer
in interface IPeerRegistry
Copyright © 2016–2021. All rights reserved.