java.lang.Object
net.i2p.router.networkdb.kademlia.SearchJob.Search
Enclosing class:
SearchJob

private static class SearchJob.Searchextends Object
Holds callbacks and expiration for a deferred search.
  • Field Details

    • _onFind

      private final Job _onFind
      On find.
    • _onFail

      private final Job _onFail
      On fail.
    • _expiration

      private final long _expiration
      Expiration time.
  • Constructor Details

    • Search

      public Search(Job onFind, Job onFail, long expiration, boolean isLease)
      Search callbacks and deadline.
      Parameters:
      onFind - success callback
      onFail - failure callback
      expiration - when the search expires, on the context clock
      isLease - whether target is a LeaseSet
  • Method Details

    • getOnFind

      public Job getOnFind()
      The job scheduled when the search finds the hash.
      Returns:
      the job to run on success, null if there is none
    • getOnFail

      public Job getOnFail()
      The job scheduled when the search fails.
      Returns:
      the job to run on failure, null if there is none
    • getExpiration

      public long getExpiration()
      When the search is abandoned if nothing has answered.
      Returns:
      the deadline, in ms