ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v2::DatabaseHandlerInterface Class Referenceabstract
Inheritance diagram for ocpp::v2::DatabaseHandlerInterface:
ocpp::v2::DatabaseHandler

Public Member Functions

virtual void authorization_cache_insert_entry (const std::string &id_token_hash, const IdTokenInfo &id_token_info)=0
 Inserts cache entry. More...
 
virtual void authorization_cache_update_last_used (const std::string &id_token_hash)=0
 Updates the last_used field in the entry. More...
 
virtual std::optional< AuthorizationCacheEntryauthorization_cache_get_entry (const std::string &id_token_hash)=0
 Gets cache entry for given id_token_hash if present. More...
 
virtual void authorization_cache_delete_entry (const std::string &id_token_hash)=0
 Deletes the cache entry for the given id_token_hash. More...
 
virtual void authorization_cache_delete_nr_of_oldest_entries (size_t nr_to_remove)=0
 Removes up to nr_to_remove items from the cache starting from the least recently used. More...
 
virtual void authorization_cache_delete_expired_entries (std::optional< std::chrono::seconds > auth_cache_lifetime)=0
 Removes all entries from the cache that have passed their expiry date or auth cache lifetime. More...
 
virtual void authorization_cache_clear ()=0
 Deletes all entries of the AUTH_CACHE table. Returns true if the operation was successful, else false. More...
 
virtual size_t authorization_cache_get_binary_size ()=0
 Get the binary size of the authorization cache table. More...
 
virtual void insert_cs_availability (OperationalStatusEnum operational_status, bool replace)=0
 Persist operational settings for the charging station. More...
 
virtual OperationalStatusEnum get_cs_availability ()=0
 Retrieve persisted operational settings for the charging station. More...
 
virtual void insert_evse_availability (int32_t evse_id, OperationalStatusEnum operational_status, bool replace)=0
 Persist operational settings for an EVSE. More...
 
virtual OperationalStatusEnum get_evse_availability (int32_t evse_id)=0
 Retrieve persisted operational settings for an EVSE. More...
 
virtual void insert_connector_availability (int32_t evse_id, int32_t connector_id, OperationalStatusEnum operational_status, bool replace)=0
 Persist operational settings for a connector. More...
 
virtual OperationalStatusEnum get_connector_availability (int32_t evse_id, int32_t connector_id)=0
 Retrieve persisted operational settings for a connector. More...
 
virtual void insert_or_update_local_authorization_list_version (int32_t version)=0
 Inserts or updates the given version in the AUTH_LIST_VERSION table. More...
 
virtual int32_t get_local_authorization_list_version ()=0
 Returns the version in the AUTH_LIST_VERSION table. More...
 
virtual void insert_or_update_local_authorization_list_entry (const IdToken &id_token, const IdTokenInfo &id_token_info)=0
 Inserts or updates a local authorization list entry to the AUTH_LIST table. More...
 
virtual void insert_or_update_local_authorization_list (const std::vector< v2::AuthorizationData > &local_authorization_list)=0
 Inserts or updates a local authorization list entries local_authorization_list to the AUTH_LIST table. More...
 
virtual void delete_local_authorization_list_entry (const IdToken &id_token)=0
 Deletes the authorization list entry with the given id_tag. More...
 
virtual std::optional< v2::IdTokenInfoget_local_authorization_list_entry (const IdToken &id_token)=0
 Returns the IdTagInfo of the given id_tag if it exists in the AUTH_LIST table, else std::nullopt. More...
 
virtual void clear_local_authorization_list ()=0
 Deletes all entries of the AUTH_LIST table. More...
 
virtual int32_t get_local_authorization_list_number_of_entries ()=0
 Get the number of entries currently in the authorization list. More...
 
virtual void transaction_metervalues_insert (const std::string &transaction_id, const MeterValue &meter_value)=0
 Inserts a meter_value to the database linked to transaction with id transaction_id. More...
 
virtual std::vector< MeterValuetransaction_metervalues_get_all (const std::string &transaction_id)=0
 Get all metervalues linked to transaction with id transaction_id. More...
 
virtual void transaction_metervalues_clear (const std::string &transaction_id)=0
 Remove all metervalue entries linked to transaction with id transaction_id. More...
 
virtual void transaction_insert (const EnhancedTransaction &transaction, int32_t evse_id)=0
 Inserts a transaction with the given parameters to the TRANSACTIONS table. More...
 
virtual std::unique_ptr< EnhancedTransactiontransaction_get (const int32_t evse_id)=0
 Gets a transaction from the database if one can be found using evse_id. More...
 
virtual void transaction_update_seq_no (const std::string &transaction_id, int32_t seq_no)=0
 Update the sequence number of the given transaction id in the database. More...
 
virtual void transaction_update_charging_state (const std::string &transaction_id, const ChargingStateEnum charging_state)=0
 Update the charging state of the given transaction id in the database. More...
 
virtual void transaction_update_id_token_sent (const std::string &transaction_id, bool id_token_sent)=0
 Update the id_token_sent of the given transaction id in the database. More...
 
virtual void transaction_delete (const std::string &transaction_id)=0
 Clear all the transactions from the TRANSACTIONS table. More...
 
virtual void insert_or_update_charging_profile (const int evse_id, const v2::ChargingProfile &profile, const ChargingLimitSourceEnum charging_limit_source=ChargingLimitSourceEnum::CSO)=0
 charging profiles More...
 
virtual bool delete_charging_profile (const int profile_id)=0
 Deletes the profile with the given profile_id. More...
 
virtual void delete_charging_profile_by_transaction_id (const std::string &transaction_id)=0
 Deletes the profiles with the given transaction_id. More...
 
virtual bool clear_charging_profiles ()=0
 Deletes all profiles from table CHARGING_PROFILES. More...
 
virtual bool clear_charging_profiles_matching_criteria (const std::optional< int32_t > profile_id, const std::optional< ClearChargingProfile > &criteria)=0
 Deletes all profiles from table CHARGING_PROFILES matching profile_id or criteria. More...
 
virtual std::vector< ReportedChargingProfileget_charging_profiles_matching_criteria (const std::optional< int32_t > evse_id, const ChargingProfileCriterion &criteria)=0
 Get all profiles from table CHARGING_PROFILES matching profile_id or criteria. More...
 
virtual std::vector< v2::ChargingProfileget_charging_profiles_for_evse (const int evse_id)=0
 Retrieves the charging profiles stored on evse_id. More...
 
virtual std::vector< v2::ChargingProfileget_all_charging_profiles ()=0
 Retrieves all ChargingProfiles. More...
 
virtual std::map< int32_t, std::vector< v2::ChargingProfile > > get_all_charging_profiles_group_by_evse ()=0
 Retrieves all ChargingProfiles grouped by EVSE ID. More...
 
virtual ChargingLimitSourceEnum get_charging_limit_source_for_profile (const int profile_id)=0
 
virtual std::unique_ptr< common::SQLiteStatementInterfacenew_statement (const std::string &sql)=0
 

Member Function Documentation

◆ authorization_cache_clear()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_clear ( )
pure virtual

Deletes all entries of the AUTH_CACHE table. Returns true if the operation was successful, else false.

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_delete_entry()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_delete_entry ( const std::string &  id_token_hash)
pure virtual

Deletes the cache entry for the given id_token_hash.

Parameters
id_token_hash

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_delete_expired_entries()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_delete_expired_entries ( std::optional< std::chrono::seconds >  auth_cache_lifetime)
pure virtual

Removes all entries from the cache that have passed their expiry date or auth cache lifetime.

Parameters
auth_cache_lifetimeThe maximum time tokens can stay in the cache without being used
Return values
Trueif succeeded

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_delete_nr_of_oldest_entries()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_delete_nr_of_oldest_entries ( size_t  nr_to_remove)
pure virtual

Removes up to nr_to_remove items from the cache starting from the least recently used.

Parameters
nr_to_removeNumber of items to remove from the database
Return values
Trueif succeeded

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_get_binary_size()

virtual size_t ocpp::v2::DatabaseHandlerInterface::authorization_cache_get_binary_size ( )
pure virtual

Get the binary size of the authorization cache table.

Return values
Thesize of the authorization cache table in bytes

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_get_entry()

virtual std::optional< AuthorizationCacheEntry > ocpp::v2::DatabaseHandlerInterface::authorization_cache_get_entry ( const std::string &  id_token_hash)
pure virtual

Gets cache entry for given id_token_hash if present.

Parameters
id_token_hash
Returns

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_insert_entry()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_insert_entry ( const std::string &  id_token_hash,
const IdTokenInfo id_token_info 
)
pure virtual

Inserts cache entry.

Parameters
id_token_hash
id_token_info

Implemented in ocpp::v2::DatabaseHandler.

◆ authorization_cache_update_last_used()

virtual void ocpp::v2::DatabaseHandlerInterface::authorization_cache_update_last_used ( const std::string &  id_token_hash)
pure virtual

Updates the last_used field in the entry.

Parameters
id_token_hash
Return values
trueif entry was updated

Implemented in ocpp::v2::DatabaseHandler.

◆ clear_charging_profiles()

virtual bool ocpp::v2::DatabaseHandlerInterface::clear_charging_profiles ( )
pure virtual

Deletes all profiles from table CHARGING_PROFILES.

Implemented in ocpp::v2::DatabaseHandler.

◆ clear_charging_profiles_matching_criteria()

virtual bool ocpp::v2::DatabaseHandlerInterface::clear_charging_profiles_matching_criteria ( const std::optional< int32_t >  profile_id,
const std::optional< ClearChargingProfile > &  criteria 
)
pure virtual

Deletes all profiles from table CHARGING_PROFILES matching profile_id or criteria.

Implemented in ocpp::v2::DatabaseHandler.

◆ clear_local_authorization_list()

virtual void ocpp::v2::DatabaseHandlerInterface::clear_local_authorization_list ( )
pure virtual

Deletes all entries of the AUTH_LIST table.

Implemented in ocpp::v2::DatabaseHandler.

◆ delete_charging_profile()

virtual bool ocpp::v2::DatabaseHandlerInterface::delete_charging_profile ( const int  profile_id)
pure virtual

Deletes the profile with the given profile_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ delete_charging_profile_by_transaction_id()

virtual void ocpp::v2::DatabaseHandlerInterface::delete_charging_profile_by_transaction_id ( const std::string &  transaction_id)
pure virtual

Deletes the profiles with the given transaction_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ delete_local_authorization_list_entry()

virtual void ocpp::v2::DatabaseHandlerInterface::delete_local_authorization_list_entry ( const IdToken id_token)
pure virtual

Deletes the authorization list entry with the given id_tag.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_all_charging_profiles()

virtual std::vector< v2::ChargingProfile > ocpp::v2::DatabaseHandlerInterface::get_all_charging_profiles ( )
pure virtual

Retrieves all ChargingProfiles.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_all_charging_profiles_group_by_evse()

virtual std::map< int32_t, std::vector< v2::ChargingProfile > > ocpp::v2::DatabaseHandlerInterface::get_all_charging_profiles_group_by_evse ( )
pure virtual

Retrieves all ChargingProfiles grouped by EVSE ID.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_charging_profiles_for_evse()

virtual std::vector< v2::ChargingProfile > ocpp::v2::DatabaseHandlerInterface::get_charging_profiles_for_evse ( const int  evse_id)
pure virtual

Retrieves the charging profiles stored on evse_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_charging_profiles_matching_criteria()

virtual std::vector< ReportedChargingProfile > ocpp::v2::DatabaseHandlerInterface::get_charging_profiles_matching_criteria ( const std::optional< int32_t >  evse_id,
const ChargingProfileCriterion criteria 
)
pure virtual

Get all profiles from table CHARGING_PROFILES matching profile_id or criteria.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_connector_availability()

virtual OperationalStatusEnum ocpp::v2::DatabaseHandlerInterface::get_connector_availability ( int32_t  evse_id,
int32_t  connector_id 
)
pure virtual

Retrieve persisted operational settings for a connector.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_cs_availability()

virtual OperationalStatusEnum ocpp::v2::DatabaseHandlerInterface::get_cs_availability ( )
pure virtual

Retrieve persisted operational settings for the charging station.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_evse_availability()

virtual OperationalStatusEnum ocpp::v2::DatabaseHandlerInterface::get_evse_availability ( int32_t  evse_id)
pure virtual

Retrieve persisted operational settings for an EVSE.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_local_authorization_list_entry()

virtual std::optional< v2::IdTokenInfo > ocpp::v2::DatabaseHandlerInterface::get_local_authorization_list_entry ( const IdToken id_token)
pure virtual

Returns the IdTagInfo of the given id_tag if it exists in the AUTH_LIST table, else std::nullopt.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_local_authorization_list_number_of_entries()

virtual int32_t ocpp::v2::DatabaseHandlerInterface::get_local_authorization_list_number_of_entries ( )
pure virtual

Get the number of entries currently in the authorization list.

Implemented in ocpp::v2::DatabaseHandler.

◆ get_local_authorization_list_version()

virtual int32_t ocpp::v2::DatabaseHandlerInterface::get_local_authorization_list_version ( )
pure virtual

Returns the version in the AUTH_LIST_VERSION table.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_connector_availability()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_connector_availability ( int32_t  evse_id,
int32_t  connector_id,
OperationalStatusEnum  operational_status,
bool  replace 
)
pure virtual

Persist operational settings for a connector.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_cs_availability()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_cs_availability ( OperationalStatusEnum  operational_status,
bool  replace 
)
pure virtual

Persist operational settings for the charging station.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_evse_availability()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_evse_availability ( int32_t  evse_id,
OperationalStatusEnum  operational_status,
bool  replace 
)
pure virtual

Persist operational settings for an EVSE.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_or_update_charging_profile()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_or_update_charging_profile ( const int  evse_id,
const v2::ChargingProfile profile,
const ChargingLimitSourceEnum  charging_limit_source = ChargingLimitSourceEnum::CSO 
)
pure virtual

charging profiles

Inserts or updates the given profile to CHARGING_PROFILES table

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_or_update_local_authorization_list()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_or_update_local_authorization_list ( const std::vector< v2::AuthorizationData > &  local_authorization_list)
pure virtual

Inserts or updates a local authorization list entries local_authorization_list to the AUTH_LIST table.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_or_update_local_authorization_list_entry()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_or_update_local_authorization_list_entry ( const IdToken id_token,
const IdTokenInfo id_token_info 
)
pure virtual

Inserts or updates a local authorization list entry to the AUTH_LIST table.

Implemented in ocpp::v2::DatabaseHandler.

◆ insert_or_update_local_authorization_list_version()

virtual void ocpp::v2::DatabaseHandlerInterface::insert_or_update_local_authorization_list_version ( int32_t  version)
pure virtual

Inserts or updates the given version in the AUTH_LIST_VERSION table.

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_delete()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_delete ( const std::string &  transaction_id)
pure virtual

Clear all the transactions from the TRANSACTIONS table.

Parameters
transaction_idtransaction id of the transaction to clear from.
Returns
true if succeeded

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_get()

virtual std::unique_ptr< EnhancedTransaction > ocpp::v2::DatabaseHandlerInterface::transaction_get ( const int32_t  evse_id)
pure virtual

Gets a transaction from the database if one can be found using evse_id.

Parameters
evse_idThe evse id to get the transaction for
Returns
nullptr if not found, otherwise an enhanced transaction object.

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_insert()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_insert ( const EnhancedTransaction transaction,
int32_t  evse_id 
)
pure virtual

Inserts a transaction with the given parameters to the TRANSACTIONS table.

Parameters
transaction
evse_id

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_metervalues_clear()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_metervalues_clear ( const std::string &  transaction_id)
pure virtual

Remove all metervalue entries linked to transaction with id transaction_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_metervalues_get_all()

virtual std::vector< MeterValue > ocpp::v2::DatabaseHandlerInterface::transaction_metervalues_get_all ( const std::string &  transaction_id)
pure virtual

Get all metervalues linked to transaction with id transaction_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_metervalues_insert()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_metervalues_insert ( const std::string &  transaction_id,
const MeterValue meter_value 
)
pure virtual

Inserts a meter_value to the database linked to transaction with id transaction_id.

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_update_charging_state()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_update_charging_state ( const std::string &  transaction_id,
const ChargingStateEnum  charging_state 
)
pure virtual

Update the charging state of the given transaction id in the database.

Parameters
transaction_id
charging_state

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_update_id_token_sent()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_update_id_token_sent ( const std::string &  transaction_id,
bool  id_token_sent 
)
pure virtual

Update the id_token_sent of the given transaction id in the database.

Parameters
transaction_id
id_token_sent

Implemented in ocpp::v2::DatabaseHandler.

◆ transaction_update_seq_no()

virtual void ocpp::v2::DatabaseHandlerInterface::transaction_update_seq_no ( const std::string &  transaction_id,
int32_t  seq_no 
)
pure virtual

Update the sequence number of the given transaction id in the database.

Parameters
transaction_id
seq_no

Implemented in ocpp::v2::DatabaseHandler.


The documentation for this class was generated from the following file: