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

class HandleFloodfillDatabaseStoreMessageJobextends JobImpl
Processes and stores DatabaseStoreMessage data in the floodfill network database.

Handles incoming database store operations for both RouterInfo and LeaseSet entries with comprehensive validation, filtering, and storage logic. Implements sophisticated acceptance criteria including version checks, capability validation, reachability assessment, and distance-based routing for floodfill operations.

Provides DOS protection through throttling, banlist enforcement, and probabilistic dropping based on database load and peer characteristics. Supports both floodfill and client database contexts with role-specific handling for each entry type.

Manages acknowledgment responses, data flooding to other floodfills, and maintains detailed statistics for store operation performance and security.

  • Field Details

    • _log

      private final Log _log
      Logger for the floodfill store job.
    • _banLogger

      private final BanLogger _banLogger
      Logs the misbehaving routers.
    • _message

      private final DatabaseStoreMessage _message
      The store message being handled.
    • _from

      private final RouterIdentity _from
      The sender's router identity.
    • _fromHash

      private Hash _fromHash
      The sender's hash, computed when needed.
    • _facade

      private final FloodfillNetworkDatabaseFacade _facade
      The floodfill network database.
    • REPLY_TIMEOUT

      private static final int REPLY_TIMEOUT
      Time allowed for the sender's reply.
      See Also:
    • MESSAGE_PRIORITY

      private static final int MESSAGE_PRIORITY
      Send priority of the store replies.
      See Also:
    • LIMIT_ROUTERS

      private static final int LIMIT_ROUTERS
      Most routers the entry is sent to, lower than the explorers' limit since exploration registers no reply job.
    • _msgIDBloomXor

      private final long _msgIDBloomXor
      The bloom filter XOR of the message ids.
    • RESEND_DELAY

      private static final int RESEND_DELAY
      Delay before a reply is resent.
      See Also:
  • Constructor Details

    • HandleFloodfillDatabaseStoreMessageJob

      public HandleFloodfillDatabaseStoreMessageJob(RouterContext ctx, DatabaseStoreMessage receivedMessage, RouterIdentity from, Hash fromHash, FloodfillNetworkDatabaseFacade facade, long msgIDBloomXor)
      Handle an incoming floodfill DatabaseStoreMessage.
      Parameters:
      ctx - router context supplying the log manager and base job services
      receivedMessage - must never have reply token set if it came down a tunnel
      from - identity of the sending router, may be null if the hash is known
      fromHash - hash of the sending router, used to decide unsolicited stores
      facade - floodfill database the message is stored in
      msgIDBloomXor - XOR of the requester's bloom filter, replayed on any reply
  • Method Details

    • runJob

      public void runJob()
      Description copied from interface: Job
      Actually perform the task. This call blocks until the Job is complete.
    • sendAck

      private void sendAck(Hash storedKey)
      Sends the store reply to the sender.
      Parameters:
      storedKey - the key that was stored
    • getName

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

      public void dropped()
      Description copied from class: JobImpl
      Default implementation does nothing. Called when the job is dropped due to router overload. Subclasses can override to perform cleanup or requeueing of other tasks.
      Specified by:
      dropped in interface Job
      Overrides:
      dropped in class JobImpl