Class ClientIDPlugin

java.lang.Object
com.biglybt.pifimpl.local.clientid.ClientIDPlugin
All Implemented Interfaces:
ClientIDGenerator, Plugin

public class ClientIDPlugin extends Object implements Plugin, ClientIDGenerator
  • Field Details

  • Constructor Details

    • ClientIDPlugin

      public ClientIDPlugin()
  • Method Details

    • getInitialProperties

      public Properties getInitialProperties()
      Specified by:
      getInitialProperties in interface Plugin
    • initialize

      public void initialize(Core _core)
    • generatePeerID

      public byte[] generatePeerID(byte[] hash, boolean for_tracker)
      Description copied from interface: ClientIDGenerator
      generate a peer id - must be exactly 20 bytes
      Specified by:
      generatePeerID in interface ClientIDGenerator
      for_tracker - generator to give to tracker or for peer-peer comms
      Returns:
    • getProperty

      public Object getProperty(byte[] hash, String property_name)
      Specified by:
      getProperty in interface ClientIDGenerator
    • doHTTPProperties

      protected void doHTTPProperties(Properties properties)
    • generateHTTPProperties

      public void generateHTTPProperties(byte[] hash, Properties properties)
      Description copied from interface: ClientIDGenerator
      generate appropriate properties to be supplied to HTTP(S) URL connection If you want to access the torrents then you need to decode the URL to extract the hashes and then look them up (for scrape there could be multiple torrents) Enabled when the generator isn't specified as a filter
      Specified by:
      generateHTTPProperties in interface ClientIDGenerator
    • filterHTTP

      public String[] filterHTTP(byte[] hash, String[] lines_in)
      Description copied from interface: ClientIDGenerator
      For more complex situations a filter approach is used. The lines of the request are passed in for modification and return Enabled when the generator is specified as a filter
      Specified by:
      filterHTTP in interface ClientIDGenerator
      Returns:
    • initialize

      public void initialize(PluginInterface pi)
      Description copied from interface: Plugin
      This method is called when the Plugin is loaded by the client
      Specified by:
      initialize in interface Plugin
      Parameters:
      pi - the interface that the plugin must use to communicate with the client
    • initializeSupport

      private void initializeSupport(PluginInterface pi)