AlexaClientSDK  1.26.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::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage Class Reference

#include <SQLiteCapabilitiesDelegateStorage.h>

Inheritance diagram for alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage:
Collaboration graph
[legend]

Public Member Functions

 ~SQLiteCapabilitiesDelegateStorage ()
 
CapabilitiesDelegateStorageInterface method overrides.
bool createDatabase () override
 
bool open () override
 
void close () override
 
bool store (const std::string &endpointId, const std::string &endpointConfig) override
 
bool store (const std::unordered_map< std::string, std::string > &endpointIdToConfigMap) override
 
bool load (std::unordered_map< std::string, std::string > *endpointConfigMap) override
 
bool load (const std::string &endpointId, std::string *endpointConfig) override
 
bool erase (const std::string &endpointId) override
 
bool erase (const std::unordered_map< std::string, std::string > &endpointIdToConfigMap) override
 
bool clearDatabase () override
 
- Public Member Functions inherited from alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface
virtual ~CapabilitiesDelegateStorageInterface ()=default
 

Static Public Member Functions

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

Detailed Description

The SQLite implementation of the CapabilitiesDelegateStorageInterface.

Constructor & Destructor Documentation

◆ ~SQLiteCapabilitiesDelegateStorage()

alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::~SQLiteCapabilitiesDelegateStorage ( )

Destructor.

Member Function Documentation

◆ clearDatabase()

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::clearDatabase ( )
overridevirtual

Erases the entire storage.

Returns
True if clear operation was successful, false if there was a failure to erase the database.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ close()

void alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::close ( )
overridevirtual

◆ create()

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

Creates an instance of the SQLiteCapabilitiesDelegate.

Deprecated:
Parameters
configurationRootThe ConfigurationNode used to get database file configuration.
Returns
A pointer to the SQLiteCapabilitiesDelegate.

◆ createCapabilitiesDelegateStorageInterface()

std::unique_ptr< CapabilitiesDelegateStorageInterface > alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::createCapabilitiesDelegateStorageInterface ( const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &  configurationRoot)
static

Creates an instance of the SQLiteCapabilitiesDelegate.

Parameters
configurationRootThe ConfigurationNode used to get database file configuration.
Returns
A pointer to the SQLiteCapabilitiesDelegate.

◆ createDatabase()

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::createDatabase ( )
overridevirtual

Creates a new database.

Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ erase() [1/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::erase ( const std::string &  endpointId)
overridevirtual

Erases a single endpointConfig from the database.

Parameters
endpointIdThe endpointId key to erase from storage.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ erase() [2/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::erase ( const std::unordered_map< std::string, std::string > &  endpointIdToConfigMap)
overridevirtual

Erases a vector of endpoint Ids from the data base.

Parameters
endpointIdToConfigMapthe endpointId to Configuration map.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ load() [1/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::load ( std::unordered_map< std::string, std::string > *  endpointConfigMap)
overridevirtual

Loads the endpointConfigMap.

Parameters
endpointConfigMapThe endpoint config map pointer.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ load() [2/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::load ( const std::string &  endpointId,
std::string *  endpointConfig 
)
overridevirtual

Loads the endpointConfig with the given endpoint Id.

Parameters
endpointIdThe endpointId key used to load data from the storage.
endpointConfigThe pointer to the endpointConfig that will be updated, if the key is present in storage.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ open()

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::open ( )
overridevirtual

Opens the database.

Returns
True if successful, else false.

Check if the endpoint config table exists. If not, create the table.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ store() [1/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::store ( const std::string &  endpointId,
const std::string &  endpointConfig 
)
overridevirtual

Stores the endpointConfig with the endpointId in the database.

Parameters
endpointIdThe endpoint ID string.
endpointConfigThe full endpoint config sent in the discovery.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.

◆ store() [2/2]

bool alexaClientSDK::capabilitiesDelegate::storage::SQLiteCapabilitiesDelegateStorage::store ( const std::unordered_map< std::string, std::string > &  endpointIdToConfigMap)
overridevirtual

Stores the endpointConfigMap.

Parameters
endpointIdToConfigMapThe endpointId to configuration map.
Returns
True if successful, else false.

Implements alexaClientSDK::capabilitiesDelegate::storage::CapabilitiesDelegateStorageInterface.


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

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