Package io.openems.backend.metadata.odoo
Class EdgeCache
- java.lang.Object
-
- io.openems.backend.metadata.odoo.EdgeCache
-
public class EdgeCache extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
EXPECTED_CACHE_SIZE
-
Constructor Summary
Constructors Constructor Description EdgeCache(OdooMetadata parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MyEdge
addOrUpdate(java.sql.ResultSet rs)
Adds a Edge or Updates an existing Edge from a SQL ResultSet.java.util.Collection<Edge>
getAllEdges()
Gets all Edges as an unmodifiable Collection.MyEdge
getEdgeForApikey(java.lang.String apikey)
Gets an Edge from its Apikey.MyEdge
getEdgeFromEdgeId(java.lang.String edgeId)
Gets an Edge from its Edge-ID.MyEdge
getEdgeFromOdooId(int odooId)
Gets an Edge from its Odoo-ID.
-
-
-
Field Detail
-
EXPECTED_CACHE_SIZE
public static final int EXPECTED_CACHE_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EdgeCache
public EdgeCache(OdooMetadata parent)
-
-
Method Detail
-
addOrUpdate
public MyEdge addOrUpdate(java.sql.ResultSet rs) throws java.sql.SQLException, OpenemsException
Adds a Edge or Updates an existing Edge from a SQL ResultSet.- Parameters:
rs
- the ResultSet record- Returns:
- the new or updated Edge instance
- Throws:
java.sql.SQLException
- on errorOpenemsException
- on error
-
getEdgeFromEdgeId
public MyEdge getEdgeFromEdgeId(java.lang.String edgeId)
Gets an Edge from its Edge-ID.- Parameters:
edgeId
- the Edge-ID- Returns:
- the Edge, or null
-
getEdgeFromOdooId
public MyEdge getEdgeFromOdooId(int odooId)
Gets an Edge from its Odoo-ID.- Parameters:
odooId
- the Odoo-ID- Returns:
- the Edge, or null
-
getEdgeForApikey
public MyEdge getEdgeForApikey(java.lang.String apikey)
Gets an Edge from its Apikey.- Parameters:
apikey
- the Apikey- Returns:
- the Edge, or null
-
getAllEdges
public java.util.Collection<Edge> getAllEdges()
Gets all Edges as an unmodifiable Collection.- Returns:
- a collection of Edges
-
-