java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.SearchUpdateReplyFoundJob
All Implemented Interfaces:
Job, ReplyJob

class SearchUpdateReplyFoundJobextends JobImpl implements ReplyJob
Called after a match to a db search is found

Used only by SearchJob which is only ExploreJobploreJob.

  • Field Details

    • _log

      private final Log _log
      The log for the search update.
    • _message

      private I2NPMessage _message
      The reply message that was found.
    • _peer

      private final Hash _peer
      The hash of the searched peer.
    • _state

      private final SearchState _state
      The state of the search.
    • _facade

      private final KademliaNetworkDatabaseFacade _facade
      The network database facade.
    • _job

      private final SearchJob _job
      The search job being updated.
    • _outTunnel

      private final TunnelInfo _outTunnel
      The tunnel the request was sent through.
    • _replyTunnel

      private final TunnelInfo _replyTunnel
      The tunnel the reply came back through.
    • _isFloodfillPeer

      private final boolean _isFloodfillPeer
      True if the peer is a floodfill.
    • _sentOn

      private final long _sentOn
      When the request was sent.
  • Constructor Details

    • SearchUpdateReplyFoundJob

      public SearchUpdateReplyFoundJob(RouterContext context, RouterInfo peer, SearchState state, KademliaNetworkDatabaseFacade facade, SearchJob job)
      Create job with no tunnel info.
      Parameters:
      context - the router context supplying the log and the network database facade
      peer - the peer that returned the matching database reply
      state - the search this job continues
      facade - the network database facade to store the found entry in
      job - the search job to tell when the reply has been handled
    • SearchUpdateReplyFoundJob

      public SearchUpdateReplyFoundJob(RouterContext context, RouterInfo peer, SearchState state, KademliaNetworkDatabaseFacade facade, SearchJob job, TunnelInfo outTunnel, TunnelInfo replyTunnel)
      Create job with tunnel info for reply routing.
      Parameters:
      context - the router context supplying the log and the network database facade
      peer - the peer that returned the matching database reply
      state - the search this job continues
      facade - the network database facade to store the found entry in
      job - the search job to tell when the reply has been handled
      outTunnel - the tunnel the original search request went out on, used to reply over the same path
      replyTunnel - the tunnel to send the reply back over, or null to let the job build one from the peer's RouterInfo
  • Method Details

    • getName

      public String getName()
      Name of this job.
      Specified by:
      getName in interface Job
      Returns:
      the fixed label "Update Kademlia Search Reply Found " (note the trailing space), used to identify this job in logs and statistics
    • runJob

      public void runJob()
      Process the store message and continue the search.
      Specified by:
      runJob in interface Job
    • setMessage

      public void setMessage(I2NPMessage message)
      Store the matched message, then continue the search.
      Specified by:
      setMessage in interface ReplyJob
      Parameters:
      message - the received I2NP message