Class DHTTrackerPlugin
java.lang.Object
com.biglybt.plugin.tracker.dht.DHTTrackerPlugin
- All Implemented Interfaces:
AEDiagnosticsEvidenceGenerator, DownloadAttributeListener, DownloadListener, DownloadTrackerListener, Plugin
public class DHTTrackerPlugin
extends Object
implements Plugin, DownloadListener, DownloadAttributeListener, DownloadTrackerListener, AEDiagnosticsEvidenceGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DHTTrackerPluginAltprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate booleanprivate longprivate static URLprivate DHTPluginprivate AtomicIntegerprivate AtomicIntegerprivate AtomicIntegerprivate AtomicLongprivate AtomicIntegerprivate AtomicIntegerprivate static final intprivate booleanprivate static final intprivate static final Objectprivate static final intstatic Objectprivate AESemaphoreprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate intprivate static final intprivate booleanprivate static final Objectprivate static final intprivate LoggerChannelprivate static final intprivate static final intprivate static final intprivate static final intprivate BasicPluginViewModelstatic final intprivate static final Stringprivate PluginInterfaceprivate static final Stringprivate static final Stringprivate Randomprivate static final intprivate static final intprivate static final intprivate Map<Download, DHTTrackerPlugin.RegistrationDetails> private static final Objectprivate static final intprivate static final intprivate static final longprivate TorrentAttributeprivate TorrentAttributeprivate static final booleanprivate AEMonitorprivate static final booleanprivate BooleanParameterprivate static final booleanprivate BooleanParameterprivate booleanFields inherited from interface DownloadAttributeListener
WILL_BE_READ, WRITTEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDownload(Download download) private voidvoidvoidannounceResult(DownloadAnnounceResult result) An announce result has been returned from the trackervoidattributeEventOccurred(Download download, TorrentAttribute attr, int event_type) This method will be called when an attribute event occurs.protected voidcheckDownloadForRegistration(Download download, boolean first_time) protected voidprotected voidvoidgenerate(IndentWriter writer) protected longgetDerivedTrackMetric(Download download) getTrackerPeerSource(Download download) getTrackerPeerSources(Torrent torrent) protected voidprotected voidvoidinitialize(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientprotected booleanprotected booleanisComplete(Download download) booleanstatic voidload(PluginInterface plugin_interface) private voidprotected voidvoidpositionChanged(Download download, int oldPosition, int newPosition) Position of download has changed.protected voidprocessNonRegistrations(boolean do_presence_checks, boolean do_scrape_checks, boolean do_logging) protected voidprocessRegistrations(boolean full_processing) voidremoveDownload(Download download) scrape(byte[] hash) This is used by the dhtscraper pluginvoidscrapeResult(DownloadScrapeResult result) A scrape result has been returned from a trackervoidstateChanged(Download download, int old_state, int new_state) The Download's state has changed.protected inttrackerGet(Download download, DHTTrackerPlugin.RegistrationDetails details, boolean derived_only) protected voidtrackerPut(Download download, DHTTrackerPlugin.RegistrationDetails details) protected voidtrackerRemove(Download download, DHTTrackerPlugin.RegistrationDetails details) protected voidtrackerRemove(Download download, DHTTrackerPlugin.trackerTarget target) voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Plugin
getInitialProperties
-
Field Details
-
DOWNLOAD_USER_DATA_I2P_SCRAPE_KEY
-
PLUGIN_NAME
- See Also:
-
PLUGIN_CONFIGSECTION_ID
- See Also:
-
PLUGIN_RESOURCE_ID
- See Also:
-
ANNOUNCE_TIMEOUT
private static final int ANNOUNCE_TIMEOUT- See Also:
-
ANNOUNCE_DERIVED_TIMEOUT
private static final int ANNOUNCE_DERIVED_TIMEOUT- See Also:
-
ANNOUNCE_MIN_DEFAULT
private static final int ANNOUNCE_MIN_DEFAULT- See Also:
-
ANNOUNCE_MAX
private static final int ANNOUNCE_MAX- See Also:
-
ANNOUNCE_MAX_DERIVED_ONLY
private static final int ANNOUNCE_MAX_DERIVED_ONLY- See Also:
-
SCRAPE_DATA_KEY
-
SCRAPE_TIMEOUT
private static final int SCRAPE_TIMEOUT- See Also:
-
SCRAPE_MIN_DEFAULT
private static final int SCRAPE_MIN_DEFAULT- See Also:
-
INTERESTING_CHECK_PERIOD
private static final int INTERESTING_CHECK_PERIOD- See Also:
-
INTERESTING_INIT_RAND_OURS
private static final int INTERESTING_INIT_RAND_OURS- See Also:
-
INTERESTING_INIT_MIN_OURS
private static final int INTERESTING_INIT_MIN_OURS- See Also:
-
INTERESTING_INIT_RAND_OTHERS
private static final int INTERESTING_INIT_RAND_OTHERS- See Also:
-
INTERESTING_INIT_MIN_OTHERS
private static final int INTERESTING_INIT_MIN_OTHERS- See Also:
-
INTERESTING_DHT_CHECK_PERIOD
private static final int INTERESTING_DHT_CHECK_PERIOD- See Also:
-
INTERESTING_DHT_INIT_RAND
private static final int INTERESTING_DHT_INIT_RAND- See Also:
-
INTERESTING_DHT_INIT_MIN
private static final int INTERESTING_DHT_INIT_MIN- See Also:
-
INTERESTING_AVAIL_MAX
private static final int INTERESTING_AVAIL_MAX- See Also:
-
INTERESTING_PUB_MAX_DEFAULT
private static final int INTERESTING_PUB_MAX_DEFAULT- See Also:
-
MAX_ACTIVE_DHT_GETS
private static final int MAX_ACTIVE_DHT_GETS- See Also:
-
MAX_ACTIVE_DHT_REMOVES
private static final int MAX_ACTIVE_DHT_REMOVES- See Also:
-
MAX_ACTIVE_DHT_PUTS
private static final int MAX_ACTIVE_DHT_PUTS- See Also:
-
MAX_ACTIVE_DHT_SCRAPES
private static final int MAX_ACTIVE_DHT_SCRAPES- See Also:
-
REG_TYPE_NONE
private static final int REG_TYPE_NONE- See Also:
-
REG_TYPE_FULL
private static final int REG_TYPE_FULL- See Also:
-
REG_TYPE_DERIVED
private static final int REG_TYPE_DERIVED- See Also:
-
LIMITED_TRACK_SIZE
private static final int LIMITED_TRACK_SIZE- See Also:
-
TRACK_NORMAL_DEFAULT
private static final boolean TRACK_NORMAL_DEFAULT- See Also:
-
TRACK_LIMITED_DEFAULT
private static final boolean TRACK_LIMITED_DEFAULT- See Also:
-
TEST_ALWAYS_TRACK
private static final boolean TEST_ALWAYS_TRACK- See Also:
-
NUM_WANT
public static final int NUM_WANT- See Also:
-
start_time
private static final long start_time -
DL_DERIVED_METRIC_KEY
-
DL_DERIVED_MIN_TRACK
private static final int DL_DERIVED_MIN_TRACK- See Also:
-
DL_DERIVED_MAX_TRACK
private static final int DL_DERIVED_MAX_TRACK- See Also:
-
DIRECT_INJECT_PEER_MAX
private static final int DIRECT_INJECT_PEER_MAX- See Also:
-
LATEST_REGISTER_REASON
-
DEFAULT_URL
-
plugin_interface
-
model
-
dht
-
ta_networks
-
ta_peer_sources
-
interesting_downloads
-
interesting_published
-
interesting_pub_max
private int interesting_pub_max -
running_downloads
-
run_data_cache
-
registered_downloads
-
limited_online_tracking
-
query_map
-
in_progress
-
track_only_decentralsed
private boolean track_only_decentralsed -
track_normal_when_offline
-
track_limited_when_online
-
current_announce_interval
private long current_announce_interval -
log
-
scrape_injection_map
-
random
-
is_running
private volatile boolean is_running -
closing
private volatile boolean closing -
dht_gets_active
-
dht_puts_active
-
dht_removes_active
-
dht_scrapes_active
-
dht_scrapes_complete
-
dht_scrape_complete_mono
-
this_mon
-
initialised_sem
-
alt_lookup_handler
-
disable_put
private boolean disable_put
-
-
Constructor Details
-
DHTTrackerPlugin
public DHTTrackerPlugin()
-
-
Method Details
-
load
-
initialize
Description copied from interface:PluginThis method is called when the Plugin is loaded by the client- Specified by:
initializein interfacePlugin- Parameters:
_plugin_interface- the interface that the plugin must use to communicate with the client
-
notRunning
protected void notRunning() -
initialise
protected void initialise() -
waitUntilInitialised
public void waitUntilInitialised() -
isRunning
public boolean isRunning() -
addDownload
-
removeDownload
-
attributeEventOccurred
Description copied from interface:DownloadAttributeListenerThis method will be called when an attribute event occurs.- Specified by:
attributeEventOccurredin interfaceDownloadAttributeListener- Parameters:
download- The download object involved.attr- The attribute involved.event_type- Either WRITTEN or WILL_BE_READ.
-
scrapeResult
Description copied from interface:DownloadTrackerListenerA scrape result has been returned from a tracker- Specified by:
scrapeResultin interfaceDownloadTrackerListener- Parameters:
result- Information about the scrape
-
announceResult
Description copied from interface:DownloadTrackerListenerAn announce result has been returned from the tracker- Specified by:
announceResultin interfaceDownloadTrackerListener- Parameters:
result- Information about the announce
-
checkDownloadForRegistration
-
processRegistrations
protected void processRegistrations(boolean full_processing) -
getDerivedTrackMetric
-
trackerPut
-
trackerGet
protected int trackerGet(Download download, DHTTrackerPlugin.RegistrationDetails details, boolean derived_only) -
isComplete
-
trackerRemove
-
trackerRemove
-
processNonRegistrations
protected void processNonRegistrations(boolean do_presence_checks, boolean do_scrape_checks, boolean do_logging) -
stateChanged
Description copied from interface:DownloadListenerThe Download's state has changed. This is also triggered if the user toggles the Force Start on/off.- Specified by:
stateChangedin interfaceDownloadListener
-
announceAll
public void announceAll() -
announce
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-
positionChanged
Description copied from interface:DownloadListenerPosition of download has changed.- Specified by:
positionChangedin interfaceDownloadListener- Parameters:
download- object in which the position has changedoldPosition- position that the download used to be atnewPosition- position that the download is now at
-
configChanged
protected void configChanged() -
scrape
This is used by the dhtscraper plugin -
increaseActive
-
decreaseActive
-
isActive
-
log
-
getTrackerPeerSource
-
getTrackerPeerSources
-