Class TimestampedDataNotification
java.lang.Object
io.openems.common.jsonrpc.base.JsonrpcMessage
io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
io.openems.common.jsonrpc.base.JsonrpcNotification
io.openems.common.jsonrpc.notification.TimestampedDataNotification
Represents a JSON-RPC Notification for timestamped data sent from Edge to
Backend.
{ "jsonrpc": "2.0", "method": "timestampedData", "params": { [timestamp: epoch in milliseconds]: { [channelAddress]: String | Number } } }
-
Field Summary
FieldsFields inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
JSONRPC_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a timestamped value.void
Add timestamped data.static TimestampedDataNotification
Parses aJsonrpcNotification
to aTimestampedDataNotification
.getData()
com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.Methods inherited from class io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
getFullyQualifiedMethod, getMethod, toJsonObject
Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
from, from, toString
-
Field Details
-
METHOD
- See Also:
-
-
Constructor Details
-
TimestampedDataNotification
public TimestampedDataNotification()
-
-
Method Details
-
from
public static TimestampedDataNotification from(JsonrpcNotification n) throws OpenemsError.OpenemsNamedException Parses aJsonrpcNotification
to aTimestampedDataNotification
.- Parameters:
n
- theJsonrpcNotification
- Returns:
- the
TimestampedDataNotification
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
add
Add timestamped data.- Parameters:
timestamp
- the timestamp epoch in millisecondsdata
- a map of Channel-Address toJsonElement
value
-
add
Add a timestamped value.- Parameters:
timestamp
- the timestamp epoch in millisecondsaddress
- the Channel-Addressvalue
- theJsonElement
value
-
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
-
getData
-