|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DHTManager
The DHT Manager interface defines methods to start, stop and perform operations related to the maintenance of the DHT (bootstrapping, etc.). It also takes care of switching between different DHT modes for a DHT node.
| Nested Class Summary | |
|---|---|
static class |
DHTManager.DHTMode
Defines the modes of a DHT Node (inactive, active, passive and passive leaf). |
| Method Summary | |
|---|---|
void |
addActiveDHTNode(SocketAddress hostAddress)
Passes the given active DHT node to the DHT controller in order to bootstrap or perform other maintenance operations. |
void |
addPassiveDHTNode(SocketAddress hostAddress)
Passes the given passive DHT node to the DHT controller in order to bootstrap or perform other maintenance operations. |
void |
addressChanged()
Notifies the DHT controller that our external Address has changed |
DHTFuture<FindValueResult> |
get(EntityKey eKey)
Calls the MojitoDHT.get(EntityKey) if a bootstrappable DHT is available. |
List<IpPort> |
getActiveDHTNodes(int maxNodes)
Returns maxNodes number of active Node's IP:Ports |
DHTManager.DHTMode |
getDHTMode()
Returns the mode of the DHT |
MojitoDHT |
getMojitoDHT()
Returns the MojitoDHT instance (null if Node is running in inactive mode!) |
Vendor |
getVendor()
Returns the Vendor code of this Node |
Version |
getVersion()
Returns the Vendor code of this Node |
void |
handleDHTContactsMessage(DHTContactsMessage msg)
Callback to notify the manager about new DHT Contacts that were exchanged over regular Gnutella messages. |
boolean |
isBootstrapped()
Returns whether this Node is bootstrapped |
boolean |
isEnabled()
Returns whether or not the DHT is enabled |
boolean |
isMemberOfDHT()
Returns whether this Node is part of the DHT. |
boolean |
isRunning()
Returns whether this Node is running |
boolean |
isWaitingForNodes()
Returns whether this Node is waiting for Nodes or not |
DHTFuture<StoreResult> |
put(KUID key,
DHTValue value)
Calls the MojitoDHT.put(KUID, DHTValue) if a bootstrappable DHT is available. |
void |
setEnabled(boolean enabled)
Sets whether or not the DHT is enabled |
void |
start(DHTManager.DHTMode mode)
Starts the DHT Node either in active or passive mode. |
void |
stop()
Stops the DHT Node |
| Methods inherited from interface com.limegroup.gnutella.connection.ConnectionLifecycleListener |
|---|
handleConnectionLifecycleEvent |
| Methods inherited from interface com.limegroup.gnutella.util.EventDispatcher |
|---|
addEventListener, dispatchEvent, removeEventListener |
| Method Detail |
|---|
void setEnabled(boolean enabled)
boolean isEnabled()
void start(DHTManager.DHTMode mode)
Note: You can use this method to stop the DHT by passing in
DHTMode.INACTIVE. The difference between using this method
and the stop() method is that stop() is synchronous
(i.e. blocking) and start() with DHTMode.INACTIVE isn't.
void stop()
void addActiveDHTNode(SocketAddress hostAddress)
void addPassiveDHTNode(SocketAddress hostAddress)
void addressChanged()
List<IpPort> getActiveDHTNodes(int maxNodes)
DHTManager.DHTMode getDHTMode()
boolean isRunning()
boolean isBootstrapped()
boolean isMemberOfDHT()
boolean isWaitingForNodes()
MojitoDHT getMojitoDHT()
Vendor getVendor()
Version getVersion()
void handleDHTContactsMessage(DHTContactsMessage msg)
DHTContactsMessageDHTFuture<FindValueResult> get(EntityKey eKey)
MojitoDHT.get(EntityKey) if a bootstrappable DHT is available.
Also handles the locking properly to ensure thread safety.
eKey - the entity key used to perform lookup in the DHT.
DHTFuture containing the result of the lookup.
DHTFuture<StoreResult> put(KUID key,
DHTValue value)
MojitoDHT.put(KUID, DHTValue) if a bootstrappable DHT is available.
Also handles the locking properly to ensure thread safety.
eKey - the entity key used to perform lookup in the DHT.
DHTFuture containing the result of the lookup.
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||