Class EdgeCache
java.lang.Object
io.openems.backend.common.edgewebsocket.EdgeCache
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal com.google.gson.JsonElement
getChannelValue
(String address) Gets the channel value from cache.final EdgeCache.Pair<Map<String,
com.google.gson.JsonElement>, Set<String>> getChannelValues
(Set<String> addresses) Gets the channel values from cache.void
updateAggregatedData
(AggregatedDataNotification notification) Updates the aggregated data cache.void
updateCurrentData
(TimestampedDataNotification notification) Updates the Cache.
-
Constructor Details
-
EdgeCache
public EdgeCache()
-
-
Method Details
-
getChannelValue
Gets the channel value from cache.- Parameters:
address
- the Channel-Address of the channel- Returns:
- the value;
JsonNull
if it is not in cache
-
getChannelValues
public final EdgeCache.Pair<Map<String,com.google.gson.JsonElement>, getChannelValuesSet<String>> (Set<String> addresses) Gets the channel values from cache.- Parameters:
addresses
- the Channel-Addresses of the channels- Returns:
- a) Map of Channel-Address to values (
JsonNull
if not in cache); b) Set of Channel-Addresses that are only available as aggregated data
-
updateCurrentData
Updates the Cache.- Parameters:
notification
- the incoming data
-
updateAggregatedData
Updates the aggregated data cache.- Parameters:
notification
- the incoming data
-