Package org.ovirt.vdsm.jsonrpc.client
Class JsonRpcRequest
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest
-
public class JsonRpcRequest extends java.lang.Object
Java bean representation of the request.
-
-
Constructor Summary
Constructors Constructor Description JsonRpcRequest(java.lang.String method, com.fasterxml.jackson.databind.JsonNode params, com.fasterxml.jackson.databind.JsonNode id)
Creates request object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonRpcRequest
fromByteArray(byte[] message)
static JsonRpcRequest
fromJsonNode(com.fasterxml.jackson.databind.JsonNode node)
Validates and buildsJsonRpcRequest
based on provided json node.com.fasterxml.jackson.databind.JsonNode
getId()
java.lang.String
getMethod()
com.fasterxml.jackson.databind.JsonNode
getParams()
java.lang.String
getPlainId()
void
setId(com.fasterxml.jackson.databind.JsonNode node)
void
setMethod(java.lang.String method)
void
setParams(com.fasterxml.jackson.databind.JsonNode node)
com.fasterxml.jackson.databind.JsonNode
toJson()
java.lang.String
toString()
-
-
-
Constructor Detail
-
JsonRpcRequest
public JsonRpcRequest(java.lang.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 Detail
-
getMethod
public java.lang.String getMethod()
-
setMethod
public void setMethod(java.lang.String method)
-
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
public java.lang.String getPlainId()
-
fromJsonNode
public static JsonRpcRequest fromJsonNode(com.fasterxml.jackson.databind.JsonNode node)
Validates and buildsJsonRpcRequest
based on provided json node.- Parameters:
node
- - Json representation of the request.- Returns:
- Request object.
-
fromByteArray
public static JsonRpcRequest fromByteArray(byte[] message)
- Parameters:
message
- - byte array representation of the request.- Returns:
- Request object.
- See Also:
fromJsonNode(JsonNode)
-
toJson
public com.fasterxml.jackson.databind.JsonNode toJson()
- Returns:
- Content of this bean as
JsonNode
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-