java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.client.LookupDestJob
All Implemented Interfaces:
Job

class LookupDestJobextends JobImpl
Look up the lease of a hash, to convert it to a Destination for the client. Or, since 0.9.11, lookup a host name in the naming service.
  • Field Details

    • _log

      private final Log _log
      Logger for the destination lookup job.
    • _runner

      private final ClientConnectionRunner _runner
      The client runner that asked for the lookup.
    • _reqID

      private final long _reqID
      The client request id to reply to.
    • _timeout

      private final long _timeout
      Time allowed for the lookup.
    • _hash

      private final Hash _hash
      The hash being looked up.
    • _name

      private final String _name
      The local name to look up, null if a hash was given.
    • _sessID

      private final SessionId _sessID
      The session that asked for the lookup.
    • _fromLocalDest

      private final Hash _fromLocalDest
      The local destination to search from, null if none.
    • _blindData

      private final BlindData _blindData
      The blinded lookup data, null if not blinded.
    • DEFAULT_TIMEOUT

      private static final long DEFAULT_TIMEOUT
      Time allowed for a lookup unless given one.
      See Also:
  • Constructor Details

    • LookupDestJob

      public LookupDestJob(RouterContext context, ClientConnectionRunner runner, Hash h, Hash fromLocalDest)
      Create a lookup job with the default timeout.
      Parameters:
      context - the router context
      runner - the client connection requesting the lookup
      h - the destination hash to look up
      fromLocalDest - the local destination to send the reply to, or null
    • LookupDestJob

      public LookupDestJob(RouterContext context, ClientConnectionRunner runner, long reqID, long timeout, SessionId sessID, Hash h, String name, Hash fromLocalDest)
      One of h or name non-null.

      For hash or b32 name, the dest will be returned if the LS can be found, even if the dest uses unsupported crypto.

      Parameters:
      context - the router context the job runs against
      runner - the connection the resolved LeaseSet is handed to, or null if the caller only wants the lookup performed
      reqID - must be >= 0 if name != null
      timeout - how long to wait for the LeaseSet or the name lookup, in milliseconds; DEFAULT_TIMEOUT (15000) is used by the short constructor
      sessID - must non-null if reqID >= 0
      h - the destination hash to look up, mutually exclusive with name
      name - the base32 host name to resolve through the naming service, mutually exclusive with h
      fromLocalDest - use these tunnels for the lookup, or null for exploratory
  • Method Details

    • getName

      public String getName()
      Return the name.
      Returns:
      the descriptive name of the task
    • runJob

      public void runJob()
      Execute the job.
    • returnDest

      private void returnDest(Destination d)
      Sends the destination found to the client.
      Parameters:
      d - the destination to return, null if none was found
    • returnFail

      private void returnFail()
      Return the request ID or failed hash so the client can correlate replies with requests.
    • returnFail

      private void returnFail(int code)
      Return the request ID or failed hash so the client can correlate replies with requests.
      Parameters:
      code - failure code, greater than zero, only used for HostReplyMessage