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()All known router hashes. |
List<BlindData> | getBlindData()The blind data for the given unblinded key, for console ConfigKeyringHelper. |
BlindData | getBlindData(SigningPublicKey spk)Look up the cached BlindData for the given key. |
Set<LeaseSet> | getClientLeases()The known client LeaseSets. |
Set<LeaseSet> | getFloodfillLeases()The known floodfill LeaseSets. |
int | getKnownLeaseSets()Number of known LeaseSets. |
int | getKnownRouters()Number of known routers. |
long | getLastRouterInfoPublishTime()The last time we successfully published our RI. |
Set<LeaseSet> | getLeases()All known LeaseSets for display. |
Set<LeaseSet> | getPublishedLeases()The known published LeaseSets. |
Set<RouterInfo> | getRouters()Public for NetDbRenderer in routerconsole |
Set<LeaseSet> | getUnpublishedLeases()The known unpublished LeaseSets. |
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)Look up a LeaseSet in the local network database. |
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)Look up a RouterInfo in the network database. |
abstract RouterInfo | lookupRouterInfoLocally(Hash key)Look up a RouterInfo in the local network database. |
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)Cache the given BlindData for later lookup. |
DatabaseEntry | store(Hash key,
DatabaseEntry entry)Store a DatabaseEntry in the network database. |
abstract LeaseSet | store(Hash key,
LeaseSet leaseSet)Store a LeaseSet in the network database. |
abstract RouterInfo | store(Hash key,
RouterInfo routerInfo)Store a RouterInfo in the network database. |
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 Set<LeaseSet> getClientLeases()
public Set<LeaseSet> getFloodfillLeases()
public int getKnownLeaseSets()
public int getKnownRouters()
public long getLastRouterInfoPublishTime()
public Set<LeaseSet> getLeases()
public Set<LeaseSet> getPublishedLeases()
public Set<RouterInfo> getRouters()
public Set<LeaseSet> getUnpublishedLeases()
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 LeaseSet lookupLeaseSetLocally(Hash key)
key - the keypublic 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)
key - the keyonFindJob - job to run on successonFailedLookupJob - job to run on failuretimeoutMs - timeout in millisecondspublic abstract RouterInfo lookupRouterInfoLocally(Hash key)
key - the keypublic 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
key - the keyleaseSet - the LeaseSet to storeIllegalArgumentException - if the data is not validpublic abstract RouterInfo store(Hash key, RouterInfo routerInfo) throws IllegalArgumentException
key - the keyrouterInfo - the RouterInfo to storeIllegalArgumentException - if the data is not validpublic abstract void unpublish(LeaseSet localLeaseSet)
localLeaseSet - the LeaseSet to unpublish