Class JdbcSolarNodeOwnershipDao

java.lang.Object
net.solarnetwork.central.common.dao.jdbc.JdbcSolarNodeOwnershipDao
All Implemented Interfaces:
SolarNodeOwnershipDao

public class JdbcSolarNodeOwnershipDao extends Object implements SolarNodeOwnershipDao
JDBC implementation of SolarNodeOwnershipDao.
  • Constructor Details

    • JdbcSolarNodeOwnershipDao

      public JdbcSolarNodeOwnershipDao(org.springframework.jdbc.core.JdbcOperations jdbcOps)
      Constructor.
      Parameters:
      jdbcOps - the JDBC operations to use
  • Method Details

    • ownershipForNodeId

      public SolarNodeOwnership ownershipForNodeId(Long nodeId)
      Description copied from interface: SolarNodeOwnershipDao
      Get the ownership information of a node.
      Specified by:
      ownershipForNodeId in interface SolarNodeOwnershipDao
      Parameters:
      nodeId - the ID of the node to find the ownership of
      Returns:
      the ownership, or null if not available
    • ownershipsForUserId

      public SolarNodeOwnership[] ownershipsForUserId(Long userId)
      Description copied from interface: SolarNodeOwnershipDao
      Get all available node ownership for a user ID.
      Specified by:
      ownershipsForUserId in interface SolarNodeOwnershipDao
      Parameters:
      userId - the ID of the owner to find node ownership for
      Returns:
      the ownerships, or null if none available
    • nonArchivedNodeIdsForToken

      public Long[] nonArchivedNodeIdsForToken(String tokenId)
      Description copied from interface: SolarNodeOwnershipDao
      Get the available non-archived node IDs associated with a security token ID.
      Specified by:
      nonArchivedNodeIdsForToken in interface SolarNodeOwnershipDao
      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

      public javax.cache.Cache<Long,SolarNodeOwnership> getNodeOwnershipCache()
      Get the cache of node IDs to associated node ownership.
      Returns:
      the cache, or null if not available
    • setUserNodeCache

      public void setUserNodeCache(javax.cache.Cache<Long,SolarNodeOwnership> nodeOwnershipCache)
      Set the cache of node IDs to associated node ownership.
      Parameters:
      nodeOwnershipCache - the cache to set