Class AbstractDataNotification

Direct Known Subclasses:
AggregatedDataNotification, ResendDataNotification, TimestampedDataNotification

public abstract class AbstractDataNotification extends JsonrpcNotification
Represents a JSON-RPC Notification for timestamped or aggregated data sent from Edge to Backend.
 {
   "jsonrpc": "2.0",
   "method": "timestampedData | aggregatedData",
   "params": {
     [timestamp: epoch in milliseconds]: {
       [channelAddress]: T
     }
   }
 }
 
  • Constructor Details

    • AbstractDataNotification

      protected AbstractDataNotification(String method, com.google.common.collect.TreeBasedTable<Long,String,com.google.gson.JsonElement> data)
  • Method Details

    • parseParams

      protected static com.google.common.collect.TreeBasedTable<Long,String,com.google.gson.JsonElement> parseParams(com.google.gson.JsonObject params) throws OpenemsError.OpenemsNamedException
      Throws:
      OpenemsError.OpenemsNamedException
    • add

      public void add(long timestamp, Map<String,com.google.gson.JsonElement> data)
      Add timestamped data.
      Parameters:
      timestamp - the timestamp epoch in milliseconds
      data - a map of Channel-Address to JsonElement value
    • add

      public void add(long timestamp, String address, com.google.gson.JsonElement value)
      Add a timestamped value.
      Parameters:
      timestamp - the timestamp epoch in milliseconds
      address - the Channel-Address
      value - the JsonElement value
    • getParams

      public com.google.gson.JsonObject getParams()
      Description copied from class: AbstractJsonrpcRequest
      Gets the params JsonObject of the JsonrpcRequest.
      Specified by:
      getParams in class AbstractJsonrpcRequest
      Returns:
      the params as JsonObject
    • getData

      public com.google.common.collect.TreeBasedTable<Long,String,com.google.gson.JsonElement> getData()