net.i2p.router
Class NetworkDatabaseFacade

java.lang.Object
  extended by net.i2p.router.NetworkDatabaseFacade
All Implemented Interfaces:
Service
Direct Known Subclasses:
DummyNetworkDatabaseFacade, KademliaNetworkDatabaseFacade

public abstract class NetworkDatabaseFacade
extends java.lang.Object
implements Service

Defines the mechanism for interacting with I2P's network database


Constructor Summary
NetworkDatabaseFacade()
           
 
Method Summary
abstract  void fail(Hash dbEntry)
           
abstract  java.util.Set<Hash> findNearestRouters(Hash key, int maxNumRouters, java.util.Set<Hash> peersToIgnore)
          Return the RouterInfo structures for the routers closest to the given key.
abstract  java.util.Set<Hash> getAllRouters()
           
 int getKnownLeaseSets()
           
 int getKnownRouters()
           
 java.util.Set<LeaseSet> getLeases()
          public for NetDbRenderer in routerconsole
 java.util.Set<RouterInfo> getRouters()
          public for NetDbRenderer in routerconsole
 boolean isInitialized()
           
abstract  void lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)
           
abstract  LeaseSet lookupLeaseSetLocally(Hash key)
           
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)
           
 void renderStatusHTML(java.io.Writer out)
          Deprecated. moved to router console
 void rescan()
           
abstract  LeaseSet store(Hash key, LeaseSet leaseSet)
          return the leaseSet if another leaseSet already existed at that key
abstract  RouterInfo store(Hash key, RouterInfo routerInfo)
          return the routerInfo if another router already existed at that key
abstract  void unpublish(LeaseSet localLeaseSet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.i2p.router.Service
restart, shutdown, startup
 

Constructor Detail

NetworkDatabaseFacade

public NetworkDatabaseFacade()
Method Detail

findNearestRouters

public abstract java.util.Set<Hash> findNearestRouters(Hash key,
                                                       int maxNumRouters,
                                                       java.util.Set<Hash> peersToIgnore)
Return the RouterInfo structures for the routers closest to the given key. At most maxNumRouters will be returned

Parameters:
key - The key
maxNumRouters - The maximum number of routers to return
peersToIgnore - Hash of routers not to include

lookupLeaseSet

public abstract void lookupLeaseSet(Hash key,
                                    Job onFindJob,
                                    Job onFailedLookupJob,
                                    long timeoutMs)

lookupLeaseSetLocally

public abstract LeaseSet lookupLeaseSetLocally(Hash key)

lookupRouterInfo

public abstract void lookupRouterInfo(Hash key,
                                      Job onFindJob,
                                      Job onFailedLookupJob,
                                      long timeoutMs)

lookupRouterInfoLocally

public abstract RouterInfo lookupRouterInfoLocally(Hash key)

store

public abstract LeaseSet store(Hash key,
                               LeaseSet leaseSet)
                        throws java.lang.IllegalArgumentException
return the leaseSet if another leaseSet already existed at that key

Throws:
java.lang.IllegalArgumentException - if the data is not valid

store

public abstract RouterInfo store(Hash key,
                                 RouterInfo routerInfo)
                          throws java.lang.IllegalArgumentException
return the routerInfo if another router already existed at that key

Throws:
java.lang.IllegalArgumentException - if the data is not valid

publish

public abstract void publish(RouterInfo localRouterInfo)
                      throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException - if the local router is not valid

publish

public abstract void publish(LeaseSet localLeaseSet)

unpublish

public abstract void unpublish(LeaseSet localLeaseSet)

fail

public abstract void fail(Hash dbEntry)

getAllRouters

public abstract java.util.Set<Hash> getAllRouters()

getKnownRouters

public int getKnownRouters()

getKnownLeaseSets

public int getKnownLeaseSets()

isInitialized

public boolean isInitialized()

rescan

public void rescan()

renderStatusHTML

public void renderStatusHTML(java.io.Writer out)
                      throws java.io.IOException
Deprecated. moved to router console

Specified by:
renderStatusHTML in interface Service
Throws:
java.io.IOException

getLeases

public java.util.Set<LeaseSet> getLeases()
public for NetDbRenderer in routerconsole


getRouters

public java.util.Set<RouterInfo> getRouters()
public for NetDbRenderer in routerconsole