java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.PublishLocalRouterInfoJob
All Implemented Interfaces:
Job

public class PublishLocalRouterInfoJobextends JobImpl
Publish the local router's RouterInfo periodically. NOTE - this also creates and signs the RI. This is run immediately at startup... but doesn't really send to the floodfills until the second time it runs.
  • Field Details

    • _log

      private final Log _log
      Logger for this class.
    • MIN_PUBLISH_DELAY

      private static final long MIN_PUBLISH_DELAY
      Don't store if somebody else stored it recently. Publishes within this window of the last store are skipped; the normal publish interval from getDelay() is 7-11 minutes.
      See Also:
    • PUBLISH_DELAY

      private static final long PUBLISH_DELAY
      Too short and the network puts a big connection load on the floodfills since we store directly. Too long and the floodfill will drop us - timeout is 60 minutes.
      See Also:
    • _runCount

      private final AtomicInteger _runCount
      Long enough to give us time to start up, but less than 20m, when we start accepting tunnels and could be an IBGW. Actually, we need this soon if we are a new router or other routers have forgotten about us, else we can't build IB exploratory tunnels.

      First publish after netdb ready is now done via state machine in Router.setNetDbReady(), so we probably don't need this anymore.

  • Constructor Details

    • PublishLocalRouterInfoJob

      public PublishLocalRouterInfoJob(RouterContext ctx)
      Sets up the job and its logger from the given router context.
      Parameters:
      ctx - the router context whose log manager supplies the job logger
  • Method Details

    • getName

      public String getName()
      Name of this job.
      Returns:
      the name this job is listed under in the job queue
    • runJob

      public void runJob()
      Publish the local RouterInfo, or requeue if it is not yet time.
    • getDelay

      public long getDelay()
      Delay until the next RouterInfo publish.
      Returns:
      how long to wait before publishing again, in milliseconds, randomised within a third of PUBLISH_DELAY and then divided by four