Package org.ovirt.vdsm.jsonrpc.client
Class JsonRpcRequest
java.lang.Object
org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest
Java bean representation of the request.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonRpcRequest(String method, com.fasterxml.jackson.databind.JsonNode params, com.fasterxml.jackson.databind.JsonNode id) Creates request object. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonRpcRequestfromByteArray(byte[] message) static JsonRpcRequestfromJsonNode(com.fasterxml.jackson.databind.JsonNode node) Validates and buildsJsonRpcRequestbased on provided json node.com.fasterxml.jackson.databind.JsonNodegetId()com.fasterxml.jackson.databind.JsonNodevoidsetId(com.fasterxml.jackson.databind.JsonNode node) voidvoidsetParams(com.fasterxml.jackson.databind.JsonNode node) com.fasterxml.jackson.databind.JsonNodetoJson()toString()
-
Field Details
-
MAPPER
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER -
method
-
params
private com.fasterxml.jackson.databind.JsonNode params -
id
private com.fasterxml.jackson.databind.JsonNode id
-
-
Constructor Details
-
JsonRpcRequest
public JsonRpcRequest(String method, com.fasterxml.jackson.databind.JsonNode params, com.fasterxml.jackson.databind.JsonNode id) Creates request object.- Parameters:
method- - Name of the method which will be executed remotely.params- - Parameters used to execute method.id- - Unique identifier of the message.
-
-
Method Details
-
getMethod
-
setMethod
-
getParams
public com.fasterxml.jackson.databind.JsonNode getParams() -
setParams
public void setParams(com.fasterxml.jackson.databind.JsonNode node) -
getId
public com.fasterxml.jackson.databind.JsonNode getId() -
setId
public void setId(com.fasterxml.jackson.databind.JsonNode node) -
getPlainId
-
fromJsonNode
Validates and buildsJsonRpcRequestbased on provided json node.- Parameters:
node- - Json representation of the request.- Returns:
- Request object.
-
fromByteArray
- Parameters:
message- - byte array representation of the request.- Returns:
- Request object.
- See Also:
-
toJson
public com.fasterxml.jackson.databind.JsonNode toJson()- Returns:
- Content of this bean as
JsonNode.
-
toString
-