Package org.ovirt.vdsm.jsonrpc.client
Class JsonRpcRequest
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest
-
public class JsonRpcRequest extends java.lang.ObjectJava 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 JsonRpcRequestfromByteArray(byte[] message)static JsonRpcRequestfromJsonNode(com.fasterxml.jackson.databind.JsonNode node)Validates and buildsJsonRpcRequestbased on provided json node.com.fasterxml.jackson.databind.JsonNodegetId()java.lang.StringgetMethod()com.fasterxml.jackson.databind.JsonNodegetParams()java.lang.StringgetPlainId()voidsetId(com.fasterxml.jackson.databind.JsonNode node)voidsetMethod(java.lang.String method)voidsetParams(com.fasterxml.jackson.databind.JsonNode node)com.fasterxml.jackson.databind.JsonNodetoJson()java.lang.StringtoString()
-
-
-
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 buildsJsonRpcRequestbased 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:
toStringin classjava.lang.Object
-
-