Class JsonRpcRequest

java.lang.Object
org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest

public class JsonRpcRequest extends Object
Java bean representation of the request.
  • Field Details

    • MAPPER

      private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
    • method

      private String 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

      public String getMethod()
    • setMethod

      public void setMethod(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 String getPlainId()
    • fromJsonNode

      public static JsonRpcRequest fromJsonNode(com.fasterxml.jackson.databind.JsonNode node)
      Validates and builds JsonRpcRequest 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:
    • toJson

      public com.fasterxml.jackson.databind.JsonNode toJson()
      Returns:
      Content of this bean as JsonNode.
    • toString

      public String toString()
      Overrides:
      toString in class Object