Package net.i2p.router
Class NetworkDatabaseFacade
java.lang.Object
net.i2p.router.NetworkDatabaseFacade
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
DummyNetworkDatabaseFacade
,KademliaNetworkDatabaseFacade
Defines the mechanism for interacting with I2P's network database
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
findNearestRouters
(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) Return the RouterInfo structures for the routers closest to the given key.boolean
For convenience, so users don't have to cast to FNDF, and unit tests using Dummy NDF will work.For console ConfigKeyringHelperint
int
long
The last time we successfully published our RI.public for NetDbRenderer in routerconsolepublic for NetDbRenderer in routerconsoleboolean
boolean
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 typeabstract Destination
Lookup locally in netDB and in badDest cache Succeeds even if LS validation failed due to unsupported sig typeabstract 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 tunnelsabstract LeaseSet
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
Not for use without validationabstract void
lookupRouterInfo
(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) abstract RouterInfo
abstract void
abstract void
publish
(RouterInfo localRouterInfo) boolean
For console ConfigKeyringHelpervoid
renderStatusHTML
(Writer out) Debug only - all user info moved to NetDbRenderer in router consolevoid
rescan()
void
Notify the netDB that the routing key changed at midnight UTCvoid
store
(Hash key, DatabaseEntry entry) abstract LeaseSet
abstract RouterInfo
store
(Hash key, RouterInfo routerInfo) abstract void
-
Constructor Details
-
NetworkDatabaseFacade
public NetworkDatabaseFacade()
-
-
Method Details
-
findNearestRouters
Return the RouterInfo structures for the routers closest to the given key. At most maxNumRouters will be returned- Parameters:
key
- The keymaxNumRouters
- The maximum number of routers to returnpeersToIgnore
- Hash of routers not to include
-
lookupLocally
- Returns:
- RouterInfo, LeaseSet, or null
- Since:
- 0.8.3
-
lookupLocallyWithoutValidation
Not for use without validation- Returns:
- RouterInfo, LeaseSet, or null, NOT validated
- Since:
- 0.9.38
-
lookupLeaseSet
-
lookupLeaseSet
public abstract void lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Lookup using the client's tunnels- Parameters:
fromLocalDest
- use these tunnels for the lookup, or null for exploratory- Since:
- 0.9.10
-
lookupLeaseSetLocally
-
lookupRouterInfo
-
lookupRouterInfoLocally
-
lookupLeaseSetRemotely
Unconditionally lookup using the client's tunnels. No success or failed jobs, no local lookup, no checks. Use this to refresh a leaseset before expiration.- Parameters:
fromLocalDest
- use these tunnels for the lookup, or null for exploratory- Since:
- 0.9.25
-
lookupLeaseSetRemotely
public abstract void lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Unconditionally lookup using the client's tunnels.- Parameters:
onFindJob
- may be nullonFailedLookupJob
- may be nullfromLocalDest
- use these tunnels for the lookup, or null for exploratory- Since:
- 0.9.47
-
lookupDestination
public 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- Parameters:
fromLocalDest
- use these tunnels for the lookup, or null for exploratory- Since:
- 0.9.16
-
lookupDestinationLocally
Lookup locally in netDB and in badDest cache Succeeds even if LS validation failed due to unsupported sig type- Since:
- 0.9.16
-
store
- Returns:
- the leaseSet if another leaseSet already existed at that key
- Throws:
IllegalArgumentException
- if the data is not valid
-
store
- Returns:
- the routerInfo if another router already existed at that key
- Throws:
IllegalArgumentException
- if the data is not valid
-
store
- Returns:
- the old entry if it already existed at that key
- Throws:
IllegalArgumentException
- if the data is not valid- Since:
- 0.9.16
-
publish
- Throws:
IllegalArgumentException
- if the local router is not valid
-
publish
-
unpublish
-
fail
-
getLastRouterInfoPublishTime
public long getLastRouterInfoPublishTime()The last time we successfully published our RI.- Since:
- 0.9.9
-
getAllRouters
-
getKnownRouters
public int getKnownRouters() -
getKnownLeaseSets
public int getKnownLeaseSets() -
isInitialized
public boolean isInitialized() -
rescan
public void rescan() -
renderStatusHTML
Debug only - all user info moved to NetDbRenderer in router console- Specified by:
renderStatusHTML
in interfaceService
- Throws:
IOException
-
getLeases
public for NetDbRenderer in routerconsole -
getRouters
public for NetDbRenderer in routerconsole -
reseedChecker
- Since:
- 0.9
-
floodfillEnabled
public boolean floodfillEnabled()For convenience, so users don't have to cast to FNDF, and unit tests using Dummy NDF will work.- Returns:
- false; FNDF overrides to return actual setting
- Since:
- IPv6
-
isNegativeCachedForever
Is it permanently negative cached?- Parameters:
key
- only for Destinations; for RouterIdentities, see Banlist- Since:
- 0.9.16
-
getBlindData
- Parameters:
spk
- unblinded key- Returns:
- BlindData or null
- Since:
- 0.9.40
-
setBlindData
- Parameters:
bd
- new BlindData to put in the cache- Since:
- 0.9.40
-
getBlindData
For console ConfigKeyringHelper- Since:
- 0.9.41
-
removeBlindData
For console ConfigKeyringHelper- Returns:
- true if removed
- Since:
- 0.9.41
-
routingKeyChanged
public void routingKeyChanged()Notify the netDB that the routing key changed at midnight UTC- Since:
- 0.9.50
-