AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage Class Reference

#include <SQLiteDeviceSettingStorage.h>

Inheritance diagram for alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage:
Collaboration graph
[legend]

Public Member Functions

 ~SQLiteDeviceSettingStorage ()
 
SettingStorageInterface Functions
bool open () override
 
void close () override
 
bool storeSetting (const std::string &key, const std::string &value, SettingStatus status) override
 
bool storeSettings (const std::vector< std::tuple< std::string, std::string, SettingStatus >> &data) override
 
SettingStatusAndValue loadSetting (const std::string &key) override
 
bool deleteSetting (const std::string &key) override
 
bool updateSettingStatus (const std::string &key, SettingStatus status) override
 
- Public Member Functions inherited from alexaClientSDK::settings::storage::DeviceSettingStorageInterface
virtual ~DeviceSettingStorageInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< DeviceSettingStorageInterfacecreateDeviceSettingStorageInterface (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot)
 
static std::unique_ptr< SQLiteDeviceSettingStoragecreate (const avsCommon::utils::configuration::ConfigurationNode &configurationRoot)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::settings::storage::DeviceSettingStorageInterface
using SettingStatusAndValue = std::pair< SettingStatus, std::string >
 

Constructor & Destructor Documentation

◆ ~SQLiteDeviceSettingStorage()

alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::~SQLiteDeviceSettingStorage ( )

Member Function Documentation

◆ close()

void alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::close ( )
overridevirtual

Close the currently open database, if one is open.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ create()

static std::unique_ptr<SQLiteDeviceSettingStorage> alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::create ( const avsCommon::utils::configuration::ConfigurationNode configurationRoot)
static

Factory method for creating a storage object for settings based on an SQLite database. Settings will be stored in the misc database.

Deprecated:
Use createDeviceSettingStorageInterface
Parameters
configurationRootThe global config object where the location of the misc database can be found.
Returns
Pointer to the SQLiteDeviceSettingStorage object, nullptr if there's an error creating it.

◆ createDeviceSettingStorageInterface()

static std::shared_ptr<DeviceSettingStorageInterface> alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::createDeviceSettingStorageInterface ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configurationRoot)
static

Factory method for creating a storage object for settings based on an SQLite database. Settings will be stored in the misc database.

Parameters
configurationRootThe global config object where the location of the misc database can be found.
Returns
Pointer to the SQLiteDeviceSettingStorage object, nullptr if there's an error creating it.

◆ deleteSetting()

bool alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::deleteSetting ( const std::string &  key)
overridevirtual

Removes the entry for a particular setting in the database.

Parameters
keyThe string identifier for the setting.
Returns
true if deletion is successful, false otherwise

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ loadSetting()

SettingStatusAndValue alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::loadSetting ( const std::string &  key)
overridevirtual

Retrieves the setting status and value from the database.

Parameters
keyThe string identifier for the setting.
Returns
The status and value of the setting. The value will contain the reason or error message if the status is NOT_AVAILABLE.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ open()

bool alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::open ( )
overridevirtual

Open an existing database.

Returns
true If the database is opened ok or is already open false if this object is already managing an open database, or if there is another internal reason the database could not be opened.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ storeSetting()

bool alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::storeSetting ( const std::string &  key,
const std::string &  value,
SettingStatus  status 
)
overridevirtual

Stores a single setting in the database.

Parameters
keyThe string identifier for the setting.
valueThe string value of the setting.
statusThe status of the setting.
Returns
Whether the setting was successfully stored.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ storeSettings()

bool alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::storeSettings ( const std::vector< std::tuple< std::string, std::string, SettingStatus >> &  data)
overridevirtual

Stores multiple setting in the database.

Parameters
dataA collection of key-value-status entries to store.
Returns
Whether the setting was successfully stored.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.

◆ updateSettingStatus()

bool alexaClientSDK::settings::storage::SQLiteDeviceSettingStorage::updateSettingStatus ( const std::string &  key,
SettingStatus  status 
)
overridevirtual

Update the status of a setting in the database. The update will fail if the setting does not exist.

Parameters
keyThe string identifier for the setting.
statusThe status of the setting.
Returns
Whether the status was successfully updated.

Implements alexaClientSDK::settings::storage::DeviceSettingStorageInterface.


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

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