|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.NetworkDatabaseFacade
net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade
Kademlia based version of the network database
Field Summary | |
static java.lang.String |
DEFAULT_DB_DIR
|
static java.lang.String |
PROP_DB_DIR
|
static java.lang.String |
PROP_ENFORCE_NETID
|
Constructor Summary | |
KademliaNetworkDatabaseFacade(RouterContext context)
|
Method Summary | |
void |
fail(Hash dbEntry)
|
java.util.Set |
findNearestRouters(Hash key,
int maxNumRouters,
java.util.Set peersToIgnore)
Get the routers closest to that key in response to a remote lookup |
(package private) java.util.Set |
getAllRouters()
get the hashes for all known routers |
(package private) DataStore |
getDataStore()
|
(package private) java.lang.String |
getDbDir()
|
java.util.Set |
getExplicitSendKeys()
|
java.util.Set |
getExploreKeys()
|
(package private) KBucketSet |
getKBuckets()
|
int |
getKnownRouters()
|
(package private) long |
getLastExploreNewDate()
|
java.lang.Long |
getLastSent(Hash key)
|
java.util.Set |
getPassivelySendKeys()
|
void |
lookupLeaseSet(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs)
|
LeaseSet |
lookupLeaseSetLocally(Hash key)
|
void |
lookupRouterInfo(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs)
|
RouterInfo |
lookupRouterInfoLocally(Hash key)
|
void |
noteKeySent(Hash key)
|
void |
publish(LeaseSet localLeaseSet)
|
void |
publish(RouterInfo localRouterInfo)
|
void |
queueForExploration(java.util.Set keys)
|
void |
queueForPublishing(java.util.Set toSend)
|
void |
removeFromExplicitSend(java.util.Set toRemove)
|
void |
removeFromExploreKeys(java.util.Set toRemove)
|
void |
removeFromPassiveSend(java.util.Set toRemove)
|
void |
renderStatusHTML(java.io.Writer out)
|
void |
restart()
Perform a soft restart. |
(package private) void |
search(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
boolean isLease)
Begin a kademlia style search for the key specified, which can take up to timeoutMs and will fire the appropriate jobs on success or timeout (or if the kademlia search completes without any match) |
(package private) void |
searchComplete(Hash key)
The search for the given key is no longer active |
(package private) void |
setLastExploreNewDate(long when)
|
void |
shutdown()
Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. |
void |
startup()
Instruct the service that it should start normal operation. |
(package private) void |
stopPublishing(Hash target)
|
LeaseSet |
store(Hash key,
LeaseSet leaseSet)
Store the leaseSet |
RouterInfo |
store(Hash key,
RouterInfo routerInfo)
store the routerInfo |
void |
unpublish(LeaseSet localLeaseSet)
|
(package private) java.lang.String |
validate(Hash key,
LeaseSet leaseSet)
Determine whether this leaseSet will be accepted as valid and current given what we know now. |
(package private) java.lang.String |
validate(Hash key,
RouterInfo routerInfo)
Determine whether this routerInfo will be accepted as valid and current given what we know now. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROP_ENFORCE_NETID
public static final java.lang.String PROP_DB_DIR
public static final java.lang.String DEFAULT_DB_DIR
Constructor Detail |
public KademliaNetworkDatabaseFacade(RouterContext context)
Method Detail |
void searchComplete(Hash key)
KBucketSet getKBuckets()
DataStore getDataStore()
long getLastExploreNewDate()
void setLastExploreNewDate(long when)
public java.util.Set getExplicitSendKeys()
public java.util.Set getPassivelySendKeys()
public void removeFromExplicitSend(java.util.Set toRemove)
public void removeFromPassiveSend(java.util.Set toRemove)
public void queueForPublishing(java.util.Set toSend)
public java.lang.Long getLastSent(Hash key)
public void noteKeySent(Hash key)
public java.util.Set getExploreKeys()
public void removeFromExploreKeys(java.util.Set toRemove)
public void queueForExploration(java.util.Set keys)
public void shutdown()
Service
public void restart()
Service
java.lang.String getDbDir()
public void startup()
Service
public java.util.Set findNearestRouters(Hash key, int maxNumRouters, java.util.Set peersToIgnore)
findNearestRouters
in class NetworkDatabaseFacade
key
- The keymaxNumRouters
- The maximum number of routers to returnpeersToIgnore
- Hash of routers not to includejava.util.Set getAllRouters()
public int getKnownRouters()
getKnownRouters
in class NetworkDatabaseFacade
public void lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
lookupLeaseSet
in class NetworkDatabaseFacade
public LeaseSet lookupLeaseSetLocally(Hash key)
lookupLeaseSetLocally
in class NetworkDatabaseFacade
public void lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
lookupRouterInfo
in class NetworkDatabaseFacade
public RouterInfo lookupRouterInfoLocally(Hash key)
lookupRouterInfoLocally
in class NetworkDatabaseFacade
public void publish(LeaseSet localLeaseSet)
publish
in class NetworkDatabaseFacade
void stopPublishing(Hash target)
public void publish(RouterInfo localRouterInfo) throws java.lang.IllegalArgumentException
publish
in class NetworkDatabaseFacade
java.lang.IllegalArgumentException
- if the local router info is invalidjava.lang.String validate(Hash key, LeaseSet leaseSet)
public LeaseSet store(Hash key, LeaseSet leaseSet) throws java.lang.IllegalArgumentException
store
in class NetworkDatabaseFacade
java.lang.IllegalArgumentException
- if the leaseSet is not validjava.lang.String validate(Hash key, RouterInfo routerInfo) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public RouterInfo store(Hash key, RouterInfo routerInfo) throws java.lang.IllegalArgumentException
store
in class NetworkDatabaseFacade
java.lang.IllegalArgumentException
- if the routerInfo is not validpublic void fail(Hash dbEntry)
fail
in class NetworkDatabaseFacade
public void unpublish(LeaseSet localLeaseSet)
unpublish
in class NetworkDatabaseFacade
void search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease)
public void renderStatusHTML(java.io.Writer out) throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |