Class TrackerChecker
- java.lang.Object
-
- com.biglybt.core.tracker.client.impl.bt.TrackerChecker
-
- All Implemented Interfaces:
AEDiagnosticsEvidenceGenerator
,SystemTime.ChangeListener
,TimerEventPerformer
public class TrackerChecker extends java.lang.Object implements AEDiagnosticsEvidenceGenerator, SystemTime.ChangeListener, TimerEventPerformer
-
-
Field Summary
Fields Modifier and Type Field Description private static LogIDs
LOGID
private long
nextScrapeCheckOn
(package private) TRTrackerBTScraperResponseImpl
oldResponse
Loop indefinitely, waiting for the next scrape, and scraping.private TRTrackerBTScraperImpl
scraper
TRTrackerScraperImpl object associated with this object.private static Timer
tracker_timer
private java.util.HashMap
trackers
List of Trackers.private AEMonitor
trackers_mon
-
Constructor Summary
Constructors Modifier Constructor Description protected
TrackerChecker(TRTrackerBTScraperImpl _scraper)
Initialize TrackerChecker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private TRTrackerBTScraperResponseImpl
checkForNextScrape()
Finds the torrent that will be needing a scrape next.void
clockChangeCompleted(long current_time, long offset)
Called after the change is visible to getCurrentTime callersvoid
clockChangeDetected(long current_time, long offset)
Called before the change becomes visible to getCurrentTime callersvoid
generate(IndentWriter writer)
protected TRTrackerScraperResponseImpl
getHashData(TOTorrent torrent, java.net.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(java.net.URL trackerUrl, HashWrapper hash)
Retrieves the last cached Scraper Response for the supplied tracker URL and hash.long
getNextScrapeCheckOn()
protected TRTrackerScraperResponseImpl
peekHashData(TOTorrent torrent, java.net.URL target_url)
void
perform(TimerEvent event)
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
removeHash(java.lang.String trackerUrl, HashWrapper hash)
Removes the scrape task and data associated with the supplied tracker URL and torrent hash.private void
runScrapes()
protected void
syncUpdate(TOTorrent torrent, java.net.URL target_url)
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
tracker_timer
private static final Timer tracker_timer
-
trackers
private final java.util.HashMap trackers
List of Trackers. key = Tracker URL string value = TrackerStatus object
-
trackers_mon
private final AEMonitor trackers_mon
-
scraper
private final TRTrackerBTScraperImpl scraper
TRTrackerScraperImpl object associated with this object.
-
nextScrapeCheckOn
private long nextScrapeCheckOn
-
oldResponse
TRTrackerBTScraperResponseImpl oldResponse
Loop indefinitely, waiting for the next scrape, and scraping.
-
-
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, java.net.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(java.net.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, java.net.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(java.lang.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, java.net.URL target_url)
-
perform
public void perform(TimerEvent event)
- Specified by:
perform
in interfaceTimerEventPerformer
-
runScrapes
private void runScrapes()
-
checkForNextScrape
private TRTrackerBTScraperResponseImpl checkForNextScrape()
Finds the torrent that will be needing a scrape next.
-
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 interfaceSystemTime.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 interfaceSystemTime.ChangeListener
-
generate
public void generate(IndentWriter writer)
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
getNextScrapeCheckOn
public long getNextScrapeCheckOn()
-
-