Class DHTPlugin
java.lang.Object
com.biglybt.plugin.dht.DHTPlugin
- All Implemented Interfaces:
Plugin, DHTPluginBasicInterface, DHTPluginInterface
-
Nested Class Summary
Nested classes/interfaces inherited from interface DHTPluginInterface
DHTPluginInterface.DHTInterface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate static final booleanprivate static final booleanprivate DHTPluginImplprivate static final booleanprivate DHTPluginImplprivate intprivate DHTLoggerprivate DHTPluginImpl[]static final bytestatic final bytestatic final byteprivate booleanstatic final intprivate booleanstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byteprivate booleanprivate AESemaphoreprivate boolean[]private Listprivate LoggerChannelprivate DHTPluginImplprivate DHTPluginImplstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intDeprecated.Use NW_AZ_MAINprivate static final Stringprivate PluginInterfaceprivate static final Stringprivate static final Stringprivate static final Stringprivate AEMonitorprivate intprivate booleanprivate BooleanParameterprivate ActionParameterprivate longprivate intstatic final intstatic final intstatic final intstatic final intprivate BooleanParameterprivate UPnPMappingprivate BooleanParameterFields inherited from interface DHTPluginInterface
FLAG_BRIDGED, FLAG_PUT_AND_FORGET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidchangePort(int _new_port) decodeStats(DHTPluginValue value) voidget(byte[] original_key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener original_listener) longgetDHT(int network) getDHTPlugin(int network) DHT[]getDHTs()private DHTPluginImpl[]getLocalValue(byte[] key) intgetValues(byte[] key) getValues(int network) booleanhasLocalKey(byte[] hash) importContact(InetSocketAddress address) importContact(InetSocketAddress address, byte version) importContact(InetSocketAddress address, byte version, boolean is_cvs) importContact(InetSocketAddress address, byte version, int preferred_net) importContact(Map<String, Object> map) protected voidinitComplete(UITextField status_area, boolean logging, String override_ip) voidinitialize(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientbooleanisDiversified(byte[] key) booleanbooleanbooleanbooleanbooleanbooleanstatic voidload(PluginInterface plugin_interface) protected longvoidbooleanvoidput(byte[] key, String description, byte[] value, byte flags, boolean high_priority, DHTPluginOperationListener listener) voidput(byte[] key, String description, byte[] value, byte flags, DHTPluginOperationListener listener) voidput(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) voidregisterHandler(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) voidremove(byte[] key, String description, short flags, DHTPluginOperationListener listener) voidremove(byte[] key, String description, DHTPluginOperationListener listener) voidremove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) voidprotected voidprotected voidbooleansetSuspended(boolean susp) voidunregisterHandler(byte[] handler_key, DHTPluginTransferHandler handler) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DHTPluginInterface
getAENetworkMethods inherited from interface Plugin
getInitialProperties
-
Field Details
-
EVENT_DHT_AVAILABLE
public static final int EVENT_DHT_AVAILABLE- See Also:
-
STATUS_DISABLED
public static final int STATUS_DISABLED- See Also:
-
STATUS_INITALISING
public static final int STATUS_INITALISING- See Also:
-
STATUS_RUNNING
public static final int STATUS_RUNNING- See Also:
-
STATUS_FAILED
public static final int STATUS_FAILED- See Also:
-
FLAG_SINGLE_VALUE
public static final byte FLAG_SINGLE_VALUE- See Also:
-
FLAG_DOWNLOADING
public static final byte FLAG_DOWNLOADING- See Also:
-
FLAG_SEEDING
public static final byte FLAG_SEEDING- See Also:
-
FLAG_MULTI_VALUE
public static final byte FLAG_MULTI_VALUE- See Also:
-
FLAG_STATS
public static final byte FLAG_STATS- See Also:
-
FLAG_ANON
public static final byte FLAG_ANON- See Also:
-
FLAG_PRECIOUS
public static final byte FLAG_PRECIOUS- See Also:
-
DT_NONE
public static final byte DT_NONE- See Also:
-
DT_FREQUENCY
public static final byte DT_FREQUENCY- See Also:
-
DT_SIZE
public static final byte DT_SIZE- See Also:
-
NW_MAIN
public static final int NW_MAINDeprecated.Use NW_AZ_MAIN- See Also:
-
NW_AZ_MAIN
public static final int NW_AZ_MAIN- See Also:
-
NW_AZ_MAIN_V6
public static final int NW_AZ_MAIN_V6- See Also:
-
NW_AZ_CVS
public static final int NW_AZ_CVS- See Also:
-
NW_BIGLYBT_MAIN
public static final int NW_BIGLYBT_MAIN- See Also:
-
MAX_VALUE_SIZE
public static final int MAX_VALUE_SIZE- See Also:
-
PLUGIN_VERSION
- See Also:
-
PLUGIN_NAME
- See Also:
-
PLUGIN_CONFIGSECTION_ID
- See Also:
-
PLUGIN_RESOURCE_ID
- See Also:
-
AZ_MAIN_DHT_ENABLE
private static final boolean AZ_MAIN_DHT_ENABLE -
AZ_CVS_DHT_ENABLE
private static final boolean AZ_CVS_DHT_ENABLE -
AZ_MAIN_DHT_V6_ENABLE
private static final boolean AZ_MAIN_DHT_V6_ENABLE -
BIGLYBT_MAIN_DHT_ENABLE
private static final boolean BIGLYBT_MAIN_DHT_ENABLE -
plugin_interface
-
status
private int status -
dhts
-
main_dht
-
cvs_dht
-
main_v6_dht
-
biglybt_dht
-
reseed
-
enabled
private boolean enabled -
dht_data_port
private int dht_data_port -
got_extended_use
private boolean got_extended_use -
extended_use
private boolean extended_use -
init_sem
-
port_change_mon
-
port_changing
private boolean port_changing -
port_change_outstanding
private int port_change_outstanding -
ipfilter_logging
private boolean[] ipfilter_logging -
warn_user
-
prefer_i2p
-
torrent_xfer
-
upnp_mapping
-
log
-
dht_log
-
listeners
-
start_mono_time
private long start_mono_time
-
-
Constructor Details
-
DHTPlugin
public DHTPlugin()
-
-
Method Details
-
load
-
initialize
Description copied from interface:PluginThis method is called when the Plugin is loaded by the client- Specified by:
initializein interfacePlugin- Parameters:
_plugin_interface- the interface that the plugin must use to communicate with the client
-
getConnectionOrientedEndpoint
- Specified by:
getConnectionOrientedEndpointin interfaceDHTPluginInterface
-
getConnectionOrientedEndpoints
- Specified by:
getConnectionOrientedEndpointsin interfaceDHTPluginInterface
-
changePort
protected void changePort(int _new_port) -
initComplete
-
setPluginInfo
protected void setPluginInfo() -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceDHTPluginBasicInterface
-
peekEnabled
public boolean peekEnabled() -
isInitialising
public boolean isInitialising()- Specified by:
isInitialisingin interfaceDHTPluginBasicInterface
-
setSuspended
public boolean setSuspended(boolean susp) -
isExtendedUseAllowed
public boolean isExtendedUseAllowed()- Specified by:
isExtendedUseAllowedin interfaceDHTPluginInterface
-
getNetwork
- Specified by:
getNetworkin interfaceDHTPluginInterface
-
isReachable
public boolean isReachable() -
isDiversified
public boolean isDiversified(byte[] key) -
put
public void put(byte[] key, String description, byte[] value, byte flags, DHTPluginOperationListener listener) - Specified by:
putin interfaceDHTPluginBasicInterface
-
put
public void put(byte[] key, String description, byte[] value, byte flags, boolean high_priority, DHTPluginOperationListener listener) -
getDHTsToUse
-
put
public void put(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) - Specified by:
putin interfaceDHTPluginBasicInterface
-
getLocalValue
-
getValues
- Specified by:
getValuesin interfaceDHTPluginBasicInterface
-
getValues
- Specified by:
getValuesin interfaceDHTPluginInterface
-
getValues
-
get
public void get(byte[] original_key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener original_listener) - Specified by:
getin interfaceDHTPluginBasicInterface
-
hasLocalKey
public boolean hasLocalKey(byte[] hash) -
remove
- Specified by:
removein interfaceDHTPluginInterface
-
remove
public void remove(byte[] key, String description, short flags, DHTPluginOperationListener listener) - Specified by:
removein interfaceDHTPluginInterface
-
remove
public void remove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) - Specified by:
removein interfaceDHTPluginInterface
-
importContact
- Specified by:
importContactin interfaceDHTPluginInterface
-
importContact
- Specified by:
importContactin interfaceDHTPluginInterface
-
importContact
- Specified by:
importContactin interfaceDHTPluginInterface
-
importContact
- Specified by:
importContactin interfaceDHTPluginInterface
-
importContact
- Specified by:
importContactin interfaceDHTPluginInterface
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceDHTPluginInterface
-
getLocalAddresses
- Specified by:
getLocalAddressesin interfaceDHTPluginInterface
-
registerHandler
public void registerHandler(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) - Specified by:
registerHandlerin interfaceDHTPluginInterface
-
unregisterHandler
- Specified by:
unregisterHandlerin interfaceDHTPluginInterface
-
getStatus
public int getStatus() -
isSleeping
public boolean isSleeping()- Specified by:
isSleepingin interfaceDHTPluginBasicInterface
-
isTorrentXferEnabled
public boolean isTorrentXferEnabled() -
getDHTs
-
getDHT
-
getDHTPlugin
-
getDHTInterfaces
- Specified by:
getDHTInterfacesin interfaceDHTPluginBasicInterface
-
loadClockSkew
protected long loadClockSkew() -
saveClockSkew
protected void saveClockSkew() -
getClockSkew
public long getClockSkew() -
decodeStats
- Specified by:
decodeStatsin interfaceDHTPluginInterface
-
addListener
- Specified by:
addListenerin interfaceDHTPluginInterface
-
removeListener
- Specified by:
removeListenerin interfaceDHTPluginInterface
-
log
- Specified by:
login interfaceDHTPluginInterface
-