FileDocCategorySizeDatePackage
DHTRouter.javaAPI DocAzureus 3.0.3.43848Tue Sep 05 07:33:56 BST 2006com.aelitis.azureus.core.dht.router

DHTRouter

public interface DHTRouter
author
parg

Fields Summary
Constructors Summary
Methods Summary
public booleanaddObserver(DHTRouterObserver rto)
Adds a routing table observer if it is not already observing.

param
rto the observer to add
return
true if now observing, false otherwise

public DHTRouterContactcontactAlive(byte[] node_id, DHTRouterContactAttachment attachment)
Adds a contact to the router and marks it as "known to be alive"

param
node_id
param
attachment
return

public DHTRouterContactcontactDead(byte[] node_id, boolean force)
Informs the router that an attempt to interact with the contact failed

param
node_id
param
attachment
return

public DHTRouterContactcontactKnown(byte[] node_id, DHTRouterContactAttachment attachment)
Adds a contact to the router. The contact is not known to be alive (e.g. we've been returned the contact by someone but we've not either got a reply from it, nor has it invoked us.

param
node_id
param
attachment
return

public booleancontainsObserver(DHTRouterObserver rto)
Returns whether the given observer is already observing.

param
rto the observer to query as observing
return
true if observing, false otherwise

public voiddestroy()

public java.util.ListfindBestContacts(int max)
returns a list of best contacts in terms of uptime, best first

param
max
return

public java.util.ListfindClosestContacts(byte[] node_id, boolean live_only)
Returns K or a few more closest contacts, unordered

public DHTRouterContactfindContact(byte[] node_id)

public java.util.ListgetAllContacts()
Returns a list of DHTRouterContact objects

return

public byte[]getID()

public intgetK()

public DHTRouterContactgetLocalContact()

public DHTRouterStatsgetStats()

public booleanisID(byte[] node_id)

public voidprint()

public voidrecordLookup(byte[] node_id)

public voidrefreshIdleLeaves(long idle_max)

public byte[]refreshRandom()

public booleanremoveObserver(DHTRouterObserver rto)
Removes the observer if it is already observing.

param
rto the observer to remove
return
true if no longer observing, false otherwise

public booleanrequestPing(byte[] node_id)

public voidseed()
Tells the router to perform its "start of day" functions required to integrate it into the DHT (search for itself, refresh buckets)

public voidsetAdapter(DHTRouterAdapter _adapter)