public abstract class NetworkDatabaseFacade extends Object implements Service
| Constructor and Description |
|---|
NetworkDatabaseFacade() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
fail(Hash dbEntry) |
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() |
List<BlindData> |
getBlindData()
For console ConfigKeyringHelper
|
BlindData |
getBlindData(SigningPublicKey spk) |
Set<LeaseSet> |
getClientLeases()
public for NetDbRenderer in routerconsole
|
Set<LeaseSet> |
getFloodfillLeases()
public for NetDbRenderer in routerconsole
|
int |
getKnownLeaseSets() |
int |
getKnownRouters() |
long |
getLastRouterInfoPublishTime()
The last time we successfully published our RI.
|
Set<LeaseSet> |
getLeases()
public for NetDbRenderer in routerconsole
|
Set<LeaseSet> |
getPublishedLeases()
public for NetDbRenderer in routerconsole
|
Set<RouterInfo> |
getRouters()
public for NetDbRenderer in routerconsole
|
Set<LeaseSet> |
getUnpublishedLeases()
public for NetDbRenderer in routerconsole
|
boolean |
isInitialized() |
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) |
abstract void |
lookupLeaseSet(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
Hash fromLocalDest)
Lookup using the client's tunnels
|
abstract LeaseSet |
lookupLeaseSetLocally(Hash 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) |
abstract DatabaseEntry |
lookupLocallyWithoutValidation(Hash key)
Not for use without validation
|
abstract void |
lookupRouterInfo(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs) |
abstract RouterInfo |
lookupRouterInfoLocally(Hash key) |
abstract void |
publish(LeaseSet localLeaseSet) |
abstract void |
publish(RouterInfo localRouterInfo) |
boolean |
removeBlindData(SigningPublicKey spk)
For console ConfigKeyringHelper
|
void |
renderStatusHTML(Writer out)
Debug only - all user info moved to NetDbRenderer in router console
|
void |
rescan() |
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) |
abstract LeaseSet |
store(Hash key,
LeaseSet leaseSet) |
abstract RouterInfo |
store(Hash key,
RouterInfo routerInfo) |
abstract void |
unpublish(LeaseSet localLeaseSet) |
public abstract void fail(Hash dbEntry)
public 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 BlindData getBlindData(SigningPublicKey spk)
spk - unblinded keypublic Set<LeaseSet> getFloodfillLeases()
public int getKnownLeaseSets()
public int getKnownRouters()
public long getLastRouterInfoPublishTime()
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)
public 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)
public abstract DatabaseEntry lookupLocallyWithoutValidation(Hash key)
public abstract void lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
public abstract RouterInfo lookupRouterInfoLocally(Hash key)
public abstract void publish(LeaseSet localLeaseSet)
public abstract void publish(RouterInfo localRouterInfo) throws IllegalArgumentException
IllegalArgumentException - if the local router is not validpublic boolean removeBlindData(SigningPublicKey spk)
public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML in interface ServiceIOExceptionpublic 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
IllegalArgumentException - 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)