Interface ITracker
-
public interface ITracker
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTorrent(Torrent torrent)Adds a torrent to the torrentMap if not already on itvoidannounce(Torrent torrent)Requests the tracker to execute an announce event.voidconnectPeer(PeerConnectInfo peer)Dispatches the connecting of a peer by the tracker.Optional<TorrentInfo>getInfo(Torrent torrent)Retrieves the torrent information which is stored for this tracker.StringgetName()Returns a user friendly name for this tracker.StringgetStatus()Returns the a user friendly name for the current action which the being executed.booleanhasTorrent(Torrent torrent)Checks if the tracker can request information about the torrentvoidscrape()Requests a scrape off all known torrent in this tracker.
-
-
-
Method Detail
-
addTorrent
void addTorrent(Torrent torrent)
Adds a torrent to the torrentMap if not already on it- Parameters:
torrent- The torrent to add
-
hasTorrent
boolean hasTorrent(Torrent torrent)
Checks if the tracker can request information about the torrent- Parameters:
torrent- The torrent we want information about- Returns:
- if the tracker knows the torrent
-
announce
void announce(Torrent torrent)
Requests the tracker to execute an announce event. In case the tracker cannot immediately execute the request the call may be ignored or postponed. This call must return immediately.- Parameters:
torrent- The torrent for which an announce event is being requested.
-
scrape
void scrape()
Requests a scrape off all known torrent in this tracker. This call must return immediately.
-
connectPeer
void connectPeer(PeerConnectInfo peer)
Dispatches the connecting of a peer by the tracker. This call must return immediately.- Parameters:
peer- The peer connection information
-
getInfo
Optional<TorrentInfo> getInfo(Torrent torrent)
Retrieves the torrent information which is stored for this tracker.- Parameters:
torrent- The torrent which the information should be retrieved- Returns:
- The torrent info or empty if not registered.
- Since:
- 0.5
-
getStatus
String getStatus()
Returns the a user friendly name for the current action which the being executed.- Returns:
- The name of the currently executing action
-
getName
String getName()
Returns a user friendly name for this tracker. The recommended information to display is the domain of the tracker.- Returns:
- The name of tracker
-
-