|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DHTRouter
Method Summary | |
---|---|
boolean |
addObserver(DHTRouterObserver rto)
Adds a routing table observer if it is not already observing. |
void |
contactAlive(byte[] node_id,
DHTRouterContactAttachment attachment)
Adds a contact to the router and marks it as "known to be alive" |
DHTRouterContact |
contactDead(byte[] node_id,
boolean force)
Informs the router that an attempt to interact with the contact failed |
void |
contactKnown(byte[] node_id,
DHTRouterContactAttachment attachment,
boolean force)
Adds a contact to the router. |
boolean |
containsObserver(DHTRouterObserver rto)
Returns whether the given observer is already observing. |
void |
destroy()
|
List<DHTRouterContact> |
findBestContacts(int max)
returns a list of best contacts in terms of uptime, best first |
List<DHTRouterContact> |
findClosestContacts(byte[] node_id,
int num_to_return,
boolean live_only)
Returns num_to_return or a few more closest contacts, unordered |
DHTRouterContact |
findContact(byte[] node_id)
|
List<DHTRouterContact> |
getAllContacts()
Returns a list of DHTRouterContact objects |
byte[] |
getID()
|
int |
getK()
|
DHTRouterContact |
getLocalContact()
|
DHTRouterStats |
getStats()
|
boolean |
isID(byte[] node_id)
|
void |
print()
|
void |
recordLookup(byte[] node_id)
|
void |
refreshIdleLeaves(long idle_max)
|
byte[] |
refreshRandom()
|
boolean |
removeObserver(DHTRouterObserver rto)
Removes the observer if it is already observing. |
boolean |
requestPing(byte[] node_id)
|
void |
seed()
Tells the router to perform its "start of day" functions required to integrate it into the DHT (search for itself, refresh buckets) |
void |
setAdapter(DHTRouterAdapter _adapter)
|
void |
setSleeping(boolean sleeping)
|
void |
setSuspended(boolean susp)
|
Method Detail |
---|
int getK()
byte[] getID()
boolean isID(byte[] node_id)
DHTRouterContact getLocalContact()
void setAdapter(DHTRouterAdapter _adapter)
void seed()
void contactKnown(byte[] node_id, DHTRouterContactAttachment attachment, boolean force)
node_id
- attachment
- void contactAlive(byte[] node_id, DHTRouterContactAttachment attachment)
node_id
- attachment
- DHTRouterContact contactDead(byte[] node_id, boolean force)
node_id
- attachment
-
DHTRouterContact findContact(byte[] node_id)
List<DHTRouterContact> findClosestContacts(byte[] node_id, int num_to_return, boolean live_only)
void recordLookup(byte[] node_id)
boolean requestPing(byte[] node_id)
void refreshIdleLeaves(long idle_max)
byte[] refreshRandom()
List<DHTRouterContact> findBestContacts(int max)
max
-
List<DHTRouterContact> getAllContacts()
DHTRouterStats getStats()
void setSleeping(boolean sleeping)
void setSuspended(boolean susp)
void destroy()
void print()
boolean addObserver(DHTRouterObserver rto)
rto
- the observer to add
true
if now observing, false
otherwiseboolean containsObserver(DHTRouterObserver rto)
rto
- the observer to query as observing
true
if observing, false
otherwiseboolean removeObserver(DHTRouterObserver rto)
rto
- the observer to remove
true
if no longer observing, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |