Interface ChargeSessionDao

All Superinterfaces:
net.solarnetwork.dao.GenericDao<ChargeSession,UUID>

public interface ChargeSessionDao extends net.solarnetwork.dao.GenericDao<ChargeSession,UUID>
Data Access Object API for ChargeSession entities.

Note: the GenericDao.save(net.solarnetwork.dao.Entity) method is expected to generate a unique ChargeSession.getTransactionId() value.

Version:
1.2
Author:
matt
  • Method Details

    • nextTransactionId

      int nextTransactionId()
      Get the next available charge session transaction ID.
      Returns:
      the next transaction ID
      Since:
      1.1
    • getIncompleteChargeSessionForTransaction

      ChargeSession getIncompleteChargeSessionForTransaction(long chargePointId, int transactionId)
      Get an incomplete charge session for a given transaction ID. An incomplete session is one that has no ended date.
      Parameters:
      chargePointId - the charge point ID to look for
      transactionId - the transaction ID to look for
      Returns:
      the first available incomplete charge session, or null if not found
    • getIncompleteChargeSessionForConnector

      ChargeSession getIncompleteChargeSessionForConnector(long chargePointId, int connectorId)
      Get the first available incomplete charge session for a given connector ID. An incomplete session is one that has no ended date.
      Parameters:
      chargePointId - the charge point ID to look for
      connectorId - the connectorId ID to look for
      Returns:
      the first available incomplete charge session, or null if not found
    • getIncompleteChargeSessionsForConnector

      Collection<ChargeSession> getIncompleteChargeSessionsForConnector(long chargePointId, int connectorId)
      Get all incomplete charge session for a given connector ID. An incomplete session is one that has no ended date.
      Parameters:
      chargePointId - the charge point ID to look for
      connectorId - the connectorId ID to look for
      Returns:
      the incomplete charge sessions, never null
      Since:
      1.2
    • getIncompleteChargeSessionsForChargePoint

      Collection<ChargeSession> getIncompleteChargeSessionsForChargePoint(long chargePointId)
      Get all incomplete charge session for a given charge point ID. An incomplete session is one that has no ended date.
      Parameters:
      chargePointId - the charge point ID to look for
      Returns:
      all available incomplete charge session for the given charge point, never null
    • getIncompleteChargeSessions

      Collection<ChargeSession> getIncompleteChargeSessions()
      Get all incomplete charge sessions. An incomplete session is one that has no ended date.
      Returns:
      all available incomplete charge sessions, never null
    • addReadings

      void addReadings(Iterable<SampledValue> readings)
      Store one or more charge session readings.
      Parameters:
      readings - the readings to store
    • findReadingsForSession

      List<SampledValue> findReadingsForSession(UUID sessionId)
      Get all available readings for a given session.

      The readings will be ordered by date, context, and location, measurand, and phase.

      Parameters:
      sessionId - the session ID to get the readings for
      Returns:
      the readings, or an empty list if none available
    • deletePostedChargeSessions

      int deletePostedChargeSessions(Instant expirationDate)
      Delete all posted charge sessions with posted values on or before a given date.
      Parameters:
      expirationDate - the posted date to delete up to, or null to use the current time
      Returns:
      the number of charge sessions deleted