Package org.klomp.snark.dht
Class DHTNodes
- java.lang.Object
- 
- org.klomp.snark.dht.DHTNodes
 
- 
 class DHTNodes extends Object All the nodes we know about, stored as a mapping from node ID to a Destination and Port. And a real Kademlia routing table, which stores node IDs only.- Since:
- 0.9.2
- Author:
- zzz
 
- 
- 
Constructor SummaryConstructors Constructor Description DHTNodes(I2PAppContext ctx, NID me)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()List<NodeInfo>findClosest(SHA1Hash h, int numWant)DHTNodeInfoget(NID nid)List<NID>getExploreKeys()DHT - get random keys to exploreNodeInfoputIfAbsent(NodeInfo nInfo)NodeInforemove(NID nid)voidrenderStatusHTML(StringBuilder buf)Debug info, HTML formattedintsize()voidstart()voidstop()Collection<NodeInfo>values()
 
- 
- 
- 
Constructor Detail- 
DHTNodespublic DHTNodes(I2PAppContext ctx, NID me) 
 
- 
 - 
Method Detail- 
startpublic void start() 
 - 
stoppublic void stop() 
 - 
sizepublic int size() - Returns:
- known nodes, not total net size
 
 - 
clearpublic void clear() 
 - 
putIfAbsentpublic NodeInfo putIfAbsent(NodeInfo nInfo) - Returns:
- the old value if present, else null
 
 - 
valuespublic Collection<NodeInfo> values() 
 - 
findClosestpublic List<NodeInfo> findClosest(SHA1Hash h, int numWant) DHT- Parameters:
- h- either a InfoHash or a NID
 
 - 
renderStatusHTMLpublic void renderStatusHTML(StringBuilder buf) Debug info, HTML formatted- Since:
- 0.9.4
 
 
- 
 
-