16 #ifndef ALEXA_CLIENT_SDK_ACSDKALERTS_INCLUDE_ACSDKALERTS_STORAGE_SQLITEALERTSTORAGE_H_ 17 #define ALEXA_CLIENT_SDK_ACSDKALERTS_INCLUDE_ACSDKALERTS_STORAGE_SQLITEALERTSTORAGE_H_ 31 namespace acsdkAlerts {
51 const std::shared_ptr<avsCommon::utils::configuration::ConfigurationNode>& configurationRoot,
52 const std::shared_ptr<avsCommon::sdkInterfaces::audio::AudioFactoryInterface>& audioFactory,
53 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>
metricRecorder =
nullptr);
64 static std::unique_ptr<SQLiteAlertStorage>
create(
66 const std::shared_ptr<avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface>& alertsAudioFactory,
67 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>
metricRecorder =
nullptr);
78 void close()
override;
80 bool store(std::shared_ptr<Alert> alert)
override;
86 std::vector<std::shared_ptr<Alert>>* alertContainer,
87 std::shared_ptr<settings::DeviceSettingsManager> settingsManager)
override;
91 bool modify(std::shared_ptr<Alert> alert)
override;
93 bool erase(std::shared_ptr<Alert> alert)
override;
97 bool bulkErase(
const std::list<std::shared_ptr<Alert>>& alertList)
override;
129 const std::shared_ptr<avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface>& alertsAudioFactory,
130 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>
metricRecorder);
143 std::vector<std::shared_ptr<Alert>>* alertContainer,
144 std::shared_ptr<settings::DeviceSettingsManager> settingsManager);
156 bool storeOfflineAlertHelper(
171 bool loadOfflineAlertsHelper(
174 rapidjson::Document::AllocatorType& allocator);
184 bool eraseOfflineHelper(
const int dbVersion,
const std::string& token);
193 bool alertExists(
const int dbVersion,
const std::string& token);
200 bool isOfflineTableV1Legacy();
209 bool offlineAlertExists(
const int dbVersion,
const std::string& token);
217 bool migrateOfflineAlertsDbFromV1ToV2();
225 bool migrateAlertsDbFromV2ToV3();
234 bool modifyAlert(
const int dbVersion, std::shared_ptr<Alert> alert);
245 template <
typename Task,
typename...
Args>
246 bool retryDataMigration(Task task,
Args&&...
args);
249 std::shared_ptr<avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface> m_alertsAudioFactory;
255 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
268 #endif // ALEXA_CLIENT_SDK_ACSDKALERTS_INCLUDE_ACSDKALERTS_STORAGE_SQLITEALERTSTORAGE_H_ Definition: ConfigurationNode.h:71
def args
Definition: android_test.py:111
::std::string string
Definition: gtest-port.h:1097
Definition: WaitEvent.h:32
Definition: SQLiteAlertStorage.h:40
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
Definition: gmock-generated-matchers.h:481
bool erase(std::shared_ptr< Alert > alert) override
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
bool storeOfflineAlert(const std::string &token, const std::string &scheduledTime, const std::string &eventTime) override
static std::unique_ptr< SQLiteAlertStorage > create(const avsCommon::utils::configuration::ConfigurationNode &configurationRoot, const std::shared_ptr< avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface > &alertsAudioFactory, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
bool clearDatabase() override
bool createDatabase() override
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
bool modify(std::shared_ptr< Alert > alert) override
void printStats(StatLevel level=StatLevel::ONE_LINE)
bool loadOfflineAlerts(rapidjson::Value *alertContainer, rapidjson::Document::AllocatorType &allocator) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: SQLiteDatabase.h:36
bool bulkErase(const std::list< std::shared_ptr< Alert >> &alertList) override
bool load(std::vector< std::shared_ptr< Alert >> *alertContainer, std::shared_ptr< settings::DeviceSettingsManager > settingsManager) override
Definition: AlertStorageInterface.h:36
Print only a single line, providing a count of rows from each table.
Print all details of the Alerts table, summarizing the other tables.
Print all details of all records.
StatLevel
Definition: SQLiteAlertStorage.h:104
static std::shared_ptr< AlertStorageInterface > createAlertStorageInterface(const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot, const std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > &audioFactory, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
Definition: RetryTimer.h:30
bool eraseOffline(const std::string &token, int id) override
bool store(std::shared_ptr< Alert > alert) override