public class FloodfillDatabaseLookupMessageHandler extends Object implements HandlerJobBuilder
This class verifies incoming lookup messages, applies throttling and banning policies, and builds appropriate jobs for accepted lookups. Unacceptable lookups are logged and dropped.
It tracks lookup statistics such as received, dropped, handled, and matched lookups via the statManager.
Supports floodfill and non-floodfill router modes, with special handling for floodfill peers and exploratory lookups.
| Constructor and Description |
|---|
FloodfillDatabaseLookupMessageHandler(RouterContext context,
FloodfillNetworkDatabaseFacade facade)
Constructs a new handler for floodfill DatabaseLookupMessages.
|
| Modifier and Type | Method and Description |
|---|---|
Job |
createJob(I2NPMessage receivedMessage,
RouterIdentity from,
Hash fromHash)
Creates a job to handle an incoming DatabaseLookupMessage, or returns null if the lookup should be dropped.
|
public FloodfillDatabaseLookupMessageHandler(RouterContext context, FloodfillNetworkDatabaseFacade facade)
context - the router context providing system state and utilitiesfacade - the network database facade used for lookup management and throttlingpublic Job createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash)
This method performs several checks, including: floodfill participation, sender identity, whether the lookup is for this router, throttling, banning, and lookup type compatibility. Logs details about accepted or dropped lookups and updates statistics.
createJob in interface HandlerJobBuilderreceivedMessage - the incoming message, expected to be a DatabaseLookupMessagefrom - the identity of the sender routerfromHash - the hash of the sender routerClassCastException - if receivedMessage is not a DatabaseLookupMessage