net.sf.torrentsniffer.tracker
Class TrackerImpl

java.lang.Object
  extended bynet.sf.torrentsniffer.tracker.TrackerImpl
All Implemented Interfaces:
Tracker

public class TrackerImpl
extends java.lang.Object
implements Tracker

Implementation of the Torrent's TrackerImpl.

Author:
Larry Williams

Constructor Summary
TrackerImpl(java.lang.String url)
           
 
Method Summary
 java.lang.String getAnnounce()
           
 java.lang.String getScrapeUrl()
          Retrieves the scrape url for the tracker.
 TorrentState[] getTrackerState()
          Tries to retrieve the state of all torrents tracked by this server.
 void setAnnounce(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackerImpl

public TrackerImpl(java.lang.String url)
Method Detail

getAnnounce

public java.lang.String getAnnounce()
Specified by:
getAnnounce in interface Tracker
Returns:
Returns the url.

setAnnounce

public void setAnnounce(java.lang.String url)
Specified by:
setAnnounce in interface Tracker
Parameters:
url - The url to set.

getTrackerState

public TorrentState[] getTrackerState()
Tries to retrieve the state of all torrents tracked by this server. Uses scraping to do this. Not all trackers support this.

Specified by:
getTrackerState in interface Tracker
Returns:

getScrapeUrl

public java.lang.String getScrapeUrl()
Retrieves the scrape url for the tracker. Taken from http://groups.yahoo.com/group/BitTorrent/message/3275 Take the tracker url. Find the last '/' in it. If the text immediately following that '/' isn't 'announce' it will be taken as a sign that that tracker doesn't support the scrape convention. If it does, substitute 'scrape' for 'announce' to find the scrape page.

Specified by:
getScrapeUrl in interface Tracker
Returns:


Copyright © 2004 Larry Williams. All Rights Reserved.