net.i2p.router.dummy

## Class DummyNetworkDatabaseFacade

- java.lang.Object
- - net.i2p.router.NetworkDatabaseFacade
  - - net.i2p.router.dummy.DummyNetworkDatabaseFacade

- All Implemented Interfaces:
    Service

      public class DummyNetworkDatabaseFacade
      extends NetworkDatabaseFacade

  In-memory network database implementation for testing and development scenarios. Provides basic router info storage and lookup functionality without persistence or network communication.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DummyNetworkDatabaseFacade(RouterContext ctx)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `fail(Hash dbEntry)`
    `Set<Hash>` | `findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore)` Return the RouterInfo structures for the routers closest to the given key.
    `Set<Hash>` | `getAllRouters()`
    `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
    `Destination` | `lookupDestinationLocally(Hash key)` Lookup locally in netDB and in badDest cache Succeeds even if LS validation failed due to unsupported sig type
    `void` | `lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)`
    `void` | `lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest)` Lookup using the client's tunnels
    `LeaseSet` | `lookupLeaseSetLocally(Hash key)`
    `void` | `lookupLeaseSetRemotely(Hash key, Hash fromLocalDest)` Unconditionally lookup using the client's tunnels.
    `void` | `lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest)` Unconditionally lookup using the client's tunnels.
    `DatabaseEntry` | `lookupLocally(Hash key)`
    `DatabaseEntry` | `lookupLocallyWithoutValidation(Hash key)` Not for use without validation
    `void` | `lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs)`
    `RouterInfo` | `lookupRouterInfoLocally(Hash key)`
    `void` | `publish(LeaseSet localLeaseSet)`
    `void` | `publish(RouterInfo localRouterInfo)`
    `void` | `restart()` Perform a soft restart.
    `void` | `shutdown()` Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.
    `void` | `startup()` Instruct the service that it should start normal operation.
    `LeaseSet` | `store(Hash key, LeaseSet leaseSet)`
    `RouterInfo` | `store(Hash key, RouterInfo routerInfo)`
    `void` | `unpublish(LeaseSet localLeaseSet)`

    - ### Methods inherited from class net.i2p.router.NetworkDatabaseFacade

      `floodfillEnabled, getBlindData, getBlindData, getClientLeases, getFloodfillLeases, getKnownLeaseSets, getKnownRouters, getLastRouterInfoPublishTime, getLeases, getPublishedLeases, getRouters, getUnpublishedLeases, isInitialized, isNegativeCachedForever, removeBlindData, renderStatusHTML, rescan, reseedChecker, routingKeyChanged, setBlindData, store`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DummyNetworkDatabaseFacade

          public DummyNetworkDatabaseFacade(RouterContext ctx)

  - ### Method Detail

    - #### fail

          public void fail(Hash dbEntry)

      Specified by:
        `fail` in class `NetworkDatabaseFacade`

    - #### findNearestRouters

          public Set<Hash> findNearestRouters(Hash key,
                                              int maxNumRouters,
                                              Set<Hash> peersToIgnore)

      Description copied from class: `NetworkDatabaseFacade`
      Return the RouterInfo structures for the routers closest to the given key. At most maxNumRouters will be returned
      Specified by:
        `findNearestRouters` in class `NetworkDatabaseFacade`
      Parameters:
        `key` - The key
        `maxNumRouters` - The maximum number of routers to return
        `peersToIgnore` - Hash of routers not to include

    - #### getAllRouters

          public Set<Hash> getAllRouters()

      Specified by:
        `getAllRouters` in class `NetworkDatabaseFacade`

    - #### lookupDestination

          public void lookupDestination(Hash key,
                                        Job onFinishedJob,
                                        long timeoutMs,
                                        Hash fromLocalDest)

      Description copied from class: `NetworkDatabaseFacade`
      Lookup using the client's tunnels Succeeds even if LS validation fails due to unsupported sig type
      Specified by:
        `lookupDestination` in class `NetworkDatabaseFacade`
        `fromLocalDest` - use these tunnels for the lookup, or null for exploratory

    - #### lookupDestinationLocally

          public Destination lookupDestinationLocally(Hash key)

      Description copied from class: `NetworkDatabaseFacade`
      Lookup locally in netDB and in badDest cache Succeeds even if LS validation failed due to unsupported sig type
      Specified by:
        `lookupDestinationLocally` in class `NetworkDatabaseFacade`

    - #### lookupLeaseSet

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

      Specified by:
        `lookupLeaseSet` in class `NetworkDatabaseFacade`

    - #### lookupLeaseSet

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

      Description copied from class: `NetworkDatabaseFacade`
      Lookup using the client's tunnels
      Specified by:
        `lookupLeaseSet` in class `NetworkDatabaseFacade`
        `fromLocalDest` - use these tunnels for the lookup, or null for exploratory

    - #### lookupLeaseSetLocally

          public LeaseSet lookupLeaseSetLocally(Hash key)

      Specified by:
        `lookupLeaseSetLocally` in class `NetworkDatabaseFacade`

    - #### lookupLeaseSetRemotely

          public void lookupLeaseSetRemotely(Hash key,
                                             Hash fromLocalDest)

      Description copied from class: `NetworkDatabaseFacade`
      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.
      Specified by:
        `lookupLeaseSetRemotely` in class `NetworkDatabaseFacade`
        `fromLocalDest` - use these tunnels for the lookup, or null for exploratory

    - #### lookupLeaseSetRemotely

          public void lookupLeaseSetRemotely(Hash key,
                                             Job onFindJob,
                                             Job onFailedLookupJob,
                                             long timeoutMs,
                                             Hash fromLocalDest)

      Description copied from class: `NetworkDatabaseFacade`
      Unconditionally lookup using the client's tunnels.
      Specified by:
        `lookupLeaseSetRemotely` in class `NetworkDatabaseFacade`
        `onFindJob` - may be null
        `onFailedLookupJob` - may be null
        `fromLocalDest` - use these tunnels for the lookup, or null for exploratory

    - #### lookupLocally

          public DatabaseEntry lookupLocally(Hash key)

      Specified by:
        `lookupLocally` in class `NetworkDatabaseFacade`
      Returns:
        RouterInfo, LeaseSet, or null

    - #### lookupLocallyWithoutValidation

          public DatabaseEntry lookupLocallyWithoutValidation(Hash key)

      Description copied from class: `NetworkDatabaseFacade`
      Not for use without validation
      Specified by:
        `lookupLocallyWithoutValidation` in class `NetworkDatabaseFacade`
      Returns:
        RouterInfo, LeaseSet, or null, NOT validated

    - #### lookupRouterInfo

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

      Specified by:
        `lookupRouterInfo` in class `NetworkDatabaseFacade`

    - #### lookupRouterInfoLocally

          public RouterInfo lookupRouterInfoLocally(Hash key)

      Specified by:
        `lookupRouterInfoLocally` in class `NetworkDatabaseFacade`

    - #### publish

          public void publish(LeaseSet localLeaseSet)

      Specified by:
        `publish` in class `NetworkDatabaseFacade`

    - #### publish

          public void publish(RouterInfo localRouterInfo)

      Specified by:
        `publish` in class `NetworkDatabaseFacade`

    - #### restart

          public void restart()

      Description copied from interface: `Service`
      Perform a soft restart.

    - #### shutdown

          public void shutdown()

      Description copied from interface: `Service`
      Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block.

    - #### startup

          public void startup()

      Description copied from interface: `Service`
      Instruct the service that it should start normal operation. This call DOES block until the service is ready.

    - #### store

          public LeaseSet store(Hash key,
                                LeaseSet leaseSet)

      Specified by:
        `store` in class `NetworkDatabaseFacade`
      Returns:
        the leaseSet if another leaseSet already existed at that key

    - #### store

          public RouterInfo store(Hash key,
                                  RouterInfo routerInfo)

      Specified by:
        `store` in class `NetworkDatabaseFacade`
      Returns:
        the routerInfo if another router already existed at that key

    - #### unpublish

          public void unpublish(LeaseSet localLeaseSet)

      Specified by:
        `unpublish` in class `NetworkDatabaseFacade`