Class ChargeSession

java.lang.Object
net.solarnetwork.dao.BasicIdentity<K>
net.solarnetwork.dao.BasicEntity<UUID>
net.solarnetwork.dao.BasicUuidEntity
net.solarnetwork.ocpp.domain.ChargeSession
All Implemented Interfaces:
Serializable, Comparable<UUID>, net.solarnetwork.dao.Entity<UUID>, net.solarnetwork.domain.Identity<UUID>

public class ChargeSession extends net.solarnetwork.dao.BasicUuidEntity
An entity for tracking an OCPP transaction, which represents a single charging cycle from authorization to end of charging.
Version:
1.1
Author:
matt
See Also:
  • Constructor Details

    • ChargeSession

      public ChargeSession(String authId, long chargePointId, int connectorId, int transactionId)
      Constructor.
      Parameters:
      authId - the authorization ID
      chargePointId - the Charge Point ID
      connectorId - the Charge Point connector ID
      transactionId - the transactionID
    • ChargeSession

      public ChargeSession(UUID id, Instant created, String authId, long chargePointId, int connectorId, int transactionId)
      Constructor.
      Parameters:
      id - the primary key
      created - the created date
      authId - the authorization ID
      chargePointId - the Charge Point ID
      connectorId - the Charge Point connector ID
      transactionId - the transactionID
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAuthId

      public String getAuthId()
      Get the Authorization ID.
      Returns:
      the authorization ID
    • getChargePointId

      public long getChargePointId()
      Get the Charge Point ID.
      Returns:
      the Charge Point ID
    • getConnectorId

      public int getConnectorId()
      Get the Charge Point connection ID.
      Returns:
      the Charge Point connection ID
    • getTransactionId

      public int getTransactionId()
      Get the assigned transaction ID.
      Returns:
      the transaction ID
    • getEnded

      public Instant getEnded()
      Get the session end date.
      Returns:
      the ended the end date, or null if not ended
    • setEnded

      public void setEnded(Instant ended)
      Set the session end date.
      Parameters:
      ended - the end date to set
    • getEndReason

      public ChargeSessionEndReason getEndReason()
      Get the session end reason.
      Returns:
      the the end reason
    • setEndReason

      public void setEndReason(ChargeSessionEndReason endReason)
      Set the session end reason.
      Parameters:
      endReason - the reason to set
    • getEndAuthId

      public String getEndAuthId()
      The authorization ID used to end the transaction.
      Returns:
      the ending authorization ID, or null
    • setEndAuthId

      public void setEndAuthId(String endAuthId)
      Set the authorization ID used to end the transaction.
      Parameters:
      endAuthId - the ending authorization ID to set
    • getPosted

      public Instant getPosted()
      Get the session posted date.

      The posted date represents a date when this transaction has been posted to some external service.

      Returns:
      the posted date or null if not posted
    • setPosted

      public void setPosted(Instant posted)
      Set the session posted date.
      Parameters:
      posted - the posted to set