AlexaClientSDK  1.19.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface Class Referenceabstract

#include <AlertStorageInterface.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface:
Inheritance graph
[legend]

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 load (std::vector< std::shared_ptr< Alert >> *alertContainer, std::shared_ptr< settings::DeviceSettingsManager > settingsManager)=0
 
virtual bool modify (std::shared_ptr< Alert > alert)=0
 
virtual bool erase (std::shared_ptr< Alert > alert)=0
 
virtual bool bulkErase (const std::list< std::shared_ptr< Alert >> &alertList)=0
 
virtual bool clearDatabase ()=0
 

Detailed Description

An Interface class which defines APIs for interacting with a general database, as well as for storing, loading, and modifying Alerts.

Constructor & Destructor Documentation

◆ ~AlertStorageInterface()

virtual alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::~AlertStorageInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ bulkErase()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::bulkErase ( const std::list< std::shared_ptr< Alert >> &  alertList)
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.

Note
It is not an error if an alert in the parameter list is not present in the database. This accommodates the race condition between an local alert deletion and a request from AVS.
Parameters
alertListThe list of alerts to be erased.
Returns
Whether all alerts were successfully erased.

Implemented in alexaClientSDK::capabilityAgents::alerts::test::StubAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ clearDatabase()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::clearDatabase ( )
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.

Returns
Whether the database was successfully cleared.

Implemented in alexaClientSDK::capabilityAgents::alerts::test::StubAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ close()

virtual void alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::close ( )
pure virtual

◆ createDatabase()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::createDatabase ( )
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.

Returns
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::capabilityAgents::alerts::test::StubAlertStorage, alexaClientSDK::capabilityAgents::alerts::test::MockAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ erase()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::erase ( std::shared_ptr< Alert alert)
pure virtual

Erases a single alert from the database.

Parameters
alertThe Alert to be erased.
Returns
Whether the Alert was successfully erased.

Implemented in alexaClientSDK::capabilityAgents::alerts::test::StubAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ load()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::load ( std::vector< std::shared_ptr< Alert >> *  alertContainer,
std::shared_ptr< settings::DeviceSettingsManager settingsManager 
)
pure virtual

Loads all alerts in the database.

Parameters
[out]alertContainerThe container where alerts should be stored.
settingsManagerA settingsManager object that manages alarm volume ramp setting.
Returns
Whether the Alerts were successfully loaded.

Implemented in alexaClientSDK::capabilityAgents::alerts::test::StubAlertStorage, alexaClientSDK::capabilityAgents::alerts::test::MockAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ modify()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::modify ( std::shared_ptr< Alert alert)
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.

Parameters
alertThe Alert to be modified.
Returns
Whether the Alert was successfully modified.

Implemented in alexaClientSDK::capabilityAgents::alerts::test::StubAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ open()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::open ( )
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.

Returns
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::capabilityAgents::alerts::test::StubAlertStorage, alexaClientSDK::capabilityAgents::alerts::test::MockAlertStorage, and alexaClientSDK::capabilityAgents::alerts::storage::SQLiteAlertStorage.

◆ store()

virtual bool alexaClientSDK::capabilityAgents::alerts::storage::AlertStorageInterface::store ( std::shared_ptr< Alert alert)
pure virtual

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

AlexaClientSDK 1.19.0 - Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0