Class PgEdgeHandler
java.lang.Object
io.openems.backend.metadata.odoo.postgres.PgEdgeHandler
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PgEdgeHandler
(com.zaxxer.hikari.HikariDataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptiongetEdgeConfig
(String edgeId) Gets theEdgeConfig
for an Edge-ID.void
insertEdgeConfigUpdate
(int odooId, EdgeConfigDiff diff) Inserts anEdgeConfigDiff
for an Edge-ID.void
updateEdgeConfig
(int odooId, EdgeConfig edgeConfig) Updates theEdgeConfig
for an Edge-ID.void
updateLastMessage
(Set<Integer> odooIds) Updates the LastMessage field for multiple Edge-IDs.void
updateOpenemsIsConnected
(Set<Integer> odooIds, boolean isConnected) Updates the OpenemsIsConnected field for multiple Edge-IDs.void
updateProductType
(int odooId, String producttype) Updates the ProductType for an Edge-ID.void
updateSumState
(Set<Integer> odooIds, Level level) Updates the Sum-State field for multiple Edge-IDs.
-
Constructor Details
-
PgEdgeHandler
protected PgEdgeHandler(com.zaxxer.hikari.HikariDataSource dataSource)
-
-
Method Details
-
getEdgeConfig
public EdgeConfig getEdgeConfig(String edgeId) throws SQLException, OpenemsError.OpenemsNamedException Gets theEdgeConfig
for an Edge-ID.- Parameters:
edgeId
- the Edge-ID- Returns:
- the
EdgeConfig
- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-
updateEdgeConfig
public void updateEdgeConfig(int odooId, EdgeConfig edgeConfig) throws SQLException, OpenemsError.OpenemsNamedException Updates theEdgeConfig
for an Edge-ID.- Parameters:
odooId
- the Odoo-IDedgeConfig
- theEdgeConfig
- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-
insertEdgeConfigUpdate
public void insertEdgeConfigUpdate(int odooId, EdgeConfigDiff diff) throws SQLException, OpenemsError.OpenemsNamedException Inserts anEdgeConfigDiff
for an Edge-ID.- Parameters:
odooId
- the Odoo-IDdiff
- theEdgeConfigDiff
- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-
updateProductType
public void updateProductType(int odooId, String producttype) throws SQLException, OpenemsError.OpenemsNamedException Updates the ProductType for an Edge-ID.- Parameters:
odooId
- the Odoo-IDproducttype
- the ProductType- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-
updateOpenemsIsConnected
Updates the OpenemsIsConnected field for multiple Edge-IDs.- Parameters:
odooIds
- the Odoo-IDsisConnected
- true if online; false if offline- Throws:
SQLException
- on error
-
updateLastMessage
Updates the LastMessage field for multiple Edge-IDs.- Parameters:
odooIds
- the Odoo-IDs- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-
updateSumState
Updates the Sum-State field for multiple Edge-IDs.- Parameters:
odooIds
- the Odoo-IDslevel
- the Sum-StateLevel
- Throws:
OpenemsError.OpenemsNamedException
- on errorSQLException
- on error
-