Class ComponentJsonApiRequest
java.lang.Object
io.openems.common.jsonrpc.base.JsonrpcMessage
io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
io.openems.common.jsonrpc.base.JsonrpcRequest
io.openems.common.jsonrpc.request.ComponentJsonApiRequest
Wraps a JSON-RPC Request for an OpenEMS Component that implements JsonApi.
{
"jsonrpc": "2.0",
"id": "UUID",
"method": "componentJsonApi",
"params": {
"componentId": string,
"payload": JsonrpcRequest
}
}
-
Field Summary
Fields inherited from class io.openems.common.jsonrpc.base.JsonrpcRequest
DEFAULT_TIMEOUT_SECONDS, id, NO_TIMEOUT, timeoutOpt
Fields inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
JSONRPC_VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentJsonApiRequest
CreateComponentJsonApiRequest
from a templateJsonrpcRequest
.Gets the Component-ID.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.Gets the PayloadJsonrpcRequest
.Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcRequest
getId, getTimeout, toJsonObject
Methods inherited from class io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
getFullyQualifiedMethod, getMethod
Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
from, from, toString
-
Field Details
-
METHOD
- See Also:
-
-
Constructor Details
-
ComponentJsonApiRequest
-
-
Method Details
-
from
public static ComponentJsonApiRequest from(JsonrpcRequest r) throws OpenemsError.OpenemsNamedException CreateComponentJsonApiRequest
from a templateJsonrpcRequest
.- Parameters:
r
- the templateJsonrpcRequest
- Returns:
- the
ComponentJsonApiRequest
- Throws:
OpenemsError.OpenemsNamedException
- on parse error
-
getParams
public com.google.gson.JsonObject getParams()Description copied from class:AbstractJsonrpcRequest
Gets the paramsJsonObject
of theJsonrpcRequest
.- Specified by:
getParams
in classAbstractJsonrpcRequest
- Returns:
- the params as
JsonObject
-
getComponentId
Gets the Component-ID.- Returns:
- Component-ID
-
getPayload
Gets the PayloadJsonrpcRequest
.- Returns:
- Payload
-