java.lang.Object
net.i2p.i2pcontrol.servlets.jsonrpc2handlers.I2PControlHandler
- All Implemented Interfaces:
RequestHandler
JSON-RPC2 handler for the I2PControl method. Manages I2PControl service settings, primarily handling password changes for the control interface.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JSONRPC2HelperChecks the token a request carries.private final SecurityManagerThe manager that validates request tokens.Constructor Summary
ConstructorsConstructorDescriptionI2PControlHandler(JSONRPC2Helper helper, SecurityManager secMan) I2PControlHandler.Method Summary
Modifier and TypeMethodDescriptionString[]Method names this handler services.private JSONRPC2Responseprocess(JSONRPC2Request req) Runs one JSON-RPC request and returns its reply.process(JSONRPC2Request req, MessageContext ctx) Process an I2PControl request
Field Details
_secMan
The manager that validates request tokens._helper
Checks the token a request carries.
Constructor Details
I2PControlHandler
I2PControlHandler.- Parameters:
helper- the JSON-RPC2 helper used to build responses and check authenticationsecMan- the security manager holding the control interface password hash
Method Details
handledRequests
Method names this handler services.- Specified by:
handledRequestsin interfaceRequestHandler- Returns:
- method names handled by this handler
process
Process an I2PControl 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
Runs one JSON-RPC request and returns its reply.- Parameters:
req- the request to run- Returns:
- the reply to send back