net.i2p.router.networkdb.kademlia
Class FloodfillNetworkDatabaseFacade
java.lang.Object
net.i2p.router.NetworkDatabaseFacade
net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade
net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade
- All Implemented Interfaces:
- Service
public class FloodfillNetworkDatabaseFacade
- extends KademliaNetworkDatabaseFacade
Method Summary |
(package private) void |
complete(Hash key)
|
protected void |
createHandlers()
|
protected PeerSelector |
createPeerSelector()
|
void |
flood(DataStructure ds)
|
boolean |
floodfillEnabled()
|
static boolean |
floodfillEnabled(RouterContext ctx)
|
java.util.List |
getFloodfillPeers()
list of the Hashes of currently known floodfill peers |
java.util.List |
getKnownRouterData()
|
static boolean |
isFloodfill(RouterInfo peer)
|
protected void |
lookupBeforeDropping(Hash peer,
RouterInfo info)
|
void |
publish(RouterInfo localRouterInfo)
|
(package private) SearchJob |
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 |
searchFull(Hash key,
java.util.List onFind,
java.util.List onFailed,
long timeoutMs,
boolean isLease)
Ok, the initial set of searches to the floodfill peers timed out, lets fall back on the
wider kademlia-style searches |
void |
sendStore(Hash key,
DataStructure ds,
Job onSuccess,
Job onFailure,
long sendTimeout,
java.util.Set toIgnore)
|
Methods inherited from class net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade |
dropAfterLookupFailed, fail, findNearestRouters, getAllRouters, getDataStore, getDbDir, getExplicitSendKeys, getExploreKeys, getKBuckets, getKnownLeaseSets, getKnownRouters, getLastExploreNewDate, getLastSent, getPassivelySendKeys, getPeerSelector, getPeerTimeout, lookupLeaseSet, lookupLeaseSetLocally, lookupRouterInfo, lookupRouterInfoLocally, noteKeySent, publish, queueForExploration, queueForPublishing, removeFromExplicitSend, removeFromExploreKeys, removeFromPassiveSend, renderStatusHTML, restart, searchComplete, setLastExploreNewDate, shutdown, startup, stopPublishing, store, store, unpublish, validate, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CAPACITY_FLOODFILL
public static final char CAPACITY_FLOODFILL
- See Also:
- Constant Field Values
FloodfillNetworkDatabaseFacade
public FloodfillNetworkDatabaseFacade(RouterContext context)
createHandlers
protected void createHandlers()
- Overrides:
createHandlers
in class KademliaNetworkDatabaseFacade
publish
public void publish(RouterInfo localRouterInfo)
throws java.lang.IllegalArgumentException
- Overrides:
publish
in class KademliaNetworkDatabaseFacade
- Throws:
java.lang.IllegalArgumentException
- if the local router info is invalid
sendStore
public void sendStore(Hash key,
DataStructure ds,
Job onSuccess,
Job onFailure,
long sendTimeout,
java.util.Set toIgnore)
- Overrides:
sendStore
in class KademliaNetworkDatabaseFacade
flood
public void flood(DataStructure ds)
createPeerSelector
protected PeerSelector createPeerSelector()
- Overrides:
createPeerSelector
in class KademliaNetworkDatabaseFacade
floodfillEnabled
public boolean floodfillEnabled()
floodfillEnabled
public static boolean floodfillEnabled(RouterContext ctx)
isFloodfill
public static boolean isFloodfill(RouterInfo peer)
getKnownRouterData
public java.util.List getKnownRouterData()
search
SearchJob 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)
- Overrides:
search
in class KademliaNetworkDatabaseFacade
searchFull
void searchFull(Hash key,
java.util.List onFind,
java.util.List onFailed,
long timeoutMs,
boolean isLease)
- Ok, the initial set of searches to the floodfill peers timed out, lets fall back on the
wider kademlia-style searches
complete
void complete(Hash key)
getFloodfillPeers
public java.util.List getFloodfillPeers()
- list of the Hashes of currently known floodfill peers
lookupBeforeDropping
protected void lookupBeforeDropping(Hash peer,
RouterInfo info)
- Overrides:
lookupBeforeDropping
in class KademliaNetworkDatabaseFacade