Package com.biglybt.plugin.dht
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 com.biglybt.plugin.dht.DHTPluginInterface
DHTPluginInterface.DHTInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
private static final boolean
private static final boolean
private DHTPluginImpl
private static final boolean
private DHTPluginImpl
private int
private DHTLogger
private DHTPluginImpl[]
static final byte
static final byte
static final byte
private boolean
static final int
private boolean
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
private boolean
private AESemaphore
private boolean[]
private List
private LoggerChannel
private DHTPluginImpl
private DHTPluginImpl
static final int
static final int
static final int
static final int
static final int
static final int
Deprecated.Use NW_AZ_MAINprivate static final String
private PluginInterface
private static final String
private static final String
private static final String
private AEMonitor
private int
private boolean
private BooleanParameter
private ActionParameter
private long
private int
static final int
static final int
static final int
static final int
private BooleanParameter
private UPnPMapping
private BooleanParameter
Fields inherited from interface com.biglybt.plugin.dht.DHTPluginInterface
FLAG_BRIDGED, FLAG_PUT_AND_FORGET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
changePort
(int _new_port) decodeStats
(DHTPluginValue value) void
get
(byte[] original_key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener original_listener) long
getDHT
(int network) getDHTPlugin
(int network) DHT[]
getDHTs()
getLocalValue
(byte[] key) int
getValues
(byte[] key) getValues
(int network) boolean
hasLocalKey
(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 void
initComplete
(UITextField status_area, boolean logging, String override_ip) void
initialize
(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientboolean
isDiversified
(byte[] key) boolean
boolean
boolean
boolean
boolean
boolean
static void
load
(PluginInterface plugin_interface) protected long
void
boolean
void
put
(byte[] key, String description, byte[] value, byte flags, boolean high_priority, DHTPluginOperationListener listener) void
put
(byte[] key, String description, byte[] value, byte flags, DHTPluginOperationListener listener) void
put
(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) void
registerHandler
(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) void
remove
(byte[] key, String description, short flags, DHTPluginOperationListener listener) void
remove
(byte[] key, String description, DHTPluginOperationListener listener) void
remove
(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) void
protected void
protected void
boolean
setSuspended
(boolean susp) void
unregisterHandler
(byte[] handler_key, DHTPluginTransferHandler handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.plugin.dht.DHTPluginInterface
getAENetwork
Methods inherited from interface com.biglybt.pif.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:Plugin
This method is called when the Plugin is loaded by the client- Specified by:
initialize
in interfacePlugin
- Parameters:
_plugin_interface
- the interface that the plugin must use to communicate with the client
-
getConnectionOrientedEndpoint
- Specified by:
getConnectionOrientedEndpoint
in interfaceDHTPluginInterface
-
getConnectionOrientedEndpoints
- Specified by:
getConnectionOrientedEndpoints
in interfaceDHTPluginInterface
-
changePort
protected void changePort(int _new_port) -
initComplete
-
setPluginInfo
protected void setPluginInfo() -
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceDHTPluginBasicInterface
-
peekEnabled
public boolean peekEnabled() -
isInitialising
public boolean isInitialising()- Specified by:
isInitialising
in interfaceDHTPluginBasicInterface
-
setSuspended
public boolean setSuspended(boolean susp) -
isExtendedUseAllowed
public boolean isExtendedUseAllowed()- Specified by:
isExtendedUseAllowed
in interfaceDHTPluginInterface
-
getNetwork
- Specified by:
getNetwork
in 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:
put
in interfaceDHTPluginBasicInterface
-
put
public void put(byte[] key, String description, byte[] value, byte flags, boolean high_priority, DHTPluginOperationListener listener) -
put
public void put(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) - Specified by:
put
in interfaceDHTPluginBasicInterface
-
getLocalValue
-
getValues
- Specified by:
getValues
in interfaceDHTPluginBasicInterface
-
getValues
- Specified by:
getValues
in 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:
get
in interfaceDHTPluginBasicInterface
-
hasLocalKey
public boolean hasLocalKey(byte[] hash) -
remove
- Specified by:
remove
in interfaceDHTPluginInterface
-
remove
public void remove(byte[] key, String description, short flags, DHTPluginOperationListener listener) - Specified by:
remove
in interfaceDHTPluginInterface
-
remove
public void remove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) - Specified by:
remove
in interfaceDHTPluginInterface
-
importContact
- Specified by:
importContact
in interfaceDHTPluginInterface
-
importContact
- Specified by:
importContact
in interfaceDHTPluginInterface
-
importContact
- Specified by:
importContact
in interfaceDHTPluginInterface
-
importContact
- Specified by:
importContact
in interfaceDHTPluginInterface
-
importContact
- Specified by:
importContact
in interfaceDHTPluginInterface
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceDHTPluginInterface
-
getLocalAddresses
- Specified by:
getLocalAddresses
in interfaceDHTPluginInterface
-
registerHandler
public void registerHandler(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) - Specified by:
registerHandler
in interfaceDHTPluginInterface
-
unregisterHandler
- Specified by:
unregisterHandler
in interfaceDHTPluginInterface
-
getStatus
public int getStatus() -
isSleeping
public boolean isSleeping()- Specified by:
isSleeping
in interfaceDHTPluginBasicInterface
-
isTorrentXferEnabled
public boolean isTorrentXferEnabled() -
getDHTs
-
getDHT
-
getDHTPlugin
-
getDHTInterfaces
- Specified by:
getDHTInterfaces
in interfaceDHTPluginBasicInterface
-
loadClockSkew
protected long loadClockSkew() -
saveClockSkew
protected void saveClockSkew() -
getClockSkew
public long getClockSkew() -
decodeStats
- Specified by:
decodeStats
in interfaceDHTPluginInterface
-
addListener
- Specified by:
addListener
in interfaceDHTPluginInterface
-
removeListener
- Specified by:
removeListener
in interfaceDHTPluginInterface
-
log
- Specified by:
log
in interfaceDHTPluginInterface
-