All Implemented Interfaces:
Runnable

public class Republishextends SimpleTimer2.TimedEvent
Router information publisher for network database synchronization.

This class periodically publishes the router's RouterInfo to the distributed network database (netdb) to ensure the router remains discoverable and reachable by other peers. Regular publication is essential for maintaining network connectivity and participation.

Publication Process:

  • Retrieves current RouterInfo from router
  • Validates RouterInfo integrity and timestamps
  • Publishes to floodfill peers in network database
  • Handles clock skew and timestamp issues
  • Triggers identity rebuild if needed

Error Handling:

  • Detects and handles clock skew issues
  • Rebuilds router identity on validation failures
  • Logs detailed error information for debugging
  • Recovers from temporary network issues

Clock Skew Detection:

  • Detects large time discrepancies (>60 seconds)
  • Rebuilds RouterInfo with current time
  • Prevents network database rejection
  • Maintains router identity continuity

Network Integration:

  • Ensures router remains discoverable by peers
  • Maintains up-to-date routing information
  • Supports network topology and routing
  • Enables tunnel building and peer connections

Regular publication is critical for router participation in the I2P network. Without periodic republishing, routers would become unreachable and unable to participate in tunnel creation or network routing.

  • Field Details

    • _context

      private final RouterContext _context
      The router whose router info is republished.
  • Constructor Details

    • Republish

      public Republish(RouterContext ctx)
      Create a new router info republisher.
      Parameters:
      ctx - the router context for accessing router services
  • Method Details

    • timeReached

      public void timeReached()
      Publish the router's info to the network database.

      Retrieves the current RouterInfo and publishes it to the netdb. If the RouterInfo is invalid (due to clock skew or other issues), attempts to rebuild the router identity.

      This method handles clock skew detection and will trigger a router identity rebuild if significant time discrepancies are detected.

      Specified by:
      timeReached in class SimpleTimer2.TimedEvent