Class Schema
java.lang.Object
io.openems.backend.timedata.timescaledb.internal.Schema
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetChannel
(Connection con, String edgeId, String channelAddress, com.google.gson.JsonElement value) Gets the Channel for the givenPoint
.getChannelFromCache
(String edgeId, String channelAddress) Gets theSchema.ChannelRecord
from local Cache.static Schema
initialize
(com.zaxxer.hikari.HikariDataSource dataSource) Initialize the database Schema and the Channels Cache.
-
Method Details
-
initialize
Initialize the database Schema and the Channels Cache.- Parameters:
dataSource
- aHikariDataSource
- Returns:
- the
Schema
- Throws:
SQLException
- on error
-
getChannel
public Schema.ChannelRecord getChannel(Connection con, String edgeId, String channelAddress, com.google.gson.JsonElement value) throws SQLException Gets the Channel for the givenPoint
. Adds it if it was not existing before.- Parameters:
con
- a databaseConnection
, in case the entry needs to be addededgeId
- the Edge-IDchannelAddress
- the Channel-Addressvalue
- theJsonElement
value- Returns:
- the
Schema.ChannelRecord
; or null if not in Cache and type cannot be detected - Throws:
SQLException
- on error while adding
-
getChannelFromCache
Gets theSchema.ChannelRecord
from local Cache.- Parameters:
edgeId
- the Edge-IDchannelAddress
- the Channel-Address- Returns:
- the
Schema.ChannelRecord
with a database ID for table 'channel', null if there is no entry yet
-