AlexaClientSDK  1.19.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::CapabilitiesDelegate Class Reference

#include <CapabilitiesDelegate.h>

Inheritance diagram for alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate:
Collaboration graph
[legend]

Public Member Functions

void addDiscoveryEventSender (const std::shared_ptr< DiscoveryEventSenderInterface > &discoveryEventSender)
 
CapabilitiesDelegateInterface method overrides.
bool registerEndpoint (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities) override
 
void addCapabilitiesObserver (std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesObserverInterface > observer) override
 
void removeCapabilitiesObserver (std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesObserverInterface > observer) override
 
void invalidateCapabilities () override
 
AlexaEventProcessedObserverInterface method overrides.
void onAlexaEventProcessedReceived (const std::string &eventCorrelationToken) override
 
RequiresShutdown Functions
void doShutdown () override
 
PostConnectOperationInterfaceProvider Functions.
std::shared_ptr< avsCommon::sdkInterfaces::PostConnectOperationInterfacecreatePostConnectOperation () override
 
DiscoveryObserverInterface methods
void onDiscoveryCompleted (const std::unordered_map< std::string, std::string > &addOrUpdateReportEndpoints, const std::unordered_map< std::string, std::string > &deleteReportEndpoints) override
 
void onDiscoveryFailure (avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status status) override
 
AVSGatewayManagerInterface methods
void onAVSGatewayChanged (const std::string &avsGateway) override
 
CustomerDataHandler Functions
void clearData () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilitiesDelegateInterface
virtual ~CapabilitiesDelegateInterface ()=default
 
virtual bool registerEndpoint (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AlexaEventProcessedObserverInterface
virtual ~AlexaEventProcessedObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AVSGatewayObserverInterface
virtual ~AVSGatewayObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::PostConnectOperationProviderInterface
virtual ~PostConnectOperationProviderInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::capabilitiesDelegate::DiscoveryStatusObserverInterface
virtual ~DiscoveryStatusObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandler
 CustomerDataHandler (std::shared_ptr< CustomerDataManager > customerDataManager)
 
virtual ~CustomerDataHandler ()
 

Static Public Member Functions

static std::shared_ptr< CapabilitiesDelegatecreate (const std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > &authDelegate, const std::shared_ptr< storage::CapabilitiesDelegateStorageInterface > &storage, const std::shared_ptr< registrationManager::CustomerDataManager > &customerDataManager)
 

Additional Inherited Members

Detailed Description

CapabilitiesDelegate provides an implementation of the CapabilitiesDelegateInterface. It allows clients to register capabilities implemented by agents and publish them so that Alexa is aware of the device's capabilities.

Member Function Documentation

◆ addCapabilitiesObserver()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::addCapabilitiesObserver ( std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesObserverInterface observer)
overridevirtual

Specify an object to observe changes to the state of this CapabilitiesDelegate. During the call to this setter the observers onCapabilitiesStateChange() method will be called back with the current capabilities state.

Parameters
observerThe object to observe the state of this CapabilitiesDelegate.

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilitiesDelegateInterface.

◆ addDiscoveryEventSender()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::addDiscoveryEventSender ( const std::shared_ptr< DiscoveryEventSenderInterface > &  discoveryEventSender)

Adds the event sender used to send Discovery events.

◆ clearData()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::clearData ( )
overridevirtual

Reset any internal state that may be associated with a particular user.

Warning
Object must succeed in deleting any customer data.
This method is called while CustomerDataManager is in a locked state. Do not call or wait for any CustomerDataManager operation.

Implements alexaClientSDK::registrationManager::CustomerDataHandler.

◆ create()

std::shared_ptr< CapabilitiesDelegate > alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::create ( const std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > &  authDelegate,
const std::shared_ptr< storage::CapabilitiesDelegateStorageInterface > &  storage,
const std::shared_ptr< registrationManager::CustomerDataManager > &  customerDataManager 
)
static

Create an CapabilitiesDelegate.

Parameters
authDelegateThe auth delegate instance needed for CapabilitiesDelegate.
storageThe storage instance needed for CapabilitiesDelegate.
customerDataManagerObject that will track the CustomerDataHandler.
Returns
If successful, returns a new CapabilitiesDelegate, otherwise nullptr.

◆ createPostConnectOperation()

std::shared_ptr< PostConnectOperationInterface > alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::createPostConnectOperation ( )
overridevirtual

Creates a post connect operation instance.

Returns
a new instance of the PostConnectOperationInterface.

Find the endpoints whose configuration has changed.

Endpoint configuration has been updated.

Remove this endpoint from the stored endpoint list.

Endpoint has been freshly added.

The remaining items in the stored list are the endpoints that need to be deleted.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PostConnectOperationProviderInterface.

◆ doShutdown()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ invalidateCapabilities()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::invalidateCapabilities ( )
overridevirtual

Invalidates the capabilities reported to the AVS last. Capabilities information should be rebuilt and reported to the AVS during the next synchronization.

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilitiesDelegateInterface.

◆ onAlexaEventProcessedReceived()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::onAlexaEventProcessedReceived ( const std::string &  eventCorrelationToken)
overridevirtual

This function is called whenever an Alexa.EventProcessed directive is received.

Parameters
eventCorrelationTokenThe EventCorrelationToken string.

Forward the eventCorrelation token to the discovery event sender.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AlexaEventProcessedObserverInterface.

◆ onAVSGatewayChanged()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::onAVSGatewayChanged ( const std::string &  avsGateway)
overridevirtual

Observer method to be called when the AVS Gateway is changed.

Parameters
avsGatewayThe AVS Gateway the device should be connected to.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AVSGatewayObserverInterface.

◆ onDiscoveryCompleted()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::onDiscoveryCompleted ( const std::unordered_map< std::string, std::string > &  addOrUpdateReportEndpoints,
const std::unordered_map< std::string, std::string > &  deleteReportEndpoints 
)
overridevirtual

This method will be called when the discovery event has completed successfully.

Note
: This method will be called from PostConnectCapabilitiesPublisher 's execution thread and should return immediately.
: This method will be called by the PostConnectCapabilitiesPublisher to report the success state when ALL of the the discovery events are sent.
Parameters
addOrUpdateReportEndpointsThe map of addOrUpdateReport endpoints sent in the discovery events.
deleteReportEndpointsThe map of deleteReport endpoints sent in the discovery events.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryStatusObserverInterface.

◆ onDiscoveryFailure()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::onDiscoveryFailure ( avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status  status)
overridevirtual

This method will be called when the discovery event has failed.

Parameters
statusThe MessageRequestObserverInterface::Status indicating the HTTP error encountered.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryStatusObserverInterface.

◆ registerEndpoint()

bool alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::registerEndpoint ( const avsCommon::avs::AVSDiscoveryEndpointAttributes endpointAttributes,
const std::vector< avsCommon::avs::CapabilityConfiguration > &  capabilities 
)
override

◆ removeCapabilitiesObserver()

void alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate::removeCapabilitiesObserver ( std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesObserverInterface observer)
overridevirtual

Remove an observer

Parameters
observerThe observer to remove.

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilitiesDelegateInterface.


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

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