Class ClientIDPlugin
- java.lang.Object
-
- com.biglybt.pifimpl.local.clientid.ClientIDPlugin
-
- All Implemented Interfaces:
ClientIDGenerator
,Plugin
public class ClientIDPlugin extends java.lang.Object implements Plugin, ClientIDGenerator
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
BIGLY_NAME
private static java.lang.String
BIGLY_VERSION
private static java.lang.String
BIGLYBT_CLIENT_NAME
private static java.lang.String
BIGLYBT_CLIENT_NAME_SM
private Core
core
private static boolean
send_os
-
Fields inherited from interface com.biglybt.pif.clientid.ClientIDGenerator
PR_CLIENT_NAME, PR_MESSAGING_MODE, PR_PROXY, PR_RAW_REQUEST, PR_SNI_HACK, PR_URL, PR_USER_AGENT
-
-
Constructor Summary
Constructors Constructor Description ClientIDPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doHTTPProperties(java.util.Properties properties)
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 filterbyte[]
generatePeerID(byte[] hash, boolean for_tracker)
generate a peer id - must be exactly 20 bytesjava.util.Properties
getInitialProperties()
java.lang.Object
getProperty(byte[] hash, java.lang.String property_name)
void
initialize(Core _core)
void
initialize(PluginInterface pi)
This method is called when the Plugin is loaded by the clientprivate void
initializeSupport(PluginInterface pi)
-
-
-
Field Detail
-
BIGLY_NAME
private static final java.lang.String BIGLY_NAME
- See Also:
- Constant Field Values
-
BIGLY_VERSION
private static final java.lang.String BIGLY_VERSION
- See Also:
- Constant Field Values
-
BIGLYBT_CLIENT_NAME
private static final java.lang.String BIGLYBT_CLIENT_NAME
- See Also:
- Constant Field Values
-
BIGLYBT_CLIENT_NAME_SM
private static final java.lang.String BIGLYBT_CLIENT_NAME_SM
- See Also:
- Constant Field Values
-
send_os
private static boolean send_os
-
core
private Core core
-
-
Method Detail
-
getInitialProperties
public java.util.Properties getInitialProperties()
- Specified by:
getInitialProperties
in interfacePlugin
-
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 interfaceClientIDGenerator
for_tracker
- generator to give to tracker or for peer-peer comms- Returns:
-
getProperty
public java.lang.Object getProperty(byte[] hash, java.lang.String property_name)
- Specified by:
getProperty
in interfaceClientIDGenerator
-
doHTTPProperties
protected void doHTTPProperties(java.util.Properties properties)
-
generateHTTPProperties
public void generateHTTPProperties(byte[] hash, java.util.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 interfaceClientIDGenerator
-
filterHTTP
public java.lang.String[] filterHTTP(byte[] hash, java.lang.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 interfaceClientIDGenerator
- 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 interfacePlugin
- Parameters:
pi
- the interface that the plugin must use to communicate with the client
-
initializeSupport
private void initializeSupport(PluginInterface pi)
-
-