Class JSONRPC2Helper
- java.lang.Object
-
- net.i2p.i2pcontrol.servlets.jsonrpc2handlers.JSONRPC2Helper
-
public class JSONRPC2Helper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Boolean
USE_AUTH
static Boolean
USE_NO_AUTH
-
Constructor Summary
Constructors Constructor Description JSONRPC2Helper(SecurityManager secMan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSONRPC2Error
validateParams(String[] requiredArgs, JSONRPC2Request req)
Check incoming request for required arguments, to make sure they are valid.JSONRPC2Error
validateParams(String[] requiredArgs, JSONRPC2Request req, Boolean useAuth)
Check incoming request for required arguments, to make sure they are valid.
-
-
-
Constructor Detail
-
JSONRPC2Helper
public JSONRPC2Helper(SecurityManager secMan)
-
-
Method Detail
-
validateParams
public JSONRPC2Error validateParams(String[] requiredArgs, JSONRPC2Request req, Boolean useAuth)
Check incoming request for required arguments, to make sure they are valid.- Parameters:
requiredArgs
- - Array of names of required arguments. If null don't check for any parameters.req
- - Incoming JSONRPC2 requestuseAuth
- - If true, will validate authentication token.- Returns:
- - null if no errors were found. Corresponding JSONRPC2Error if error is found.
-
validateParams
public JSONRPC2Error validateParams(String[] requiredArgs, JSONRPC2Request req)
Check incoming request for required arguments, to make sure they are valid. Will authenticate req.- Parameters:
requiredArgs
- - Array of names of required arguments. If null don't check for any parameters.req
- - Incoming JSONRPC2 request- Returns:
- - null if no errors were found. Corresponding JSONRPC2Error if error is found.
-
-