java.lang.Object
net.i2p.i2pcontrol.servlets.jsonrpc2handlers.EchoHandler
- All Implemented Interfaces:
RequestHandler
JSON-RPC2 handler for the Echo method. Returns the provided echo string as a simple test mechanism for the I2PControl API.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JSONRPC2HelperChecks the token a request carries.private static final String[]The argument names this method requires.Constructor Summary
ConstructorsConstructorDescriptionEchoHandler(JSONRPC2Helper helper) Retains the shared helper used to validate Echo request parameters.Method Summary
All MethodsModifier and TypeMethodDescriptionString[]Method names this handler services.process(JSONRPC2Request req, MessageContext ctx) Process an Echo request
Field Details
requiredArgs
The argument names this method requires._helper
Checks the token a request carries.
Constructor Details
EchoHandler
Retains the shared helper used to validate Echo request parameters.- Parameters:
helper- shared I2PControl helper used to validate request parameters
Method Details
handledRequests
Method names this handler services.- Specified by:
handledRequestsin interfaceRequestHandler- Returns:
- method names handled by this handler
process
Process an Echo 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.