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 LogIDsprivate long(package private) TRTrackerBTScraperResponseImplLoop indefinitely, waiting for the next scrape, and scraping.private final TRTrackerBTScraperImplTRTrackerScraperImpl object associated with this object.private static final Timerprivate final HashMapList of Trackers.private final AEMonitor -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTrackerChecker(TRTrackerBTScraperImpl _scraper) Initialize TrackerChecker. -
Method Summary
Modifier and TypeMethodDescriptionprivate TRTrackerBTScraperResponseImplFinds the torrent that will be needing a scrape next.voidclockChangeCompleted(long current_time, long offset) Called after the change is visible to getCurrentTime callersvoidclockChangeDetected(long current_time, long offset) Called before the change becomes visible to getCurrentTime callersvoidgenerate(IndentWriter writer) protected TRTrackerScraperResponseImplgetHashData(TOTorrent torrent, URL target_url) Retrieves the last cached Scraper Response based on a TOTorrent's Announce URL (not announce-list) and hash.protected TRTrackerScraperResponseImplgetHashData(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 TRTrackerScraperResponseImplgetHashData(URL trackerUrl, HashWrapper hash) Retrieves the last cached Scraper Response for the supplied tracker URL and hash.longprotected TRTrackerScraperResponseImplpeekHashData(TOTorrent torrent, URL target_url) voidperform(TimerEvent event) protected voidremoveHash(TOTorrent torrent) Removes the scrape task and data associated with the TOTorrent's Announce URL, announce-list data and hash.protected voidremoveHash(String trackerUrl, HashWrapper hash) Removes the scrape task and data associated with the supplied tracker URL and torrent hash.private voidprotected voidsyncUpdate(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:
performin 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.ChangeListenerCalled before the change becomes visible to getCurrentTime callers- Specified by:
clockChangeDetectedin interfaceSystemTime.ChangeListener- Parameters:
current_time-offset-
-
clockChangeCompleted
public void clockChangeCompleted(long current_time, long offset) Description copied from interface:SystemTime.ChangeListenerCalled after the change is visible to getCurrentTime callers- Specified by:
clockChangeCompletedin interfaceSystemTime.ChangeListener- Parameters:
current_time-offset-
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-
getNextScrapeCheckOn
public long getNextScrapeCheckOn()
-