java.lang.Object
net.i2p.i2pcontrol.servlets.jsonrpc2handlers.NetworkSettingHandler
- All Implemented Interfaces:
RequestHandler
JSON-RPC2 handler for the NetworkSetting method. Manages router network configuration including transport ports, hostnames, bandwidth settings, and UPnP.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router being configured.private final JSONRPC2HelperReads the request's arguments.private static final intPercent of the limit the burst allowance gives.private static final intBurst allowance window, in seconds.Constructor Summary
ConstructorsConstructorDescriptionNetworkSettingHandler(RouterContext ctx, JSONRPC2Helper helper) Retains the router context and helper used to manage the settings.Method Summary
Modifier and TypeMethodDescriptionString[]Method names this handler services.private JSONRPC2Responseprocess(JSONRPC2Request req) Applies or reports the network settings.process(JSONRPC2Request req, MessageContext ctx) Process a NetworkSetting request
Field Details
BW_BURST_PCT
private static final int BW_BURST_PCTPercent of the limit the burst allowance gives.- See Also:
BW_BURST_TIME
private static final int BW_BURST_TIMEBurst allowance window, in seconds.- See Also:
_helper
Reads the request's arguments._context
The router being configured.
Constructor Details
NetworkSettingHandler
Retains the router context and helper used to manage the settings.- Parameters:
ctx- the router context supplying the network configuration to managehelper- the shared helper used to build JSONRPC2 responses and access settings
Method Details
handledRequests
Method names this handler services.- Specified by:
handledRequestsin interfaceRequestHandler- Returns:
- method names handled by this handler
process
Process a NetworkSetting request- Specified by:
processin interfaceRequestHandler- Parameters:
req- A valid JSON-RPC 2.0 request instance. Must not benull.ctx- Context information about the request message, may benullif undefined.- Returns:
- The resulting JSON-RPC 2.0 response. It indicates success or an error, such as METHOD_NOT_FOUND.
process
Applies or reports the network settings.- Parameters:
req- the request to answer- Returns:
- the reply to send