java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.HandleDatabaseLookupMessageJob
net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseLookupMessageJob
- All Implemented Interfaces:
Job
Processes database lookup messages received by floodfill routers.
Handles incoming DatabaseLookupMessage requests from remote peers, performing database searches and sending appropriate replies. Extends the base lookup handling with floodfill-specific logic including query acceptance criteria and capability-based response behavior.
Determines whether to answer all queries based on floodfill status and capability flags. When not operating as floodfill, includes the local RouterInfo in responses to inform peers of the capability change and reduce misdirected queries.
Field Summary
Fields inherited from class HandleDatabaseLookupMessageJob
EXPIRE_DELAYModifier and TypeFieldDescriptionstatic final longIf a routerInfo structure isn't this recent, don't send it out.Constructor Summary
ConstructorsConstructorDescriptionHandleFloodfillDatabaseLookupMessageJob(RouterContext ctx, DatabaseLookupMessage receivedMessage, RouterIdentity from, Hash fromHash, long msgIDBloomXor) Creates a new job to handle a floodfill database lookup message.Method Summary
All MethodsMethods inherited from class HandleDatabaseLookupMessageJob
dropped, getName, runJob, sendMessageModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.getName()Descriptive name of the task.voidrunJob()Actually perform the task.protected voidsendMessage(I2NPMessage message, Hash toPeer, TunnelId replyTunnel) Send an I2NP message to the specified peer.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()
Constructor Details
HandleFloodfillDatabaseLookupMessageJob
public HandleFloodfillDatabaseLookupMessageJob(RouterContext ctx, DatabaseLookupMessage receivedMessage, RouterIdentity from, Hash fromHash, long msgIDBloomXor) Creates a new job to handle a floodfill database lookup message.- Parameters:
ctx- the router contextreceivedMessage- the lookup message receivedfrom- the router identity of the senderfromHash- the hash of the sendermsgIDBloomXor- the message ID bloom XOR
Method Details
sendClosest
We extend this here to send our routerInfo back as well, if we are not floodfill. This gets the word out to routers that we are no longer floodfill, so they will stop bugging us.- Overrides:
sendClosestin classHandleDatabaseLookupMessageJob- Parameters:
key- the search keyrouterInfoSet- the set of router hashes to sendtoPeer- the destination peerreplyTunnel- the reply tunnel