|
|
| DatabaseHandler (std::unique_ptr< common::DatabaseConnectionInterface > database, const fs::path &sql_migration_files_path) |
| |
| void | authorization_cache_insert_entry (const std::string &id_token_hash, const IdTokenInfo &id_token_info) override |
| | Inserts cache entry. More...
|
| |
| void | authorization_cache_update_last_used (const std::string &id_token_hash) override |
| | Updates the last_used field in the entry. More...
|
| |
| std::optional< AuthorizationCacheEntry > | authorization_cache_get_entry (const std::string &id_token_hash) override |
| | Gets cache entry for given id_token_hash if present. More...
|
| |
| void | authorization_cache_delete_entry (const std::string &id_token_hash) override |
| | Deletes the cache entry for the given id_token_hash. More...
|
| |
| void | authorization_cache_delete_nr_of_oldest_entries (size_t nr_to_remove) override |
| | Removes up to nr_to_remove items from the cache starting from the least recently used. More...
|
| |
| void | authorization_cache_delete_expired_entries (std::optional< std::chrono::seconds > auth_cache_lifetime) override |
| | Removes all entries from the cache that have passed their expiry date or auth cache lifetime. More...
|
| |
| void | authorization_cache_clear () override |
| | Deletes all entries of the AUTH_CACHE table. Returns true if the operation was successful, else false. More...
|
| |
| size_t | authorization_cache_get_binary_size () override |
| | Get the binary size of the authorization cache table. More...
|
| |
| virtual void | insert_cs_availability (OperationalStatusEnum operational_status, bool replace) override |
| | Persist operational settings for the charging station. More...
|
| |
| virtual OperationalStatusEnum | get_cs_availability () override |
| | Retrieve persisted operational settings for the charging station. More...
|
| |
| virtual void | insert_evse_availability (int32_t evse_id, OperationalStatusEnum operational_status, bool replace) override |
| | Persist operational settings for an EVSE. More...
|
| |
| virtual OperationalStatusEnum | get_evse_availability (int32_t evse_id) override |
| | 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) override |
| | Persist operational settings for a connector. More...
|
| |
| virtual OperationalStatusEnum | get_connector_availability (int32_t evse_id, int32_t connector_id) override |
| | Retrieve persisted operational settings for a connector. More...
|
| |
| void | insert_or_update_local_authorization_list_version (int32_t version) override |
| | Inserts or updates the given version in the AUTH_LIST_VERSION table. More...
|
| |
| int32_t | get_local_authorization_list_version () override |
| | Returns the version in the AUTH_LIST_VERSION table. More...
|
| |
| void | insert_or_update_local_authorization_list_entry (const IdToken &id_token, const IdTokenInfo &id_token_info) override |
| | Inserts or updates a local authorization list entry to the AUTH_LIST table. More...
|
| |
| void | insert_or_update_local_authorization_list (const std::vector< v2::AuthorizationData > &local_authorization_list) override |
| | Inserts or updates a local authorization list entries local_authorization_list to the AUTH_LIST table. More...
|
| |
| void | delete_local_authorization_list_entry (const IdToken &id_token) override |
| | Deletes the authorization list entry with the given id_tag. More...
|
| |
| std::optional< v2::IdTokenInfo > | get_local_authorization_list_entry (const IdToken &id_token) override |
| | Returns the IdTagInfo of the given id_tag if it exists in the AUTH_LIST table, else std::nullopt. More...
|
| |
| void | clear_local_authorization_list () override |
| | Deletes all entries of the AUTH_LIST table. More...
|
| |
| int32_t | get_local_authorization_list_number_of_entries () override |
| | Get the number of entries currently in the authorization list. More...
|
| |
| void | transaction_metervalues_insert (const std::string &transaction_id, const MeterValue &meter_value) override |
| | Inserts a meter_value to the database linked to transaction with id transaction_id. More...
|
| |
| std::vector< MeterValue > | transaction_metervalues_get_all (const std::string &transaction_id) override |
| | Get all metervalues linked to transaction with id transaction_id. More...
|
| |
| void | transaction_metervalues_clear (const std::string &transaction_id) override |
| | Remove all metervalue entries linked to transaction with id transaction_id. More...
|
| |
| void | transaction_insert (const EnhancedTransaction &transaction, int32_t evse_id) override |
| | Inserts a transaction with the given parameters to the TRANSACTIONS table. More...
|
| |
| std::unique_ptr< EnhancedTransaction > | transaction_get (const int32_t evse_id) override |
| | Gets a transaction from the database if one can be found using evse_id. More...
|
| |
| void | transaction_update_seq_no (const std::string &transaction_id, int32_t seq_no) override |
| | Update the sequence number of the given transaction id in the database. More...
|
| |
| void | transaction_update_charging_state (const std::string &transaction_id, const ChargingStateEnum charging_state) override |
| | Update the charging state of the given transaction id in the database. More...
|
| |
| void | transaction_update_id_token_sent (const std::string &transaction_id, bool id_token_sent) override |
| | Update the id_token_sent of the given transaction id in the database. More...
|
| |
| void | transaction_delete (const std::string &transaction_id) override |
| | Clear all the transactions from the TRANSACTIONS table. More...
|
| |
| void | insert_or_update_charging_profile (const int evse_id, const v2::ChargingProfile &profile, const ChargingLimitSourceEnum charging_limit_source=ChargingLimitSourceEnum::CSO) override |
| | charging profiles More...
|
| |
| bool | delete_charging_profile (const int profile_id) override |
| | Deletes the profile with the given profile_id. More...
|
| |
| void | delete_charging_profile_by_transaction_id (const std::string &transaction_id) override |
| | Deletes the profiles with the given transaction_id. More...
|
| |
| bool | clear_charging_profiles () override |
| | Deletes all profiles from table CHARGING_PROFILES. More...
|
| |
| bool | clear_charging_profiles_matching_criteria (const std::optional< int32_t > profile_id, const std::optional< ClearChargingProfile > &criteria) override |
| | Deletes all profiles from table CHARGING_PROFILES matching profile_id or criteria. More...
|
| |
| std::vector< ReportedChargingProfile > | get_charging_profiles_matching_criteria (const std::optional< int32_t > evse_id, const ChargingProfileCriterion &criteria) override |
| | Get all profiles from table CHARGING_PROFILES matching profile_id or criteria. More...
|
| |
| std::vector< v2::ChargingProfile > | get_charging_profiles_for_evse (const int evse_id) override |
| | Retrieves the charging profiles stored on evse_id. More...
|
| |
| std::vector< v2::ChargingProfile > | get_all_charging_profiles () override |
| | Retrieves all ChargingProfiles. More...
|
| |
| virtual std::map< int32_t, std::vector< v2::ChargingProfile > > | get_all_charging_profiles_group_by_evse () override |
| | Retrieves all ChargingProfiles grouped by EVSE ID. More...
|
| |
| ChargingLimitSourceEnum | get_charging_limit_source_for_profile (const int profile_id) override |
| |
| std::unique_ptr< common::SQLiteStatementInterface > | new_statement (const std::string &sql) override |
| |
| 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< AuthorizationCacheEntry > | authorization_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::IdTokenInfo > | get_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< MeterValue > | transaction_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< EnhancedTransaction > | transaction_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< ReportedChargingProfile > | get_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::ChargingProfile > | get_charging_profiles_for_evse (const int evse_id)=0 |
| | Retrieves the charging profiles stored on evse_id. More...
|
| |
| virtual std::vector< v2::ChargingProfile > | get_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::SQLiteStatementInterface > | new_statement (const std::string &sql)=0 |
| |
Public Member Functions inherited from ocpp::common::DatabaseHandlerCommon |
| | DatabaseHandlerCommon (std::unique_ptr< DatabaseConnectionInterface > database, const fs::path &sql_migration_files_path, uint32_t target_schema_version) noexcept |
| | Common database handler class Class handles some common database functionality like inserting and removing transaction messages. More...
|
| |
|
void | open_connection () |
| | Opens connection to database file and performs the initialization by calling init_sql()
|
| |
|
void | close_connection () |
| | Closes the database connection.
|
| |
| virtual std::vector< DBTransactionMessage > | get_message_queue_messages (const QueueType queue_type=QueueType::Transaction) |
| | Get messages from messages queue table specified by queue_type. More...
|
| |
| virtual void | insert_message_queue_message (const DBTransactionMessage &message, const QueueType queue_type=QueueType::Transaction) |
| | Insert a new message into messages queue table specified by queue_type. More...
|
| |
| virtual void | remove_message_queue_message (const std::string &unique_id, const QueueType queue_type=QueueType::Transaction) |
| | Remove a message from the messages queue table specified by queue_type. More...
|
| |
| virtual void | clear_message_queue (const QueueType queue_type=QueueType::Transaction) |
| | Deletes all entries from message queue table specified by queue_type. More...
|
| |