Class TimescaledbReadHandler
java.lang.Object
io.openems.backend.timedata.timescaledb.internal.read.TimescaledbReadHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by TimescaledbImpl deactivate().Returns a DebugMetrics map.Map<ChannelAddress,
com.google.gson.JsonElement> getChannelValues
(String edgeId, Set<ChannelAddress> channels) Gets the latest values for the given ChannelAddresses.SortedMap<ZonedDateTime,
SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricData
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) SortedMap<ChannelAddress,
com.google.gson.JsonElement> queryHistoricEnergy
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) SortedMap<ZonedDateTime,
SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricEnergyPerPeriod
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) void
-
Constructor Details
-
TimescaledbReadHandler
- Throws:
SQLException
-
-
Method Details
-
deactivate
public void deactivate()Called by TimescaledbImpl deactivate(). -
setSchema
-
queryHistoricData
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricDatacom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException - Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergy
public SortedMap<ChannelAddress,com.google.gson.JsonElement> queryHistoricEnergy(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException - Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channels- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergyPerPeriod
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricEnergyPerPeriodcom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException - Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
getChannelValues
public Map<ChannelAddress,com.google.gson.JsonElement> getChannelValues(String edgeId, Set<ChannelAddress> channels) Gets the latest values for the given ChannelAddresses.- Parameters:
edgeId
- The unique Edge-IDchannels
- TheChannelAddress
es- Returns:
- the values
-
debugMetrics
Returns a DebugMetrics map.- Returns:
- metrics
-