Package org.consensusj.jsonrpc
Class JsonRpcRequest
java.lang.Object
org.consensusj.jsonrpc.JsonRpcRequest
JSON-RPC Request POJO
-
Constructor Summary
ConstructorDescriptionJsonRpcRequest
(String method) Convenience constructor for requests with empty parameter listConstructor for use by Jackson deserialization.JsonRpcRequest
(String method, List<?> params) Create a JSON RPC request (for serialization.) To create a request on the client side, it is generally recommended to use the methods inJsonRpcClient
.JsonRpcRequest
(JsonRpcMessage.Version jsonRpcVersion, long id, String method, List<Object> params) This constructor is slightly more strict than the deserialization constructor and should be used where possible.JsonRpcRequest
(JsonRpcMessage.Version jsonRpcVersion, String method, List<?> params) Create a JSON RPC request (for serialization.) Can be used to override default JSON RPC version. -
Method Summary
-
Constructor Details
-
JsonRpcRequest
Constructor for use by Jackson deserialization. Deserialization will typically be used on the server-side. To create a request on the client side, it is generally recommended to use the methods inJsonRpcClient
.- Parameters:
jsonrpc
- filled from the JSON objectid
- filled from the JSON objectmethod
- filled from the JSON objectparams
- filled from the JSON object- See Also:
-
JsonRpcRequest
public JsonRpcRequest(JsonRpcMessage.Version jsonRpcVersion, long id, String method, List<Object> params) This constructor is slightly more strict than the deserialization constructor and should be used where possible. It uses theJsonRpcMessage.Version
enum
and requires that theid
be along
.- Parameters:
jsonRpcVersion
- JSON-RPC version (enum)id
- message idmethod
- RPCmethod
params
- RPC method positional parameters
-
JsonRpcRequest
Create a JSON RPC request (for serialization.) Can be used to override default JSON RPC version. To create a request on the client side, it is generally recommended to use the methods in theJsonRpcClient
you are using.- Parameters:
jsonRpcVersion
- JSON-RPC version (enum)method
- Method of remote procedure to callparams
- Parameters to serialize
-
JsonRpcRequest
Create a JSON RPC request (for serialization.) To create a request on the client side, it is generally recommended to use the methods inJsonRpcClient
.- Parameters:
method
- Method of remote procedure to callparams
- Parameters to serialize- See Also:
-
JsonRpcRequest
Convenience constructor for requests with empty parameter list- Parameters:
method
- method name string
-
-
Method Details
-
getJsonrpc
-
getMethod
-
getId
-
getParams
-