Class TorrentInfo
- java.lang.Object
-
- org.johnnei.javatorrent.bittorrent.tracker.TorrentInfo
-
public class TorrentInfo extends Object
-
-
Constructor Summary
Constructors Constructor Description TorrentInfo(Torrent torrent, Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDownloadCount()The amount of times this torrent has been downloaded
If the tracker returns 0 it will return N/A as the tracker apparently doesn't support itTrackerEventgetEvent()Gets the current tracker event for thisTorrentintgetLeechers()The amount of leechers as reported by the trackerintgetSeeders()The amount of seeders as reported by the trackerDurationgetTimeSinceLastAnnounce()The time since the last announceTorrentgetTorrent()Gets the associated torrentvoidsetEvent(TrackerEvent event)Sets the current event for thisTorrentvoidsetInfo(int seeders, int leechers)Updates the seeder and leecher counts.voidsetInfo(int seeders, int leechers, int downloadCount)Updates the seeder, leecher and completed downloads count.
-
-
-
Method Detail
-
setEvent
public void setEvent(TrackerEvent event)
Sets the current event for thisTorrent- Parameters:
event- The event.
-
setInfo
public void setInfo(int seeders, int leechers)Updates the seeder and leecher counts. This is assumed to be the result of aITracker.announce(Torrent)request and therefor updateslastAnnounceTime- Parameters:
seeders- The amount of seeders in the swarmleechers- The amount of leechers in the swarm.
-
setInfo
public void setInfo(int seeders, int leechers, int downloadCount)Updates the seeder, leecher and completed downloads count.- Parameters:
seeders- The amount of seeders in the swarmleechers- The amount of leechers in the swarm.downloadCount- The amount of times this torrent has been downloaded.
-
getEvent
public TrackerEvent getEvent()
Gets the current tracker event for thisTorrent- Returns:
- The tracker event.
-
getSeeders
public int getSeeders()
The amount of seeders as reported by the tracker- Returns:
- the amount of seeders
-
getLeechers
public int getLeechers()
The amount of leechers as reported by the tracker- Returns:
- the amount of leechers
-
getDownloadCount
public String getDownloadCount()
The amount of times this torrent has been downloaded
If the tracker returns 0 it will return N/A as the tracker apparently doesn't support it- Returns:
- the count of times downloaded or N/A if not reported
-
getTimeSinceLastAnnounce
public Duration getTimeSinceLastAnnounce()
The time since the last announce- Returns:
- The duration since last announce
-
getTorrent
public Torrent getTorrent()
Gets the associated torrent- Returns:
- The torrent with this info
-
-