Class SubscribeChannelsRequest
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.SubscribeChannelsRequest
Represents a JSON-RPC Request to subscribe to Channels.
This is used by UI to get regular updates on specific channels.
{ "jsonrpc": "2.0", "id": "UUID", "method": "subscribeChannels", "params": { "count": number // Request-Counter: the higher count wins "channels": string[] } }
-
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 SubscribeChannelsRequest
CreateSubscribeChannelsRequest
from a templateJsonrpcRequest
.Gets the set ofChannelAddress
es.int
getCount()
Gets the Count value.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.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
-
SubscribeChannelsRequest
public SubscribeChannelsRequest(int count)
-
-
Method Details
-
from
public static SubscribeChannelsRequest from(JsonrpcRequest r) throws OpenemsError.OpenemsNamedException CreateSubscribeChannelsRequest
from a templateJsonrpcRequest
.- Parameters:
r
- the templateJsonrpcRequest
- Returns:
- the
SubscribeChannelsRequest
- Throws:
OpenemsError.OpenemsNamedException
- on parse error
-
getCount
public int getCount()Gets the Count value.This value is increased with every request to assure order.
- Returns:
- the count value
-
getChannels
Gets the set ofChannelAddress
es.- Returns:
- the
ChannelAddress
es
-
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
-