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

#include <NotificationsStorageInterface.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface:
Inheritance graph
[legend]

Public Types

using IndicatorState = avsCommon::avs::IndicatorState
 Some useful shorthand. More...
 

Public Member Functions

virtual ~NotificationsStorageInterface ()=default
 
virtual bool createDatabase ()=0
 
virtual bool open ()=0
 
virtual void close ()=0
 
virtual bool enqueue (const NotificationIndicator &notificationIndicator)=0
 
virtual bool dequeue ()=0
 
virtual bool peek (NotificationIndicator *notificationIndicator)=0
 
virtual bool setIndicatorState (IndicatorState state)=0
 
virtual bool getIndicatorState (IndicatorState *state)=0
 
virtual bool checkForEmptyQueue (bool *empty)=0
 
virtual bool clearNotificationIndicators ()=0
 
virtual bool getQueueSize (int *size)=0
 

Detailed Description

This class implements an interface for interacting with a Notifications database.

Users should be notified of their pending notifications in the order that SetIndicator directives are received. NotificationIndicators are therefore stored in a queue and should be persisted across system shutdown.

This storage is also responsible for maintaining IndicatorState as defined in IndicatorState.h.

Member Typedef Documentation

◆ IndicatorState

Some useful shorthand.

Constructor & Destructor Documentation

◆ ~NotificationsStorageInterface()

virtual alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::~NotificationsStorageInterface ( )
virtualdefault

Member Function Documentation

◆ checkForEmptyQueue()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::checkForEmptyQueue ( bool *  empty)
pure virtual

Checks if there are any NotificationIndicator records in the database.

Parameters
[out]emptyWhether there were any records in the database.
Returns
Whether the operation was successful.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ clearNotificationIndicators()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::clearNotificationIndicators ( )
pure virtual

Clears the database of all NotificationIndicators.

Returns
Whether the clear operation was successful.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ close()

virtual void alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::close ( )
pure virtual

◆ createDatabase()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::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::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ dequeue()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::dequeue ( )
pure virtual

◆ enqueue()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::enqueue ( const NotificationIndicator notificationIndicator)
pure virtual

Enqueues a single NotificationIndicator in the database.

Parameters
notificationIndicatorThe NotificationIndicator to enqueue.
Returns
Whether the NotificationIndicator was successfully enqueued.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ getIndicatorState()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::getIndicatorState ( IndicatorState state)
pure virtual

Retrieves the currently stored IndicatorState.

Parameters
[out]stateA pointer to receive the currently stored IndicatorState
Returns
Whether the get operation was successful.
Note
The default IndicatorState for a new database is IndicatorState::OFF.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ getQueueSize()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::getQueueSize ( int *  size)
pure virtual

Gets the size of the queue (number of records in the queue table).

Parameters
[out]sizeA pointer to receive the calculated size.
Returns
Whether the size operation was successful.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ open()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::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::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ peek()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::peek ( NotificationIndicator notificationIndicator)
pure virtual

Peeks at the next NotificationIndicator in the database.

Parameters
[out]notificationIndicatorA pointer to receive the peeked NotificationIndicator
Returns
Whether the peek operation was successful.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.

◆ setIndicatorState()

virtual bool alexaClientSDK::capabilityAgents::notifications::NotificationsStorageInterface::setIndicatorState ( IndicatorState  state)
pure virtual

Stores the current IndicatorState.

Returns
Whether the store operation was successful.

Implemented in alexaClientSDK::capabilityAgents::notifications::test::TestNotificationsStorage, and alexaClientSDK::capabilityAgents::notifications::SQLiteNotificationsStorage.


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