net.i2p.router.networkdb.kademlia

## Class HandleFloodfillDatabaseLookupMessageJob

- java.lang.Object
- - net.i2p.router.JobImpl
  - - net.i2p.router.networkdb.HandleDatabaseLookupMessageJob
    - - net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseLookupMessageJob

- All Implemented Interfaces:
    Job

      public class HandleFloodfillDatabaseLookupMessageJob
      extends HandleDatabaseLookupMessageJob

  Processes database lookup messages received by floodfill routers.

  Handles incoming DatabaseLookupMessage requests from remote peers, performing database searches and sending appropriate replies. Extends the base lookup handling with floodfill-specific logic including query acceptance criteria and capability-based response behavior.

  Determines whether to answer all queries based on floodfill status and capability flags. When not operating as floodfill, includes the local RouterInfo in responses to inform peers of the capability change and reduce misdirected queries.

- - ### Field Summary

    - ### Fields inherited from class net.i2p.router.networkdb.HandleDatabaseLookupMessageJob

      `EXPIRE_DELAY`

    - ### Fields inherited from class net.i2p.router.JobImpl

      `_id`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HandleFloodfillDatabaseLookupMessageJob(RouterContext ctx, DatabaseLookupMessage receivedMessage, RouterIdentity from, Hash fromHash, long msgIDBloomXor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `answerAllQueries()`
    `protected void` | `sendClosest(Hash key, Set<Hash> routerInfoSet, Hash toPeer, TunnelId replyTunnel)` We extend this here to send our routerInfo back as well, if we are not floodfill.

    - ### Methods inherited from class net.i2p.router.networkdb.HandleDatabaseLookupMessageJob

      `dropped, getName, runJob, sendMessage`

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

      `getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toString`

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

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

- - ### Constructor Detail

    - #### HandleFloodfillDatabaseLookupMessageJob

          public HandleFloodfillDatabaseLookupMessageJob(RouterContext ctx,
                                                         DatabaseLookupMessage receivedMessage,
                                                         RouterIdentity from,
                                                         Hash fromHash,
                                                         long msgIDBloomXor)

  - ### Method Detail

    - #### answerAllQueries

          protected boolean answerAllQueries()

      Overrides:
        `answerAllQueries` in class `HandleDatabaseLookupMessageJob`
      Returns:
        are we floodfill We don't really answer all queries if this is true, since floodfills don't have the whole keyspace any more, see ../HTLMJ for discussion

    - #### sendClosest

          protected void sendClosest(Hash key,
                                     Set<Hash> routerInfoSet,
                                     Hash toPeer,
                                     TunnelId replyTunnel)

      We extend this here to send our routerInfo back as well, if we are not floodfill. This gets the word out to routers that we are no longer floodfill, so they will stop bugging us.
      Overrides:
        `sendClosest` in class `HandleDatabaseLookupMessageJob`