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 DHTprivate DHTLoggerprivate final DHTPluginprivate booleanprivate longprivate LoggerChannelprivate static final longprivate intprivate final PluginInterfaceprivate intprivate byteprivate ActionParameterprivate static final Stringprivate static final Stringprivate static final intprivate intprivate intprivate Stringprivate DHTPluginStorageManagerprivate DHTTransportUDPprivate booleanprivate 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) voidcheckForReSeed(boolean force) private InetSocketAddressvoiddecodeStats(DHTPluginValue value) voidget(byte[] key, String description, byte flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTPluginOperationListener listener) longgetClosestContacts(byte[] to_id, boolean live_only) protected FilegetDataDir(int network) getDHT()byte[]getID()getLocalValue(byte[] key) intintgetPort()protected InetSocketAddressintgetValues(byte[] key) importContact(InetSocketAddress address) importContact(InetSocketAddress address, byte version) importContact(Map<String, Object> map) protected DHTTransportContactimportSeed(String ip, int port) protected DHTTransportContactimportSeed(InetAddress ia, int port) protected DHTTransportContactvoidintegrateDHT(boolean first, DHTTransportContact remove_afterwards) booleanisDiversified(byte[] key) booleanbooleanbooleanbooleanisIPV6()booleanbooleanisRecentAddress(String address) booleanvoidlogStats()protected DHTPluginValuemapValue(DHTTransportValue value) voidput(byte[] key, String description, byte[] value, byte flags, boolean high_priority, DHTPluginOperationListener listener) voidput(byte[] key, String description, byte[] value, byte flags, DHTPluginOperationListener listener) voidputEx(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) voidregisterHandler(byte[] handler_key, DHTPluginTransferHandler handler, Map<String, Object> options) voidremove(byte[] key, String description, short flags, DHTPluginOperationListener listener) voidremove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) voidsetLogging(boolean l) voidsetPort(int new_port) voidsetSuspended(boolean susp) voidtick()voidunregisterHandler(byte[] handler_key, DHTPluginTransferHandler handler) voidupdateStats(int sample_stats_ticks) voidwrite(DHTPluginProgressListener listener, DHTPluginContact target, byte[] handler_key, byte[] key, byte[] data, long timeout) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 -
healthy
private volatile boolean healthy -
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:
getAENetworkin interfaceDHTPluginBasicInterface
-
getDHTInterfaces
- Specified by:
getDHTInterfacesin interfaceDHTPluginBasicInterface
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceDHTPluginBasicInterface
-
isInitialising
public boolean isInitialising()- Specified by:
isInitialisingin interfaceDHTPluginBasicInterface
-
isSleeping
public boolean isSleeping()- Specified by:
isSleepingin interfaceDHTPluginBasicInterface
-
isHealthy
public boolean isHealthy() -
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:
putin 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:
getValuesin 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:
getin 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:
getIDin interfaceDHTPluginInterface.DHTInterface
-
isIPV6
public boolean isIPV6()- Specified by:
isIPV6in interfaceDHTPluginInterface.DHTInterface
-
getNetwork
public int getNetwork()- Specified by:
getNetworkin interfaceDHTPluginInterface.DHTInterface
-
getReachableContacts
- Specified by:
getReachableContactsin interfaceDHTPluginInterface.DHTInterface
-
getRecentContacts
- Specified by:
getRecentContactsin interfaceDHTPluginInterface.DHTInterface
-
getClosestContacts
- Specified by:
getClosestContactsin interfaceDHTPluginInterface.DHTInterface
-