Class TorrentInfo


  • public class TorrentInfo
    extends Object
    • Constructor Detail

      • TorrentInfo

        public TorrentInfo​(Torrent torrent,
                           Clock clock)
    • Method Detail

      • setEvent

        public void setEvent​(TrackerEvent event)
        Sets the current event for this Torrent
        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 a ITracker.announce(Torrent) request and therefor updates lastAnnounceTime
        Parameters:
        seeders - The amount of seeders in the swarm
        leechers - 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 swarm
        leechers - 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 this Torrent
        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