public class JsonRpcEvent extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_KEY |
static String |
MESSAGE_FORMAT |
Constructor and Description |
---|
JsonRpcEvent(String method,
org.codehaus.jackson.JsonNode params)
Creates notification object.
|
Modifier and Type | Method and Description |
---|---|
static JsonRpcEvent |
fromByteArray(byte[] message) |
static JsonRpcEvent |
fromJsonNode(org.codehaus.jackson.JsonNode node)
Validates and builds
JsonRpcEvent based on provided json node. |
static JsonRpcEvent |
fromMethodAndParams(String method,
Map<String,Object> params)
Create notification object for the method and params.
|
String |
getMethod() |
org.codehaus.jackson.JsonNode |
getParams() |
void |
setMethod(String method) |
void |
setParams(org.codehaus.jackson.JsonNode node) |
org.codehaus.jackson.JsonNode |
toJson() |
String |
toString() |
public static final String ERROR_KEY
public static final String MESSAGE_FORMAT
public JsonRpcEvent(String method, org.codehaus.jackson.JsonNode params)
method
- - Name of the method which will be executed remotely.params
- - Parameters used to execute method.public String getMethod()
public void setMethod(String method)
public org.codehaus.jackson.JsonNode getParams()
public void setParams(org.codehaus.jackson.JsonNode node)
public static JsonRpcEvent fromJsonNode(org.codehaus.jackson.JsonNode node)
JsonRpcEvent
based on provided json node.node
- - Json representation of the notification.public static JsonRpcEvent fromMethodAndParams(String method, Map<String,Object> params) throws IOException
method
- - Name of the method which will be executed remotely.params
- - Parameters used to execute method.IOException
- - The exception thrown if params cannot be serialized.public static JsonRpcEvent fromByteArray(byte[] message)
message
- - byte array representation of the notification.fromJsonNode(JsonNode)
public org.codehaus.jackson.JsonNode toJson()
JsonNode
.Copyright © 2016. All rights reserved.