Class TrackerChecker
java.lang.Object
com.biglybt.core.tracker.client.impl.bt.TrackerChecker
- All Implemented Interfaces:
AEDiagnosticsEvidenceGenerator
,SystemTime.ChangeListener
,TimerEventPerformer
public class TrackerChecker
extends Object
implements AEDiagnosticsEvidenceGenerator, SystemTime.ChangeListener, TimerEventPerformer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LogIDs
private long
(package private) TRTrackerBTScraperResponseImpl
Loop indefinitely, waiting for the next scrape, and scraping.private final TRTrackerBTScraperImpl
TRTrackerScraperImpl object associated with this object.private static final Timer
private final HashMap
List of Trackers.private final AEMonitor
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TrackerChecker
(TRTrackerBTScraperImpl _scraper) Initialize TrackerChecker. -
Method Summary
Modifier and TypeMethodDescriptionprivate TRTrackerBTScraperResponseImpl
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, 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
protected TRTrackerScraperResponseImpl
peekHashData
(TOTorrent torrent, 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
(String trackerUrl, HashWrapper hash) Removes the scrape task and data associated with the supplied tracker URL and torrent hash.private void
protected void
syncUpdate
(TOTorrent torrent, URL target_url)
-
Field Details
-
LOGID
-
tracker_timer
-
trackers
List of Trackers. key = Tracker URL string value = TrackerStatus object -
trackers_mon
-
scraper
TRTrackerScraperImpl object associated with this object. -
nextScrapeCheckOn
private long nextScrapeCheckOn -
oldResponse
TRTrackerBTScraperResponseImpl oldResponseLoop indefinitely, waiting for the next scrape, and scraping.
-
-
Constructor Details
-
TrackerChecker
Initialize TrackerChecker.
-
-
Method Details
-
getHashData
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
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
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
-
removeHash
Removes the scrape task and data associated with the TOTorrent's Announce URL, announce-list data and hash. -
removeHash
Removes the scrape task and data associated with the supplied tracker URL and torrent hash. -
syncUpdate
-
perform
- Specified by:
perform
in interfaceTimerEventPerformer
-
runScrapes
private void runScrapes() -
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
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
getNextScrapeCheckOn
public long getNextScrapeCheckOn()
-