Package com.biglybt.plugin.dht.impl
Class DHTPluginImpl
java.lang.Object
com.biglybt.plugin.dht.impl.DHTPluginImpl
- All Implemented Interfaces:
DHTPluginBasicInterface
,DHTPluginInterface.DHTInterface
public class DHTPluginImpl
extends Object
implements DHTPluginInterface.DHTInterface, DHTPluginBasicInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DHT
private DHTLogger
private final DHTPlugin
private long
private LoggerChannel
private static final long
private int
private final PluginInterface
private int
private byte
private ActionParameter
private static final String
private static final String
private static final int
private int
private int
private String
private DHTPluginStorageManager
private DHTTransportUDP
private boolean
private BooleanParameter
-
Constructor Summary
ConstructorsConstructorDescriptionDHTPluginImpl
(DHTPlugin _dht_plugin, PluginInterface _plugin_interface, DHTNATPuncherAdapter _nat_adapter, DHTPluginImplAdapter _adapter, byte _protocol_version, int _network, boolean _v6, String _ip, int _port, ActionParameter _reseed, BooleanParameter _warn_user_param, boolean _logging, LoggerChannel _log, DHTLogger _dht_log) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
call
(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] data, long timeout) void
checkForReSeed
(boolean force) private InetSocketAddress
void
decodeStats
(DHTPluginValue value) void
get
(byte[] key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener listener) long
getClosestContacts
(byte[] to_id, boolean live_only) protected File
getDataDir
(int network) getDHT()
byte[]
getID()
getLocalValue
(byte[] key) int
int
getPort()
protected InetSocketAddress
int
getValues
(byte[] key) importContact
(InetSocketAddress address) importContact
(InetSocketAddress address, byte version) importContact
(Map<String, Object> map) protected DHTTransportContact
importSeed
(String ip, int port) protected DHTTransportContact
importSeed
(InetAddress ia, int port) protected DHTTransportContact
void
integrateDHT
(boolean first, DHTTransportContact remove_afterwards) boolean
isDiversified
(byte[] key) boolean
boolean
boolean
isIPV6()
boolean
boolean
isRecentAddress
(String address) boolean
void
logStats()
protected DHTPluginValue
mapValue
(DHTTransportValue value) 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
putEx
(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) byte[]
read
(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] key, long timeout) void
registerHandler
(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) void
remove
(byte[] key, String description, short flags, DHTPluginOperationListener listener) void
remove
(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) void
setLogging
(boolean l) void
setPort
(int new_port) void
setSuspended
(boolean susp) void
tick()
void
unregisterHandler
(byte[] handler_key, DHTPluginTransferHandler handler) void
updateStats
(int sample_stats_ticks) void
write
(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] key, byte[] data, long timeout) 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.DHTPluginBasicInterface
put
-
Field Details
-
SEED_ADDRESS_V4
- See Also:
-
SEED_ADDRESS_V6
- See Also:
-
SEED_PORT
private static final int SEED_PORT- See Also:
-
MIN_ROOT_SEED_IMPORT_PERIOD
private static final long MIN_ROOT_SEED_IMPORT_PERIOD- See Also:
-
dht_plugin
-
plugin_interface
-
status
private int status -
status_text
-
reseed_param
-
warn_user_param
-
dht
-
port
private int port -
protocol_version
private byte protocol_version -
network
private int network -
v6
private boolean v6 -
transport
-
storage_manager
-
last_root_seed_import_time
private long last_root_seed_import_time -
log
-
dht_log
-
stats_ticks
private int stats_ticks -
handler_map
-
-
Constructor Details
-
DHTPluginImpl
public DHTPluginImpl(DHTPlugin _dht_plugin, PluginInterface _plugin_interface, DHTNATPuncherAdapter _nat_adapter, DHTPluginImplAdapter _adapter, byte _protocol_version, int _network, boolean _v6, String _ip, int _port, ActionParameter _reseed, BooleanParameter _warn_user_param, boolean _logging, LoggerChannel _log, DHTLogger _dht_log)
-
-
Method Details
-
getAENetwork
- Specified by:
getAENetwork
in interfaceDHTPluginBasicInterface
-
getDHTInterfaces
- Specified by:
getDHTInterfaces
in interfaceDHTPluginBasicInterface
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceDHTPluginBasicInterface
-
isInitialising
public boolean isInitialising()- Specified by:
isInitialising
in interfaceDHTPluginBasicInterface
-
isSleeping
public boolean isSleeping()- Specified by:
isSleeping
in interfaceDHTPluginBasicInterface
-
updateStats
public void updateStats(int sample_stats_ticks) -
getStatus
public int getStatus() -
getStatusText
-
isReachable
public boolean isReachable() -
setLogging
public void setLogging(boolean l) -
tick
public void tick() -
getPort
public int getPort() -
setPort
public void setPort(int new_port) -
getClockSkew
public long getClockSkew() -
logStats
public void logStats() -
getDataDir
-
integrateDHT
-
checkForReSeed
public void checkForReSeed(boolean force) -
importRootSeed
-
importSeed
-
importSeed
-
importSeed
-
getSeedAddress
-
checkResolve
-
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) -
putEx
public void putEx(byte[] key, String description, byte[] value, short flags, boolean high_priority, DHTPluginOperationListener listener) -
getLocalValue
-
getValues
- Specified by:
getValues
in interfaceDHTPluginBasicInterface
-
getValues
-
get
public void get(byte[] key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener listener) - Specified by:
get
in interfaceDHTPluginBasicInterface
-
remove
public void remove(byte[] key, String description, short flags, DHTPluginOperationListener listener) -
remove
public void remove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) -
getLocalAddress
-
importContact
-
importContact
-
importContact
-
registerHandler
public void registerHandler(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) -
unregisterHandler
-
read
public byte[] read(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] key, long timeout) -
write
public void write(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] key, byte[] data, long timeout) -
call
public byte[] call(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] data, long timeout) -
getDHT
-
setSuspended
public void setSuspended(boolean susp) -
closedownInitiated
public void closedownInitiated() -
isRecentAddress
-
mapValue
-
decodeStats
-
getID
public byte[] getID()- Specified by:
getID
in interfaceDHTPluginInterface.DHTInterface
-
isIPV6
public boolean isIPV6()- Specified by:
isIPV6
in interfaceDHTPluginInterface.DHTInterface
-
getNetwork
public int getNetwork()- Specified by:
getNetwork
in interfaceDHTPluginInterface.DHTInterface
-
getReachableContacts
- Specified by:
getReachableContacts
in interfaceDHTPluginInterface.DHTInterface
-
getRecentContacts
- Specified by:
getRecentContacts
in interfaceDHTPluginInterface.DHTInterface
-
getClosestContacts
- Specified by:
getClosestContacts
in interfaceDHTPluginInterface.DHTInterface
-