Class JdbcSolarNodeOwnershipDao
java.lang.Object
net.solarnetwork.central.common.dao.jdbc.JdbcSolarNodeOwnershipDao
- All Implemented Interfaces:
SolarNodeOwnershipDao
JDBC implementation of
SolarNodeOwnershipDao.-
Constructor Summary
ConstructorsConstructorDescriptionJdbcSolarNodeOwnershipDao(org.springframework.jdbc.core.JdbcOperations jdbcOps) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.jdbc.core.JdbcOperationsGet the JDBC operations.javax.cache.Cache<Long, SolarNodeOwnership> Get the cache of node IDs to associated node ownership.Long[]nonArchivedNodeIdsForToken(String tokenId) Get the available non-archived node IDs associated with a security token ID.ownershipForNodeId(Long nodeId) Get the ownership information of a node.ownershipsForUserId(Long userId) Get all available node ownership for a user ID.voidsetUserNodeCache(javax.cache.Cache<Long, SolarNodeOwnership> nodeOwnershipCache) Set the cache of node IDs to associated node ownership.
-
Constructor Details
-
JdbcSolarNodeOwnershipDao
public JdbcSolarNodeOwnershipDao(org.springframework.jdbc.core.JdbcOperations jdbcOps) Constructor.- Parameters:
jdbcOps- the JDBC operations to use
-
-
Method Details
-
ownershipForNodeId
Description copied from interface:SolarNodeOwnershipDaoGet the ownership information of a node.- Specified by:
ownershipForNodeIdin interfaceSolarNodeOwnershipDao- Parameters:
nodeId- the ID of the node to find the ownership of- Returns:
- the ownership, or null if not available
-
ownershipsForUserId
Description copied from interface:SolarNodeOwnershipDaoGet all available node ownership for a user ID.- Specified by:
ownershipsForUserIdin interfaceSolarNodeOwnershipDao- Parameters:
userId- the ID of the owner to find node ownership for- Returns:
- the ownerships, or null if none available
-
nonArchivedNodeIdsForToken
Description copied from interface:SolarNodeOwnershipDaoGet the available non-archived node IDs associated with a security token ID.- Specified by:
nonArchivedNodeIdsForTokenin interfaceSolarNodeOwnershipDao- Parameters:
tokenId- the security token ID- Returns:
- the node IDs; never null
-
getJdbcOps
public org.springframework.jdbc.core.JdbcOperations getJdbcOps()Get the JDBC operations.- Returns:
- the ops
-
getNodeOwnershipCache
Get the cache of node IDs to associated node ownership.- Returns:
- the cache, or null if not available
-
setUserNodeCache
Set the cache of node IDs to associated node ownership.- Parameters:
nodeOwnershipCache- the cache to set
-