Package com.biglybt.core.dht.router.impl
Class DHTRouterNodeImpl
- java.lang.Object
-
- com.biglybt.core.dht.router.impl.DHTRouterNodeImpl
-
public class DHTRouterNodeImpl extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<DHTRouterContactImpl>
buckets
private boolean
contains_router_node_id
private int
depth
private long
last_lookup_time
private DHTRouterNodeImpl
left
private java.util.List<DHTRouterContactImpl>
replacements
private DHTRouterNodeImpl
right
private DHTRouterImpl
router
-
Constructor Summary
Constructors Modifier Constructor Description protected
DHTRouterNodeImpl(DHTRouterImpl _router, int _depth, boolean _contains_router_node_id, java.util.List<DHTRouterContactImpl> _buckets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addNode(DHTRouterContactImpl node)
protected DHTRouterContact
addReplacement(DHTRouterContactImpl replacement, int max_rep_per_node)
protected void
alive(DHTRouterContactImpl contact)
protected java.lang.String
contactsToString(java.util.List contacts)
protected boolean
containsRouterNodeID()
protected void
dead(DHTRouterContactImpl contact, boolean force)
protected java.util.List
getBuckets()
protected int
getDepth()
protected DHTRouterNodeImpl
getLeft()
protected java.util.List<DHTRouterContactImpl>
getReplacements()
protected DHTRouterNodeImpl
getRight()
protected long
getTimeSinceLastLookup()
void
print(java.lang.String indent, java.lang.String prefix)
protected void
requestNodeAdd(DHTRouterContactImpl contact, boolean definite_change)
protected void
setLastLookupTime()
protected void
split(DHTRouterNodeImpl new_left, DHTRouterNodeImpl new_right)
protected DHTRouterContactImpl
updateExistingNode(byte[] node_id, DHTRouterContactAttachment attachment, boolean known_to_be_alive)
-
-
-
Field Detail
-
router
private final DHTRouterImpl router
-
depth
private final int depth
-
contains_router_node_id
private final boolean contains_router_node_id
-
buckets
private java.util.List<DHTRouterContactImpl> buckets
-
replacements
private java.util.List<DHTRouterContactImpl> replacements
-
left
private DHTRouterNodeImpl left
-
right
private DHTRouterNodeImpl right
-
last_lookup_time
private long last_lookup_time
-
-
Constructor Detail
-
DHTRouterNodeImpl
protected DHTRouterNodeImpl(DHTRouterImpl _router, int _depth, boolean _contains_router_node_id, java.util.List<DHTRouterContactImpl> _buckets)
-
-
Method Detail
-
getDepth
protected int getDepth()
-
containsRouterNodeID
protected boolean containsRouterNodeID()
-
getLeft
protected DHTRouterNodeImpl getLeft()
-
getRight
protected DHTRouterNodeImpl getRight()
-
split
protected void split(DHTRouterNodeImpl new_left, DHTRouterNodeImpl new_right)
-
getBuckets
protected java.util.List getBuckets()
-
getReplacements
protected java.util.List<DHTRouterContactImpl> getReplacements()
-
addNode
protected void addNode(DHTRouterContactImpl node)
-
addReplacement
protected DHTRouterContact addReplacement(DHTRouterContactImpl replacement, int max_rep_per_node)
-
updateExistingNode
protected DHTRouterContactImpl updateExistingNode(byte[] node_id, DHTRouterContactAttachment attachment, boolean known_to_be_alive)
-
alive
protected void alive(DHTRouterContactImpl contact)
-
dead
protected void dead(DHTRouterContactImpl contact, boolean force)
-
requestNodeAdd
protected void requestNodeAdd(DHTRouterContactImpl contact, boolean definite_change)
-
getTimeSinceLastLookup
protected long getTimeSinceLastLookup()
-
setLastLookupTime
protected void setLastLookupTime()
-
print
public void print(java.lang.String indent, java.lang.String prefix)
-
contactsToString
protected java.lang.String contactsToString(java.util.List contacts)
-
-