java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseStoreMessageJob
- All Implemented Interfaces:
Job
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final BanLoggerLogs the misbehaving routers.private final FloodfillNetworkDatabaseFacadeThe floodfill network database.private final RouterIdentityThe sender's router identity.private HashThe sender's hash, computed when needed.private final LogLogger for the floodfill store job.private final DatabaseStoreMessageThe store message being handled.private final longThe bloom filter XOR of the message ids.private static final intMost routers the entry is sent to, lower than the explorers' limit since exploration registers no reply job.private static final intSend priority of the store replies.private static final intTime allowed for the sender's reply.private static final intDelay before a reply is resent.Constructor Summary
ConstructorsConstructorDescriptionHandleFloodfillDatabaseStoreMessageJob(RouterContext ctx, DatabaseStoreMessage receivedMessage, RouterIdentity from, Hash fromHash, FloodfillNetworkDatabaseFacade facade, long msgIDBloomXor) Handle an incoming floodfill DatabaseStoreMessage.Method Summary
Methods inherited from class JobImpl
getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionfinal RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Field Details
_log
Logger for the floodfill store job._banLogger
Logs the misbehaving routers._message
The store message being handled._from
The sender's router identity._fromHash
The sender's hash, computed when needed._facade
The floodfill network database.REPLY_TIMEOUT
private static final int REPLY_TIMEOUTTime allowed for the sender's reply.- See Also:
MESSAGE_PRIORITY
private static final int MESSAGE_PRIORITYSend priority of the store replies.- See Also:
LIMIT_ROUTERS
private static final int LIMIT_ROUTERSMost routers the entry is sent to, lower than the explorers' limit since exploration registers no reply job._msgIDBloomXor
private final long _msgIDBloomXorThe bloom filter XOR of the message ids.RESEND_DELAY
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 servicesreceivedMessage- must never have reply token set if it came down a tunnelfrom- identity of the sending router, may be null if the hash is knownfromHash- hash of the sending router, used to decide unsolicited storesfacade- floodfill database the message is stored inmsgIDBloomXor- XOR of the requester's bloom filter, replayed on any reply
Method Details
runJob
public void runJob()Description copied from interface:JobActually perform the task. This call blocks until the Job is complete.sendAck
Sends the store reply to the sender.- Parameters:
storedKey- the key that was stored
getName
dropped