Class SubscribeSystemLogRequest
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.SubscribeSystemLogRequest
Represents a JSON-RPC Request to subscribe to system log. The actual system
log is then sent as JSON-RPC Notification
Set 'subscribe' param to 'true' to start the subscription, false for unsubscribe.
{ "jsonrpc": "2.0", "id": UUID, "method": "subscribeSystemLog", "params": { "subscribe": boolean } }
-
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 SubscribeSystemLogRequest
CreateSubscribeSystemLogRequest
from a templateJsonrpcRequest
.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.boolean
Whether to subscribe or unsubscribe.static SubscribeSystemLogRequest
Creates a JSON-RPC Request that subscribes the System-Log.static SubscribeSystemLogRequest
Creates a JSON-RPC Request that unsubscribes the System-Log.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
-
SubscribeSystemLogRequest
public SubscribeSystemLogRequest(boolean subscribe)
-
-
Method Details
-
from
public static SubscribeSystemLogRequest from(JsonrpcRequest r) throws OpenemsError.OpenemsNamedException CreateSubscribeSystemLogRequest
from a templateJsonrpcRequest
.- Parameters:
r
- the templateJsonrpcRequest
- Returns:
- the
SubscribeSystemLogRequest
- Throws:
OpenemsError.OpenemsNamedException
- on parse error
-
subscribe
Creates a JSON-RPC Request that subscribes the System-Log.- Returns:
SubscribeSystemLogRequest
-
unsubscribe
Creates a JSON-RPC Request that unsubscribes the System-Log.- Returns:
SubscribeSystemLogRequest
-
isSubscribe
public boolean isSubscribe()Whether to subscribe or unsubscribe.- Returns:
- true for subscribe, false for unsubscribe
-
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
-