Package com.biglybt.core.dht
Interface DHT
-
- All Known Implementing Classes:
DHTImpl
public interface DHT
-
-
Field Summary
Fields Modifier and Type Field Description static byte
DT_FREQUENCY
static byte
DT_NONE
static byte
DT_SIZE
static java.lang.String[]
DT_STRINGS
static short
FLAG_ANON
static short
FLAG_BRIDGED
static short
FLAG_DOWNLOADING
static short
FLAG_HIGH_PRIORITY
static short
FLAG_LOOKUP_FOR_STORE
static short
FLAG_MULTI_VALUE
static short
FLAG_NONE
static short
FLAG_OBFUSCATE_LOOKUP
static short
FLAG_PRECIOUS
static short
FLAG_PUT_AND_FORGET
static short
FLAG_SEEDING
static short
FLAG_SINGLE_VALUE
static short
FLAG_STATS
static int
MAX_VALUE_SIZE
static int
NW_AZ_CVS
static int
NW_AZ_MAIN
static int
NW_AZ_MAIN_V6
static int
NW_BIGLYBT_MAIN
static int
NW_MAIN
Deprecated.Use NW_AZ_MAINstatic java.lang.String
PR_CACHE_AT_CLOSEST_N
static java.lang.String
PR_CACHE_REPUBLISH_INTERVAL
static java.lang.String
PR_CONTACTS_PER_NODE
static java.lang.String
PR_ENABLE_RANDOM_LOOKUP
static java.lang.String
PR_ENCODE_KEYS
static java.lang.String
PR_LOOKUP_CONCURRENCY
static java.lang.String
PR_MAX_REPLACEMENTS_PER_NODE
static java.lang.String
PR_NODE_SPLIT_FACTOR
static java.lang.String
PR_ORIGINAL_REPUBLISH_INTERVAL
static java.lang.String
PR_SEARCH_CONCURRENCY
static byte
REP_FACT_DEFAULT
static byte
REP_FACT_NONE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(DHTListener listener)
void
destroy()
void
exportState(java.io.DataOutputStream os, int max)
externalises information that allows the DHT to be recreated at a later date and populated via the import methodvoid
get(byte[] key, java.lang.String description, short flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTOperationListener listener)
DHTControl
getControl()
DHTDB
getDataBase()
int
getIntProperty(java.lang.String name)
DHTTransportValue
getLocalValue(byte[] key)
Returns value if originated from here for keyDHTLogger
getLogger()
DHTNATPuncher
getNATPuncher()
DHTRouter
getRouter()
DHTStorageAdapter
getStorageAdapter()
java.util.List<DHTTransportValue>
getStoredValues(byte[] key)
DHTTransport
getTransport()
void
importState(java.io.DataInputStream is)
populate the DHT with previously exported statevoid
integrate(boolean full_wait)
Integrate the node into the DHT Can be invoked more than once if additional state is importedboolean
isDiversified(byte[] key)
boolean
isSleeping()
void
print(boolean full)
void
put(byte[] key, java.lang.String description, byte[] value, short flags, boolean high_priority, DHTOperationListener listener)
default is HIGH PRIORITY.void
put(byte[] key, java.lang.String description, byte[] value, short flags, byte life_hours, boolean high_priority, DHTOperationListener listener)
void
put(byte[] key, java.lang.String description, byte[] value, short flags, byte life_hours, byte replication_control, boolean high_priority, DHTOperationListener listener)
void
put(byte[] key, java.lang.String description, byte[] value, short flags, DHTOperationListener listener)
byte[]
remove(byte[] key, java.lang.String description, DHTOperationListener listener)
byte[]
remove(DHTTransportContact[] contacts, byte[] key, java.lang.String description, DHTOperationListener listener)
void
removeListener(DHTListener listener)
void
setLogging(boolean on)
void
setSuspended(boolean susp)
-
-
-
Field Detail
-
PR_CONTACTS_PER_NODE
static final java.lang.String PR_CONTACTS_PER_NODE
- See Also:
- Constant Field Values
-
PR_NODE_SPLIT_FACTOR
static final java.lang.String PR_NODE_SPLIT_FACTOR
- See Also:
- Constant Field Values
-
PR_SEARCH_CONCURRENCY
static final java.lang.String PR_SEARCH_CONCURRENCY
- See Also:
- Constant Field Values
-
PR_LOOKUP_CONCURRENCY
static final java.lang.String PR_LOOKUP_CONCURRENCY
- See Also:
- Constant Field Values
-
PR_MAX_REPLACEMENTS_PER_NODE
static final java.lang.String PR_MAX_REPLACEMENTS_PER_NODE
- See Also:
- Constant Field Values
-
PR_CACHE_AT_CLOSEST_N
static final java.lang.String PR_CACHE_AT_CLOSEST_N
- See Also:
- Constant Field Values
-
PR_ORIGINAL_REPUBLISH_INTERVAL
static final java.lang.String PR_ORIGINAL_REPUBLISH_INTERVAL
- See Also:
- Constant Field Values
-
PR_CACHE_REPUBLISH_INTERVAL
static final java.lang.String PR_CACHE_REPUBLISH_INTERVAL
- See Also:
- Constant Field Values
-
PR_ENCODE_KEYS
static final java.lang.String PR_ENCODE_KEYS
- See Also:
- Constant Field Values
-
PR_ENABLE_RANDOM_LOOKUP
static final java.lang.String PR_ENABLE_RANDOM_LOOKUP
- See Also:
- Constant Field Values
-
FLAG_NONE
static final short FLAG_NONE
- See Also:
- Constant Field Values
-
FLAG_SINGLE_VALUE
static final short FLAG_SINGLE_VALUE
- See Also:
- Constant Field Values
-
FLAG_DOWNLOADING
static final short FLAG_DOWNLOADING
- See Also:
- Constant Field Values
-
FLAG_SEEDING
static final short FLAG_SEEDING
- See Also:
- Constant Field Values
-
FLAG_MULTI_VALUE
static final short FLAG_MULTI_VALUE
- See Also:
- Constant Field Values
-
FLAG_STATS
static final short FLAG_STATS
- See Also:
- Constant Field Values
-
FLAG_ANON
static final short FLAG_ANON
- See Also:
- Constant Field Values
-
FLAG_PRECIOUS
static final short FLAG_PRECIOUS
- See Also:
- Constant Field Values
-
FLAG_BRIDGED
static final short FLAG_BRIDGED
- See Also:
- Constant Field Values
-
FLAG_PUT_AND_FORGET
static final short FLAG_PUT_AND_FORGET
- See Also:
- Constant Field Values
-
FLAG_OBFUSCATE_LOOKUP
static final short FLAG_OBFUSCATE_LOOKUP
- See Also:
- Constant Field Values
-
FLAG_LOOKUP_FOR_STORE
static final short FLAG_LOOKUP_FOR_STORE
- See Also:
- Constant Field Values
-
FLAG_HIGH_PRIORITY
static final short FLAG_HIGH_PRIORITY
- See Also:
- Constant Field Values
-
MAX_VALUE_SIZE
static final int MAX_VALUE_SIZE
- See Also:
- Constant Field Values
-
REP_FACT_NONE
static final byte REP_FACT_NONE
- See Also:
- Constant Field Values
-
REP_FACT_DEFAULT
static final byte REP_FACT_DEFAULT
- See Also:
- Constant Field Values
-
DT_NONE
static final byte DT_NONE
- See Also:
- Constant Field Values
-
DT_FREQUENCY
static final byte DT_FREQUENCY
- See Also:
- Constant Field Values
-
DT_SIZE
static final byte DT_SIZE
- See Also:
- Constant Field Values
-
DT_STRINGS
static final java.lang.String[] DT_STRINGS
-
NW_MAIN
static final int NW_MAIN
Deprecated.Use NW_AZ_MAIN- See Also:
- Constant Field Values
-
NW_AZ_MAIN
static final int NW_AZ_MAIN
- See Also:
- Constant Field Values
-
NW_AZ_CVS
static final int NW_AZ_CVS
- See Also:
- Constant Field Values
-
NW_AZ_MAIN_V6
static final int NW_AZ_MAIN_V6
- See Also:
- Constant Field Values
-
NW_BIGLYBT_MAIN
static final int NW_BIGLYBT_MAIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
put
void put(byte[] key, java.lang.String description, byte[] value, short flags, DHTOperationListener listener)
-
put
void put(byte[] key, java.lang.String description, byte[] value, short flags, boolean high_priority, DHTOperationListener listener)
default is HIGH PRIORITY. if you change to low priority then do so consistently as operations can get out of order otherwise- Parameters:
key
-description
-value
-flags
-high_priority
-listener
-
-
put
void put(byte[] key, java.lang.String description, byte[] value, short flags, byte life_hours, boolean high_priority, DHTOperationListener listener)
-
put
void put(byte[] key, java.lang.String description, byte[] value, short flags, byte life_hours, byte replication_control, boolean high_priority, DHTOperationListener listener)
-
getLocalValue
DHTTransportValue getLocalValue(byte[] key)
Returns value if originated from here for key- Parameters:
key
-- Returns:
-
getStoredValues
java.util.List<DHTTransportValue> getStoredValues(byte[] key)
-
get
void get(byte[] key, java.lang.String description, short flags, int max_values, long timeout, boolean exhaustive, boolean high_priority, DHTOperationListener listener)
- Parameters:
key
-max_values
-timeout
-listener
-
-
remove
byte[] remove(byte[] key, java.lang.String description, DHTOperationListener listener)
-
remove
byte[] remove(DHTTransportContact[] contacts, byte[] key, java.lang.String description, DHTOperationListener listener)
-
isDiversified
boolean isDiversified(byte[] key)
-
getIntProperty
int getIntProperty(java.lang.String name)
-
getTransport
DHTTransport getTransport()
-
getRouter
DHTRouter getRouter()
-
getControl
DHTControl getControl()
-
getDataBase
DHTDB getDataBase()
-
getNATPuncher
DHTNATPuncher getNATPuncher()
-
getStorageAdapter
DHTStorageAdapter getStorageAdapter()
-
exportState
void exportState(java.io.DataOutputStream os, int max) throws java.io.IOException
externalises information that allows the DHT to be recreated at a later date and populated via the import method- Parameters:
os
-max
- maximum to export, 0 -> all- Throws:
java.io.IOException
-
importState
void importState(java.io.DataInputStream is) throws java.io.IOException
populate the DHT with previously exported state- Parameters:
is
-- Throws:
java.io.IOException
-
integrate
void integrate(boolean full_wait)
Integrate the node into the DHT Can be invoked more than once if additional state is imported
-
setSuspended
void setSuspended(boolean susp)
-
destroy
void destroy()
-
isSleeping
boolean isSleeping()
-
setLogging
void setLogging(boolean on)
-
getLogger
DHTLogger getLogger()
-
print
void print(boolean full)
-
addListener
void addListener(DHTListener listener)
-
removeListener
void removeListener(DHTListener listener)
-
-