org.gudy.azureus2.plugins.clientid
Interface ClientIDGenerator


public interface ClientIDGenerator

Author:
parg

Field Summary
static java.lang.String PR_CLIENT_NAME
           
static java.lang.String PR_MESSAGING_MODE
           
static java.lang.String PR_PROXY
           
static java.lang.String PR_RAW_REQUEST
           
static java.lang.String PR_SNI_HACK
           
static java.lang.String PR_URL
           
static java.lang.String PR_USER_AGENT
           
 
Method Summary
 java.lang.String[] filterHTTP(byte[] hash, java.lang.String[] lines_in)
          For more complex situations a filter approach is used.
 void generateHTTPProperties(byte[] hash, java.util.Properties properties)
          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
 byte[] generatePeerID(byte[] hash, boolean for_tracker)
          generate a peer id - must be exactly 20 bytes
 java.lang.Object getProperty(byte[] hash, java.lang.String property_name)
           
 

Field Detail

PR_URL

static final java.lang.String PR_URL
See Also:
Constant Field Values

PR_PROXY

static final java.lang.String PR_PROXY
See Also:
Constant Field Values

PR_RAW_REQUEST

static final java.lang.String PR_RAW_REQUEST
See Also:
Constant Field Values

PR_USER_AGENT

static final java.lang.String PR_USER_AGENT
See Also:
Constant Field Values

PR_SNI_HACK

static final java.lang.String PR_SNI_HACK
See Also:
Constant Field Values

PR_CLIENT_NAME

static final java.lang.String PR_CLIENT_NAME
See Also:
Constant Field Values

PR_MESSAGING_MODE

static final java.lang.String PR_MESSAGING_MODE
See Also:
Constant Field Values
Method Detail

generatePeerID

byte[] generatePeerID(byte[] hash,
                      boolean for_tracker)
                      throws ClientIDException
generate a peer id - must be exactly 20 bytes

Parameters:
torrent -
for_tracker - generator to give to tracker or for peer-peer comms
Returns:
Throws:
ClientIDException

generateHTTPProperties

void generateHTTPProperties(byte[] hash,
                            java.util.Properties properties)
                            throws ClientIDException
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

Parameters:
torrent -
properties -
Throws:
ClientIDException

filterHTTP

java.lang.String[] filterHTTP(byte[] hash,
                              java.lang.String[] lines_in)
                              throws ClientIDException
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

Parameters:
lines_in -
Returns:
Throws:
ClientIDException

getProperty

java.lang.Object getProperty(byte[] hash,
                             java.lang.String property_name)