public abstract class NetworkDatabaseFacade extends Object implements Service
| Constructor and Description |
|---|
NetworkDatabaseFacade() |
| Modifier and Type | Method and Description |
|---|---|
abstract void | accessLeaseSet(Hash key)Record access to a LeaseSet for refresh tracking. |
abstract void | fail(Hash dbEntry)Mark a database entry as failed. |
abstract Set<Hash> | findNearestRouters(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore)Return the RouterInfo structures for the routers closest to the given key. |
boolean | floodfillEnabled()For convenience, so users don't have to cast to FNDF, and unit tests using
Dummy NDF will work. |
abstract Set<Hash> | getAllRouters()Get all known router hashes. |
List<BlindData> | getBlindData()For console ConfigKeyringHelper |
BlindData | getBlindData(SigningPublicKey spk) |
Set<LeaseSet> | getClientLeases() |
Set<LeaseSet> | getFloodfillLeases() |
int | getKnownLeaseSets()Get the number of known LeaseSets. |
int | getKnownRouters()Get the number of known routers. |
long | getLastRouterInfoPublishTime()The last time we successfully published our RI. |
Set<LeaseSet> | getLeases()Get all known LeaseSets for display. |
Set<LeaseSet> | getPublishedLeases() |
Set<RouterInfo> | getRouters()public for NetDbRenderer in routerconsole |
Set<LeaseSet> | getUnpublishedLeases() |
boolean | isInitialized()Is the network database initialized? |
boolean | isNegativeCachedForever(Hash key)Is it permanently negative cached? |
abstract void | lookupDestination(Hash key,
Job onFinishedJob,
long timeoutMs,
Hash fromLocalDest)Lookup using the client's tunnels
Succeeds even if LS validation fails due to unsupported sig type |
abstract Destination | lookupDestinationLocally(Hash key)Lookup locally in netDB and in badDest cache
Succeeds even if LS validation failed due to unsupported sig type |
abstract void | lookupLeaseSet(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs)Lookup a LeaseSet in the network database. |
abstract void | lookupLeaseSet(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
Hash fromLocalDest)Lookup using the client's tunnels |
abstract LeaseSet | lookupLeaseSetLocally(Hash key)key). |
abstract void | lookupLeaseSetRemotely(Hash key,
Hash fromLocalDest)Unconditionally lookup using the client's tunnels. |
abstract void | lookupLeaseSetRemotely(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
Hash fromLocalDest)Unconditionally lookup using the client's tunnels. |
abstract DatabaseEntry | lookupLocally(Hash key)Lookup a database entry locally. |
abstract DatabaseEntry | lookupLocallyWithoutValidation(Hash key)Not for use without validation |
abstract void | lookupRouterInfo(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs)timeoutMs). |
abstract RouterInfo | lookupRouterInfoLocally(Hash key)key). |
abstract void | publish(LeaseSet localLeaseSet)Publish a LeaseSet to the network database. |
abstract void | publish(RouterInfo localRouterInfo)Publish a RouterInfo to the network database. |
void | purgeMatchingRouters()Trigger a retroactive purge sweep of the NetDb. |
boolean | removeBlindData(SigningPublicKey spk)For console ConfigKeyringHelper |
abstract void | removeLeaseSetFromTracking(Hash key)Remove a LeaseSet from refresh tracking. |
void | renderStatusHTML(Writer out)Debug only - all user info moved to NetDbRenderer in router console |
void | rescan()Rescan the network database. |
ReseedChecker | reseedChecker() |
void | routingKeyChanged()Notify the netDB that the routing key changed at midnight UTC |
void | setBlindData(BlindData bd) |
DatabaseEntry | store(Hash key,
DatabaseEntry entry)Store a DatabaseEntry in the network database. |
abstract LeaseSet | store(Hash key,
LeaseSet leaseSet) |
abstract RouterInfo | store(Hash key,
RouterInfo routerInfo) |
abstract void | unpublish(LeaseSet localLeaseSet)Unpublish a LeaseSet from the network database. |
public abstract void accessLeaseSet(Hash key)
public abstract void fail(Hash dbEntry)
dbEntry - the key of the entry to failpublic abstract Set<Hash> findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore)
key - The keymaxNumRouters - The maximum number of routers to returnpeersToIgnore - Hash of routers not to includepublic boolean floodfillEnabled()
public abstract Set<Hash> getAllRouters()
public List<BlindData> getBlindData()
public BlindData getBlindData(SigningPublicKey spk)
spk - unblinded keypublic int getKnownLeaseSets()
public int getKnownRouters()
public long getLastRouterInfoPublishTime()
public Set<LeaseSet> getLeases()
public Set<RouterInfo> getRouters()
public boolean isInitialized()
public boolean isNegativeCachedForever(Hash key)
key - only for Destinations; for RouterIdentities, see Banlistpublic abstract void lookupDestination(Hash key, Job onFinishedJob, long timeoutMs, Hash fromLocalDest)
fromLocalDest - use these tunnels for the lookup, or null for exploratorypublic abstract Destination lookupDestinationLocally(Hash key)
public abstract void lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
key - the keyonFindJob - job to run on successonFailedLookupJob - job to run on failuretimeoutMs - timeout in millisecondspublic abstract void lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest)
fromLocalDest - use these tunnels for the lookup, or null for exploratorypublic abstract void lookupLeaseSetRemotely(Hash key, Hash fromLocalDest)
fromLocalDest - use these tunnels for the lookup, or null for exploratorypublic abstract void lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest)
fromLocalDest - use these tunnels for the lookup, or null for exploratoryonFindJob - may be nullonFailedLookupJob - may be nullpublic abstract DatabaseEntry lookupLocally(Hash key)
key - the keypublic abstract DatabaseEntry lookupLocallyWithoutValidation(Hash key)
key - the keypublic abstract void lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
public abstract RouterInfo lookupRouterInfoLocally(Hash key)
public abstract void publish(LeaseSet localLeaseSet)
localLeaseSet - the LeaseSet to publishpublic abstract void publish(RouterInfo localRouterInfo) throws IllegalArgumentException
localRouterInfo - the RouterInfo to publishIllegalArgumentException - if the local router is not validpublic void purgeMatchingRouters()
public boolean removeBlindData(SigningPublicKey spk)
public abstract void removeLeaseSetFromTracking(Hash key)
public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML in interface Serviceout - the writer to write toIOException - if an error occurs writingpublic void rescan()
public ReseedChecker reseedChecker()
public void routingKeyChanged()
public void setBlindData(BlindData bd)
bd - new BlindData to put in the cachepublic DatabaseEntry store(Hash key, DatabaseEntry entry) throws IllegalArgumentException
key - the keyentry - the entry to storeIllegalArgumentException - if the data is not validpublic abstract LeaseSet store(Hash key, LeaseSet leaseSet) throws IllegalArgumentException
IllegalArgumentException - if the data is not validpublic abstract RouterInfo store(Hash key, RouterInfo routerInfo) throws IllegalArgumentException
IllegalArgumentException - if the data is not validpublic abstract void unpublish(LeaseSet localLeaseSet)
localLeaseSet - the LeaseSet to unpublish