Packages that use JSONRPC2Error
Package
Description
Classes to represent, parse and serialise JSON-RPC 2.0 requests, notifications and responses.
Utility classes for typed retrieval of JSON-RPC 2.0 request parameters on the server side.
I2P Control JSON-RPC 2.0 method handlers: API version, router parameters, statistics and log access.
Uses of JSONRPC2Error in com.thetransactioncompany.jsonrpc2
Fields in com.thetransactioncompany.jsonrpc2 declared as JSONRPC2ErrorModifier and TypeFieldDescriptionprivate JSONRPC2ErrorJSONRPC2Response.errorThe error object.static final JSONRPC2ErrorJSONRPC2Error.INTERNAL_ERRORInternal JSON-RPC 2.0 error (-32603).static final JSONRPC2ErrorJSONRPC2Error.INVALID_PARAMSInvalid parameters error (-32602).static final JSONRPC2ErrorJSONRPC2Error.INVALID_REQUESTInvalid JSON-RPC 2.0 request error (-32600).static final JSONRPC2ErrorJSONRPC2Error.METHOD_NOT_FOUNDMethod not found error (-32601).static final JSONRPC2ErrorJSONRPC2Error.PARSE_ERRORJSON parse error (-32700).Methods in com.thetransactioncompany.jsonrpc2 that return JSONRPC2ErrorModifier and TypeMethodDescriptionJSONRPC2Error.appendMessage(String apx) Appends the specified string to the message of this JSON-RPC 2.0 error.JSONRPC2Response.getError()Gets the error object indicating the cause of the request failure.Sets the specified data to a JSON-RPC 2.0 error.Methods in com.thetransactioncompany.jsonrpc2 with parameters of type JSONRPC2ErrorModifier and TypeMethodDescriptionvoidJSONRPC2Response.setError(JSONRPC2Error error) Indicates a failed JSON-RPC 2.0 request and sets the error details.Constructors in com.thetransactioncompany.jsonrpc2 with parameters of type JSONRPC2ErrorModifierConstructorDescriptionJSONRPC2Response(JSONRPC2Error error, Object id) Creates a new JSON-RPC 2.0 response to a failed request.Uses of JSONRPC2Error in com.thetransactioncompany.jsonrpc2.util
Methods in com.thetransactioncompany.jsonrpc2.util that return JSONRPC2ErrorModifier and TypeMethodDescriptionprivate static JSONRPC2ErrorNamedParamsRetriever.newArrayException(String name) Creates a JSON-RPC 2.0 error indicating an array exception.private static JSONRPC2ErrorPositionalParamsRetriever.newArrayException(int position) Creates a JSON-RPC 2.0 error indicating an array exception.private static JSONRPC2ErrorNamedParamsRetriever.newUnexpectedParameterTypeException(String name) Creates a JSON-RPC 2.0 error indicating a named parameter with an unexpected JSON type.private static JSONRPC2ErrorPositionalParamsRetriever.newUnexpectedParameterTypeException(int position) Creates a JSON-RPC 2.0 error indicating a positional parameter with an unexpected JSON type.Methods in com.thetransactioncompany.jsonrpc2.util that throw JSONRPC2ErrorModifier and TypeMethodDescriptionvoidNamedParamsRetriever.ensureParam(String name) /** Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter by the specified name.<T> voidNamedParamsRetriever.ensureParam(String name, Class<T> clazz) Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter by the specified name, its value isnull, or its type doesn't map to the specified.<T> voidNamedParamsRetriever.ensureParam(String name, Class<T> clazz, boolean allowNull) Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter by the specified name or its type doesn't map to the specified.voidPositionalParamsRetriever.ensureParam(int position) Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter at the specified position.<T> voidPositionalParamsRetriever.ensureParam(int position, Class<T> clazz) Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter at the specified position, its value isnull, or its type doesn't map to the specified.<T> voidPositionalParamsRetriever.ensureParam(int position, Class<T> clazz, boolean allowNull) Throws aJSONRPC2Error.INVALID_PARAMSexception if there is no parameter at the specified position or its type doesn't map to the specified.voidNamedParamsRetriever.ensureParams(String[] mandatoryNames) Throws aJSONRPC2Error.INVALID_PARAMSif the specified names aren't present in the parameters, or names outside the specified are contained.voidNamedParamsRetriever.ensureParams(String[] mandatoryNames, String[] optionalNames) /** Throws aJSONRPC2Error.INVALID_PARAMSif the specified mandatory names aren't contained in the parameters, or names outside the specified mandatory and optional are present.Retrieves the specified parameter which can be of any type.<T> TRetrieves the specified parameter which must map to the provided class (use the appropriate wrapper class for primitive types).<T> TRetrieves the specified parameter which must map to the provided class (use the appropriate wrapper class for primitive types).PositionalParamsRetriever.get(int position) Retrieves the specified parameter which can be of any type.<T> TRetrieves the specified parameter which must map to the provided class (use the appropriate wrapper class for primitive types).<T> TRetrieves the specified parameter which must map to the provided class (use the appropriate wrapper class for primitive types).booleanNamedParamsRetriever.getBoolean(String name) Retrieves the specified boolean (maps from JSON true/false) parameter.booleanPositionalParamsRetriever.getBoolean(int position) Retrieves the specified boolean (maps from JSON true/false) parameter.doubleRetrieves the specified numeric parameter as adouble.doublePositionalParamsRetriever.getDouble(int position) Retrieves the specified numeric parameter as adouble.<T extends Enum<T>>
TRetrieves the specified enumerated parameter (from a JSON string that has a predefined set of possible values).<T extends Enum<T>>
TRetrieves the specified enumerated parameter (from a JSON string that has a predefined set of possible values), allowing for a case insensitive match.<T extends Enum<T>>
TRetrieves the specified enumerated parameter (from a JSON string that has a predefined set of possible values).<T extends Enum<T>>
TRetrieves the specified enumerated parameter (from a JSON string that has a predefined set of possible values), allowing for a case insensitive match.NamedParamsRetriever.getEnumString(String name, String[] enumStrings) Retrieves the specified enumerated string parameter.NamedParamsRetriever.getEnumString(String name, String[] enumStrings, boolean ignoreCase) Retrieves the specified enumerated string parameter, allowing for a case insenstive match.PositionalParamsRetriever.getEnumString(int position, String[] enumStrings) Retrieves the specified enumerated string parameter.PositionalParamsRetriever.getEnumString(int position, String[] enumStrings, boolean ignoreCase) Retrieves the specified enumerated string parameter, allowing for a case insensitive match.floatRetrieves the specified numeric parameter as afloat.floatPositionalParamsRetriever.getFloat(int position) Retrieves the specified numeric parameter as afloat.intRetrieves the specified numeric parameter as anint.intPositionalParamsRetriever.getInt(int position) Retrieves the specified numeric parameter as anint.Retrieves the specified list (maps from JSON array) parameter.Retrieves the specified list (maps from JSON array) parameter.PositionalParamsRetriever.getList(int position) Retrieves the specified list (maps from JSON array) parameter.PositionalParamsRetriever.getList(int position, boolean allowNull) Retrieves the specified list (maps from JSON array) parameter.longRetrieves the specified numeric parameter as along.longPositionalParamsRetriever.getLong(int position) Retrieves the specified numeric parameter as along.Retrieves the specified map (maps from JSON object) parameter.Retrieves the specified map (maps from JSON object) parameter.PositionalParamsRetriever.getMap(int position) Retrieves the specified map (maps from JSON object) parameter.PositionalParamsRetriever.getMap(int position, boolean allowNull) Retrieves the specified map (maps from JSON object) parameter.<T> TRetrieves the specified optional parameter which must map to the provided class (use the appropriate wrapper class for primitive types).<T> TRetrieves the specified optional parameter which must map to the provided class (use the appropriate wrapper class for primitive types).<T> TRetrieves the specified optional parameter which must map to the provided class (use the appropriate wrapper class for primitive types).<T> TRetrieves the specified optional parameter which must map to the provided class (use the appropriate wrapper class for primitive types).booleanNamedParamsRetriever.getOptBoolean(String name, boolean defaultValue) Retrieves the specified optional boolean (maps from JSON true/false) parameter.booleanPositionalParamsRetriever.getOptBoolean(int position, boolean defaultValue) Retrieves the specified optional boolean (maps from JSON true/false) parameter.doubleNamedParamsRetriever.getOptDouble(String name, double defaultValue) Retrieves the specified optional numeric parameter as adouble.doublePositionalParamsRetriever.getOptDouble(int position, double defaultValue) Retrieves the specified optional numeric parameter as adouble.<T extends Enum<T>>
TNamedParamsRetriever.getOptEnum(String name, Class<T> enumClass, T defaultValue) Retrieves the specified optional enumerated parameter (from a JSON string that has a predefined set of possible values).<T extends Enum<T>>
TNamedParamsRetriever.getOptEnum(String name, Class<T> enumClass, T defaultValue, boolean ignoreCase) Retrieves the specified optional enumerated parameter (from a JSON string that has a predefined set of possible values), allowing for a case insenstive match.<T extends Enum<T>>
TPositionalParamsRetriever.getOptEnum(int position, Class<T> enumClass, String defaultValue) Retrieves the specified optional enumerated parameter (from a JSON string that has a predefined set of possible values).<T extends Enum<T>>
TPositionalParamsRetriever.getOptEnum(int position, Class<T> enumClass, String defaultValue, boolean ignoreCase) Retrieves the specified optional enumerated parameter (from a JSON string that has a predefined set of possible values), allowing for a case insensitive match.NamedParamsRetriever.getOptEnumString(String name, String[] enumStrings, String defaultValue) Retrieves the specified optional enumerated string parameter.NamedParamsRetriever.getOptEnumString(String name, String[] enumStrings, String defaultValue, boolean ignoreCase) Retrieves the specified optional enumerated string parameter, allowing for a case insenstive match.PositionalParamsRetriever.getOptEnumString(int position, String[] enumStrings, String defaultValue) Retrieves the specified optional enumerated string parameter.PositionalParamsRetriever.getOptEnumString(int position, String[] enumStrings, String defaultValue, boolean ignoreCase) Retrieves the specified optional enumerated string parameter, allowing for a case insensitive match.floatNamedParamsRetriever.getOptFloat(String name, float defaultValue) Retrieves the specified optional numeric parameter as afloat.floatPositionalParamsRetriever.getOptFloat(int position, float defaultValue) Retrieves the specified optional numeric parameter as afloat.intRetrieves the specified optional numeric parameter as anint.intPositionalParamsRetriever.getOptInt(int position, int defaultValue) Retrieves the specified optional numeric parameter as anint.NamedParamsRetriever.getOptList(String name, boolean allowNull, List<Object> defaultValue) Retrieves the specified optional list (maps from JSON array) parameter.NamedParamsRetriever.getOptList(String name, List<Object> defaultValue) Retrieves the specified optional list (maps from JSON array) parameter.PositionalParamsRetriever.getOptList(int position, boolean allowNull, List<Object> defaultValue) Retrieves the specified optional list (maps from JSON array) parameter.PositionalParamsRetriever.getOptList(int position, List<Object> defaultValue) Retrieves the specified optional list (maps from JSON array) parameter.longNamedParamsRetriever.getOptLong(String name, long defaultValue) Retrieves the specified optional numeric parameter as along.longPositionalParamsRetriever.getOptLong(int position, long defaultValue) Retrieves the specified optional numeric parameter as along.Retrieves the specified optional map (maps from JSON object) parameter.Retrieves the specified optional map (maps from JSON object) parameter.PositionalParamsRetriever.getOptMap(int position, boolean allowNull, Map<String, Object> defaultValue) Retrieves the specified optional map (maps from JSON object) parameter.Retrieves the specified optional map (maps from JSON object) parameter.NamedParamsRetriever.getOptString(String name, boolean allowNull, String defaultValue) Retrieves the specified optional string parameter.NamedParamsRetriever.getOptString(String name, String defaultValue) Retrieves the specified optional string parameter.PositionalParamsRetriever.getOptString(int position, boolean allowNull, String defaultValue) Retrieves the specified optional string parameter.PositionalParamsRetriever.getOptString(int position, String defaultValue) Retrieves the specified optional string parameter.String[]NamedParamsRetriever.getOptStringArray(String name, boolean allowNull, String[] defaultValue) Retrieves the specified optional string array (maps from JSON array of strings) parameter.String[]NamedParamsRetriever.getOptStringArray(String name, String[] defaultValue) Retrieves the specified optional string array (maps from JSON array of strings) parameter.String[]PositionalParamsRetriever.getOptStringArray(int position, boolean allowNull, String[] defaultValue) Retrieves the specified optional string array (maps from JSON array of strings) parameter.String[]PositionalParamsRetriever.getOptStringArray(int position, String[] defaultValue) Retrieves the specified optional string array (maps from JSON array of strings) parameter.Retrieves the specified string parameter.Retrieves the specified string parameter.PositionalParamsRetriever.getString(int position) Retrieves the specified string parameter.PositionalParamsRetriever.getString(int position, boolean allowNull) Retrieves the specified string parameter.String[]NamedParamsRetriever.getStringArray(String name) Retrieves the specified string array (maps from JSON array of strings) parameter.String[]NamedParamsRetriever.getStringArray(String name, boolean allowNull) Retrieves the specified string array (maps from JSON array of strings) parameter.String[]PositionalParamsRetriever.getStringArray(int position) Retrieves the specified string array (maps from JSON array of strings) parameter.String[]PositionalParamsRetriever.getStringArray(int position, boolean allowNull) Retrieves the specified string array (maps from JSON array of strings) parameter.private static <T extends Enum<T>>
voidNamedParamsRetriever.throwEnumParameterException(String name, Class<T> enumClass) Throws a JSON-RPC 2.0 error indicating a named parameter with an unexpected enumerated value.private static voidNamedParamsRetriever.throwEnumParameterException(String name, String[] enumStrings) Throws a JSON-RPC 2.0 error indicating a named parameter with an unexpected enumerated value.private static <T extends Enum<T>>
voidPositionalParamsRetriever.throwEnumParameterException(int position, Class<T> enumClass) Throws a JSON-RPC 2.0 error indicating a positional parameter with an unexpected enumerated value.private static voidPositionalParamsRetriever.throwEnumParameterException(int position, String[] enumStrings) Throws a JSON-RPC 2.0 error indicating a positional parameter with an unexpected enumerated value.private static voidNamedParamsRetriever.throwMissingParameterException(String... names) Throws a JSON-RPC 2.0 error indicating one or more missing named parameters.private static voidPositionalParamsRetriever.throwMissingParameterException(int position) Throws a JSON-RPC 2.0 error indicating a missing positional parameter.private static voidNamedParamsRetriever.throwNullParameterException(String name) Throws a JSON-RPC 2.0 error indicating a named parameter with an unexpectednullvalue.private static voidPositionalParamsRetriever.throwNullParameterException(int position) Throws a JSON-RPC 2.0 error indicating a positional parameter with unexpectednullvalue.Uses of JSONRPC2Error in net.i2p.i2pcontrol.servlets.jsonrpc2handlers
Subclasses of JSONRPC2Error in net.i2p.i2pcontrol.servlets.jsonrpc2handlersModifier and TypeClassDescriptionclassRepresents a JSON-RPC 2.0 error that occured during the processing of a request.Fields in net.i2p.i2pcontrol.servlets.jsonrpc2handlers declared as JSONRPC2ErrorModifier and TypeFieldDescriptionstatic final JSONRPC2ErrorJSONRPC2ExtendedError.INVALID_PASSWORDInvalid password provided.static final JSONRPC2ErrorJSONRPC2ExtendedError.INVALID_TOKENAuthentication token doesn't exist.static final JSONRPC2ErrorJSONRPC2ExtendedError.NO_TOKENNo authentication token presented.static final JSONRPC2ErrorJSONRPC2ExtendedError.TOKEN_EXPIREDProvided authentication token was expired and will be removed.static final JSONRPC2ErrorJSONRPC2ExtendedError.UNSPECIFIED_API_VERSIONThe version of the I2PControl API wasn't specified, but is required to be specified.static final JSONRPC2ErrorJSONRPC2ExtendedError.UNSUPPORTED_API_VERSIONThe version of the I2PControl API specified is not supported by I2PControl.Methods in net.i2p.i2pcontrol.servlets.jsonrpc2handlers that return JSONRPC2ErrorModifier and TypeMethodDescriptionprivate static JSONRPC2ErrorAuthenticateHandler.validateAPIVersion(Object api) Validate the provided I2PControl API version against the ones supported by I2PControl.JSONRPC2Helper.validateParams(String[] requiredArgs, JSONRPC2Request req) Check incoming request for required arguments, to make sure they are valid.JSONRPC2Helper.validateParams(String[] requiredArgs, JSONRPC2Request req, Boolean useAuth) Check incoming request for required arguments, to make sure they are valid.private JSONRPC2ErrorJSONRPC2Helper.validateToken(Map<String, Object> params) Will check incoming parameters to make sure they contain a valid token.