org.gudy.azureus2.core3.tracker.client.impl.bt
Class TrackerChecker

java.lang.Object
  extended by org.gudy.azureus2.core3.tracker.client.impl.bt.TrackerChecker
All Implemented Interfaces:
AEDiagnosticsEvidenceGenerator, SystemTime.ChangeListener, TimerEventPerformer

public class TrackerChecker
extends Object
implements AEDiagnosticsEvidenceGenerator, SystemTime.ChangeListener, TimerEventPerformer

Author:
Olivier

Constructor Summary
protected TrackerChecker(TRTrackerBTScraperImpl _scraper)
          Initialize TrackerChecker.
 
Method Summary
 void clockChangeCompleted(long current_time, long offset)
          Called after the change is visible to getCurrentTime callers
 void clockChangeDetected(long current_time, long offset)
          Called before the change becomes visible to getCurrentTime callers
 void generate(IndentWriter writer)
           
protected  TRTrackerScraperResponseImpl getHashData(TOTorrent torrent, URL target_url)
          Retrieves the last cached Scraper Response based on a TOTorrent's Announce URL (not announce-list) and hash.
protected  TRTrackerScraperResponseImpl getHashData(TRTrackerAnnouncer tracker_client)
          Retrieves the last cached Scraper Response based on a TRTrackerClient's current URL (announce-list entry or announce) and its torrent's hash.
protected  TRTrackerScraperResponseImpl getHashData(URL trackerUrl, HashWrapper hash)
          Retrieves the last cached Scraper Response for the supplied tracker URL and hash.
 long getNextScrapeCheckOn()
           
protected  TRTrackerScraperResponseImpl peekHashData(TOTorrent torrent, URL target_url)
           
 void perform(TimerEvent event)
           
protected  void removeHash(String trackerUrl, HashWrapper hash)
          Removes the scrape task and data associated with the supplied tracker URL and torrent hash.
protected  void removeHash(TOTorrent torrent)
          Removes the scrape task and data associated with the TOTorrent's Announce URL, announce-list data and hash.
protected  void syncUpdate(TOTorrent torrent, URL target_url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackerChecker

protected TrackerChecker(TRTrackerBTScraperImpl _scraper)
Initialize TrackerChecker.

Method Detail

getHashData

protected TRTrackerScraperResponseImpl getHashData(TRTrackerAnnouncer tracker_client)
Retrieves the last cached Scraper Response based on a TRTrackerClient's current URL (announce-list entry or announce) and its torrent's hash.

Returns:
The cached scrape response. Can be null.

getHashData

protected TRTrackerScraperResponseImpl getHashData(TOTorrent torrent,
                                                   URL target_url)
Retrieves the last cached Scraper Response based on a TOTorrent's Announce URL (not announce-list) and hash.

Returns:
The cached scrape response. Can be null.

getHashData

protected TRTrackerScraperResponseImpl getHashData(URL trackerUrl,
                                                   HashWrapper hash)
Retrieves the last cached Scraper Response for the supplied tracker URL and hash. If no cache has exists for the hash, one is created.

Returns:
The cached scrape response. Can be null.

peekHashData

protected TRTrackerScraperResponseImpl peekHashData(TOTorrent torrent,
                                                    URL target_url)

removeHash

protected void removeHash(TOTorrent torrent)
Removes the scrape task and data associated with the TOTorrent's Announce URL, announce-list data and hash.


removeHash

protected void removeHash(String trackerUrl,
                          HashWrapper hash)
Removes the scrape task and data associated with the supplied tracker URL and torrent hash.


syncUpdate

protected void syncUpdate(TOTorrent torrent,
                          URL target_url)

perform

public void perform(TimerEvent event)
Specified by:
perform in interface TimerEventPerformer

clockChangeDetected

public void clockChangeDetected(long current_time,
                                long offset)
Description copied from interface: SystemTime.ChangeListener
Called before the change becomes visible to getCurrentTime callers

Specified by:
clockChangeDetected in interface SystemTime.ChangeListener

clockChangeCompleted

public void clockChangeCompleted(long current_time,
                                 long offset)
Description copied from interface: SystemTime.ChangeListener
Called after the change is visible to getCurrentTime callers

Specified by:
clockChangeCompleted in interface SystemTime.ChangeListener

generate

public void generate(IndentWriter writer)
Specified by:
generate in interface AEDiagnosticsEvidenceGenerator

getNextScrapeCheckOn

public long getNextScrapeCheckOn()