java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.PersistentDataStore.ReadRouterJob
All Implemented Interfaces:
Job
Enclosing class:
PersistentDataStore

private class PersistentDataStore.ReadRouterJobextends JobImpl
Reads a single RouterInfo file from disk and stores it in memory.
  • Field Details

    • _routerFile

      private final File _routerFile
      Router file to read.
    • _key

      private final Hash _key
      Hash key of the router.
    • _knownDate

      private long _knownDate
      Published date of the cached entry.
  • Constructor Details

    • ReadRouterJob

      public ReadRouterJob(File routerFile, Hash key)
      Creates a job to read a RouterInfo from disk.
      Parameters:
      routerFile - the on-disk RouterInfo file to read
      key - must match the RI hash in the file
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Job
      Descriptive name of the task.
      Returns:
      the descriptive name of the task
    • shouldRead

      private boolean shouldRead()
      Whether the file is newer than the cached entry.
      Returns:
      true if the file is newer than the cached entry
    • runJob

      public void runJob()
      Read a RouterInfo from disk and load it into memory.
    • read

      public boolean read()
      Reads the RouterInfo from disk.
      Returns:
      true if the RouterInfo was read and stored successfully