Class DHTTrackerPlugin

    • Field Detail

      • DOWNLOAD_USER_DATA_I2P_SCRAPE_KEY

        public static java.lang.Object DOWNLOAD_USER_DATA_I2P_SCRAPE_KEY
      • PLUGIN_CONFIGSECTION_ID

        private static final java.lang.String PLUGIN_CONFIGSECTION_ID
        See Also:
        Constant Field Values
      • PLUGIN_RESOURCE_ID

        private static final java.lang.String PLUGIN_RESOURCE_ID
        See Also:
        Constant Field Values
      • ANNOUNCE_DERIVED_TIMEOUT

        private static final int ANNOUNCE_DERIVED_TIMEOUT
        See Also:
        Constant Field Values
      • ANNOUNCE_MAX_DERIVED_ONLY

        private static final int ANNOUNCE_MAX_DERIVED_ONLY
        See Also:
        Constant Field Values
      • INTERESTING_CHECK_PERIOD

        private static final int INTERESTING_CHECK_PERIOD
        See Also:
        Constant Field Values
      • INTERESTING_INIT_RAND_OURS

        private static final int INTERESTING_INIT_RAND_OURS
        See Also:
        Constant Field Values
      • INTERESTING_INIT_MIN_OURS

        private static final int INTERESTING_INIT_MIN_OURS
        See Also:
        Constant Field Values
      • INTERESTING_INIT_RAND_OTHERS

        private static final int INTERESTING_INIT_RAND_OTHERS
        See Also:
        Constant Field Values
      • INTERESTING_INIT_MIN_OTHERS

        private static final int INTERESTING_INIT_MIN_OTHERS
        See Also:
        Constant Field Values
      • INTERESTING_DHT_CHECK_PERIOD

        private static final int INTERESTING_DHT_CHECK_PERIOD
        See Also:
        Constant Field Values
      • INTERESTING_DHT_INIT_RAND

        private static final int INTERESTING_DHT_INIT_RAND
        See Also:
        Constant Field Values
      • INTERESTING_DHT_INIT_MIN

        private static final int INTERESTING_DHT_INIT_MIN
        See Also:
        Constant Field Values
      • INTERESTING_PUB_MAX_DEFAULT

        private static final int INTERESTING_PUB_MAX_DEFAULT
        See Also:
        Constant Field Values
      • TRACK_NORMAL_DEFAULT

        private static final boolean TRACK_NORMAL_DEFAULT
        See Also:
        Constant Field Values
      • TRACK_LIMITED_DEFAULT

        private static final boolean TRACK_LIMITED_DEFAULT
        See Also:
        Constant Field Values
      • start_time

        private static final long start_time
      • DL_DERIVED_METRIC_KEY

        private static final java.lang.Object DL_DERIVED_METRIC_KEY
      • DIRECT_INJECT_PEER_MAX

        private static final int DIRECT_INJECT_PEER_MAX
        See Also:
        Constant Field Values
      • DEFAULT_URL

        private static java.net.URL DEFAULT_URL
      • interesting_downloads

        private java.util.Map<Download,​java.lang.Long> interesting_downloads
      • interesting_published

        private int interesting_published
      • interesting_pub_max

        private int interesting_pub_max
      • running_downloads

        private java.util.Map<Download,​int[]> running_downloads
      • run_data_cache

        private java.util.Map<Download,​int[]> run_data_cache
      • limited_online_tracking

        private java.util.Map<Download,​java.lang.Boolean> limited_online_tracking
      • query_map

        private java.util.Map<Download,​java.lang.Long> query_map
      • in_progress

        private java.util.Map<Download,​java.lang.Integer> in_progress
      • track_only_decentralsed

        private boolean track_only_decentralsed
      • current_announce_interval

        private long current_announce_interval
      • scrape_injection_map

        private java.util.Map<Download,​int[]> scrape_injection_map
      • random

        private java.util.Random random
      • is_running

        private boolean is_running
      • disable_put

        private boolean disable_put
    • Constructor Detail

      • DHTTrackerPlugin

        public DHTTrackerPlugin()
    • Method Detail

      • initialize

        public void initialize​(PluginInterface _plugin_interface)
        Description copied from interface: Plugin
        This method is called when the Plugin is loaded by the client
        Specified by:
        initialize in interface Plugin
        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

        public void addDownload​(Download download)
      • removeDownload

        public void removeDownload​(Download download)
      • checkDownloadForRegistration

        protected void checkDownloadForRegistration​(Download download,
                                                    boolean first_time)
      • processRegistrations

        protected void processRegistrations​(boolean full_processing)
      • getDerivedTrackMetric

        protected long getDerivedTrackMetric​(Download download)
      • isComplete

        protected boolean isComplete​(Download download)
      • processNonRegistrations

        protected void processNonRegistrations()
      • stateChanged

        public void stateChanged​(Download download,
                                 int old_state,
                                 int new_state)
        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 interface DownloadListener
      • announceAll

        public void announceAll()
      • announce

        private void announce​(Download download)
      • positionChanged

        public void positionChanged​(Download download,
                                    int oldPosition,
                                    int newPosition)
        Description copied from interface: DownloadListener
        Position of download has changed.
        Specified by:
        positionChanged in interface DownloadListener
        Parameters:
        download - object in which the position has changed
        oldPosition - position that the download used to be at
        newPosition - position that the download is now at
      • configChanged

        protected void configChanged()
      • scrape

        public DownloadScrapeResult scrape​(byte[] hash)
        This is used by the dhtscraper plugin
      • increaseActive

        protected void increaseActive​(Download dl)
      • decreaseActive

        protected void decreaseActive​(Download dl)
      • isActive

        protected boolean isActive​(Download dl)
      • log

        private void log​(Download download,
                         java.lang.String str)