Package net.solarnetwork.ocpp.dao
Interface ChargeSessionDao
- All Superinterfaces:
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.dao.GenericDao
net.solarnetwork.dao.GenericDao.EntityEventType, net.solarnetwork.dao.GenericDao.StandardSortKey -
Field Summary
Fields inherited from interface net.solarnetwork.dao.GenericDao
ENTITY_EVENT_ENTITY_ID_PROPERTY, ENTITY_EVENT_ENTITY_PROPERTY, ENTITY_EVENT_TOPIC_TEMPLATE, SORT_BY_CREATED_ASCENDING, SORT_BY_CREATED_DESCENDING, SORT_BY_CREATED_ID_ASCENDING, SORT_BY_CREATED_ID_DESCENDING, SORT_BY_ID_ASCENDING, SORT_BY_ID_DESCENDING -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReadings(Iterable<SampledValue> readings) Store one or more charge session readings.intdeletePostedChargeSessions(Instant expirationDate) Delete all posted charge sessions withpostedvalues on or before a given date.findReadingsForSession(UUID sessionId) Get all available readings for a given session.getIncompleteChargeSessionForConnector(long chargePointId, int connectorId) Get the first available incomplete charge session for a given connector ID.getIncompleteChargeSessionForTransaction(long chargePointId, int transactionId) Get an incomplete charge session for a given transaction ID.Get all incomplete charge sessions.getIncompleteChargeSessionsForChargePoint(long chargePointId) Get all incomplete charge session for a given charge point ID.getIncompleteChargeSessionsForConnector(long chargePointId, int connectorId) Get all incomplete charge session for a given connector ID.intGet the next available charge session transaction ID.Methods inherited from interface net.solarnetwork.dao.GenericDao
delete, entityEventTopic, get, getAll, getObjectType, save
-
Method Details
-
nextTransactionId
int nextTransactionId()Get the next available charge session transaction ID.- Returns:
- the next transaction ID
- Since:
- 1.1
-
getIncompleteChargeSessionForTransaction
Get an incomplete charge session for a given transaction ID. An incomplete session is one that has noendeddate.- Parameters:
chargePointId- the charge point ID to look fortransactionId- the transaction ID to look for- Returns:
- the first available incomplete charge session, or null if not found
-
getIncompleteChargeSessionForConnector
Get the first available incomplete charge session for a given connector ID. An incomplete session is one that has noendeddate.- Parameters:
chargePointId- the charge point ID to look forconnectorId- 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 noendeddate.- Parameters:
chargePointId- the charge point ID to look forconnectorId- the connectorId ID to look for- Returns:
- the incomplete charge sessions, never null
- Since:
- 1.2
-
getIncompleteChargeSessionsForChargePoint
Get all incomplete charge session for a given charge point ID. An incomplete session is one that has noendeddate.- 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 noendeddate.- Returns:
- all available incomplete charge sessions, never null
-
addReadings
Store one or more charge session readings.- Parameters:
readings- the readings to store
-
findReadingsForSession
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
Delete all posted charge sessions withpostedvalues on or before a given date.- Parameters:
expirationDate- theposteddate to delete up to, or null to use the current time- Returns:
- the number of charge sessions deleted
-