net.i2p.router.networkdb

## Class HandleDatabaseLookupMessageJob

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

- All Implemented Interfaces:
    Job
  Direct Known Subclasses:
    HandleFloodfillDatabaseLookupMessageJob

      public class HandleDatabaseLookupMessageJob
      extends JobImpl

  Handle a lookup for a key received from a remote peer. Needs to be implemented to send back replies, etc Unused directly - see kademlia/ for extension

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `EXPIRE_DELAY` If a routerInfo structure isn't this recent, don't send it out.

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

      `_id`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HandleDatabaseLookupMessageJob(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()`
    `void` | `dropped()` Default implementation does nothing.
    `String` | `getName()` Descriptive name of the task
    `void` | `runJob()` Actually perform the task.
    `protected void` | `sendClosest(Hash key, Set<Hash> routerHashes, Hash toPeer, TunnelId replyTunnel)`
    `protected void` | `sendMessage(I2NPMessage message, Hash toPeer, TunnelId replyTunnel)`

    - ### 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`

- - ### Field Detail

    - #### EXPIRE_DELAY

          public static final long EXPIRE_DELAY

      If a routerInfo structure isn't this recent, don't send it out. Equal to KNDF.ROUTER_INFO_EXPIRATION_FLOODFILL.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HandleDatabaseLookupMessageJob

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

  - ### Method Detail

    - #### answerAllQueries

          protected boolean answerAllQueries()

    - #### dropped

          public void dropped()

      Description copied from class: `JobImpl`
      Default implementation does nothing. Called when the job is dropped due to router overload. Subclasses can override to perform cleanup or requeueing of other tasks.
      Specified by:
        `dropped` in interface `Job`
      Overrides:
        `dropped` in class `JobImpl`

    - #### getName

          public String getName()

      Description copied from interface: `Job`
      Descriptive name of the task
      Returns:
        the descriptive name of the task

    - #### runJob

          public void runJob()

      Description copied from interface: `Job`
      Actually perform the task. This call blocks until the Job is complete.

    - #### sendClosest

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

    - #### sendMessage

          protected void sendMessage(I2NPMessage message,
                                     Hash toPeer,
                                     TunnelId replyTunnel)