![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <AlertStorageInterface.h>
Public Member Functions | |
virtual | ~AlertStorageInterface ()=default |
virtual bool | createDatabase ()=0 |
virtual bool | open ()=0 |
virtual void | close ()=0 |
virtual bool | store (std::shared_ptr< Alert > alert)=0 |
virtual bool | storeOfflineAlert (const std::string &token, const std::string &scheduledTime, const std::string &eventTime)=0 |
virtual bool | load (std::vector< std::shared_ptr< Alert >> *alertContainer, std::shared_ptr< settings::DeviceSettingsManager > settingsManager)=0 |
virtual bool | loadOfflineAlerts (rapidjson::Value *alertContainer, rapidjson::Document::AllocatorType &allocator)=0 |
virtual bool | modify (std::shared_ptr< Alert > alert)=0 |
virtual bool | erase (std::shared_ptr< Alert > alert)=0 |
virtual bool | eraseOffline (const std::string &token, int id)=0 |
virtual bool | bulkErase (const std::list< std::shared_ptr< Alert >> &alertList)=0 |
virtual bool | clearDatabase ()=0 |
An Interface class which defines APIs for interacting with a general database, as well as for storing, loading, and modifying Alerts.
|
virtualdefault |
Destructor.
|
pure virtual |
Erases multiple alerts from the database. This function must be atomic, no alert is to be deleted if there was an error deleting one.
alertList | The list of alerts to be erased. |
Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
A utility function to clear the database of all records. Note that the database will still exist, as will the tables. Only the rows will be erased.
Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Close the currently open database, if one is open.
Implemented in alexaClientSDK::acsdkAlerts::test::MockAlertStorage, alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Creates a new database. If a database is already being handled by this object or there is another internal error, then this function returns false.
true
If the database is created ok, or false
if a database is already being handled by this object or there is a problem creating the database. Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, alexaClientSDK::acsdkAlerts::test::MockAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Erases a single alert from the database.
alert | The Alert to be erased. |
Alert
was successfully erased. Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Erases a single alert from the offline database.
token | The alertToken of the alert to be erased. |
id | The id of the alert to be erased |
Implemented in alexaClientSDK::acsdkAlerts::test::MockAlertStorage, alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Loads all alerts in the database.
[out] | alertContainer | The container where alerts should be stored. |
settingsManager | A settingsManager object that manages alarm volume ramp setting. |
Alerts
were successfully loaded. Implemented in alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Loads all alerts in the offline database.
[out] | alertContainer | The container where alerts should be stored. |
allocator | The rapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects. |
Implemented in alexaClientSDK::acsdkAlerts::test::MockAlertStorage, alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Updates a database record of the Alert
parameter. The fields which are updated by this operation are the state and scheduled times of the alert. All other fields of an alert do not change over time, and so will not be captured in the database when calling this function.
alert | The Alert to be modified. |
Alert
was successfully modified. Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Open an existing database. If this object is already managing an open database, or there is a problem opening the database, this function returns false.
true
If the database is opened ok, false
if this object is already managing an open database, or if there is another internal reason the database could not be opened. Implemented in alexaClientSDK::acsdkAlerts::test::StubAlertStorage, alexaClientSDK::acsdkAlerts::test::MockAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Stores a single Alert
in the database.
The | Alert to store. |
Alert
was successfully stored. Implemented in alexaClientSDK::acsdkAlerts::test::MockAlertStorage, alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
|
pure virtual |
Stores a single Alert
in the offline alerts database.
token | The alertToken of the alert to be erased. |
scheduledTime | The scheduled time of the alert |
eventTime | the time the alert stopped |
Alert
was successfully stored. Implemented in alexaClientSDK::acsdkAlerts::test::MockAlertStorage, alexaClientSDK::acsdkAlerts::test::StubAlertStorage, and alexaClientSDK::acsdkAlerts::storage::SQLiteAlertStorage.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0