Package com.biglybt.plugin.tracker.dht
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 class
protected class
static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DHTTrackerPluginAlt
private static final int
private static final int
private static final int
private static final int
private static final int
private boolean
private long
private static URL
private DHTPlugin
private AtomicInteger
private AtomicInteger
private AtomicInteger
private AtomicLong
private AtomicInteger
private AtomicInteger
private static final int
private boolean
private static final int
private static final Object
private static final int
static Object
private AESemaphore
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private int
private static final int
private boolean
private static final Object
private static final int
private LoggerChannel
private static final int
private static final int
private static final int
private static final int
private BasicPluginViewModel
static final int
private static final String
private PluginInterface
private static final String
private static final String
private Random
private static final int
private static final int
private static final int
private static final Object
private static final int
private static final int
private static final long
private TorrentAttribute
private TorrentAttribute
private static final boolean
private AEMonitor
private static final boolean
private BooleanParameter
private static final boolean
private BooleanParameter
private boolean
Fields inherited from interface com.biglybt.pif.download.DownloadAttributeListener
WILL_BE_READ, WRITTEN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDownload
(Download download) private void
void
void
announceResult
(DownloadAnnounceResult result) An announce result has been returned from the trackervoid
attributeEventOccurred
(Download download, TorrentAttribute attr, int event_type) This method will be called when an attribute event occurs.protected void
checkDownloadForRegistration
(Download download, boolean first_time) protected void
protected void
void
generate
(IndentWriter writer) protected long
getDerivedTrackMetric
(Download download) getTrackerPeerSource
(Download download) getTrackerPeerSources
(Torrent torrent) protected void
protected void
void
initialize
(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientprotected boolean
protected boolean
isComplete
(Download download) boolean
static void
load
(PluginInterface plugin_interface) private void
protected void
void
positionChanged
(Download download, int oldPosition, int newPosition) Position of download has changed.protected void
processNonRegistrations
(boolean do_presence_checks, boolean do_scrape_checks, boolean do_logging) protected void
processRegistrations
(boolean full_processing) void
removeDownload
(Download download) scrape
(byte[] hash) This is used by the dhtscraper pluginvoid
scrapeResult
(DownloadScrapeResult result) A scrape result has been returned from a trackervoid
stateChanged
(Download download, int old_state, int new_state) The Download's state has changed.protected int
trackerGet
(Download download, DHTTrackerPlugin.RegistrationDetails details, boolean derived_only) protected void
trackerPut
(Download download, DHTTrackerPlugin.RegistrationDetails details) protected void
trackerRemove
(Download download, DHTTrackerPlugin.RegistrationDetails details) protected void
trackerRemove
(Download download, DHTTrackerPlugin.trackerTarget target) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.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:Plugin
This method is called when the Plugin is loaded by the client- Specified by:
initialize
in 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:DownloadAttributeListener
This method will be called when an attribute event occurs.- Specified by:
attributeEventOccurred
in interfaceDownloadAttributeListener
- Parameters:
download
- The download object involved.attr
- The attribute involved.event_type
- Either WRITTEN or WILL_BE_READ.
-
scrapeResult
Description copied from interface:DownloadTrackerListener
A scrape result has been returned from a tracker- Specified by:
scrapeResult
in interfaceDownloadTrackerListener
- Parameters:
result
- Information about the scrape
-
announceResult
Description copied from interface:DownloadTrackerListener
An announce result has been returned from the tracker- Specified by:
announceResult
in 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:DownloadListener
The Download's state has changed. This is also triggered if the user toggles the Force Start on/off.- Specified by:
stateChanged
in interfaceDownloadListener
-
announceAll
public void announceAll() -
announce
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
positionChanged
Description copied from interface:DownloadListener
Position of download has changed.- Specified by:
positionChanged
in 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
-