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::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent Class Reference

#include <AlexaInterfaceCapabilityAgent.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent:
Collaboration graph
[legend]

Public Member Functions

avsCommon::avs::CapabilityConfiguration getCapabilityConfiguration ()
 
DirectiveHandlerInterface and CapabilityAgent Functions
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void preHandleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
virtual ~CapabilityAgent ()=default
 
void preHandleDirective (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) override final
 
bool handleDirective (const std::string &messageId) override final
 
void cancelDirective (const std::string &messageId) override final
 
void onDeregistered () override
 
void onFocusChanged (FocusState newFocus, MixingBehavior behavior) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
virtual void preHandleDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< DirectiveHandlerResultInterface > result)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface
virtual ~ChannelObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface
virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::NamespaceAndName &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 
virtual bool shouldQueryState ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const std::string &jsonContext)
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 

Static Public Member Functions

static std::shared_ptr< AlexaInterfaceCapabilityAgentcreateDefaultAlexaInterfaceCapabilityAgent (const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &alexaMessageSender, const std::shared_ptr< acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface > &alexaEventProcessedNotifier, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &endpointCapabilitiesRegistrar)
 
static std::shared_ptr< AlexaInterfaceCapabilityAgentcreate (const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier &endpointId, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &alexaMessageSender)
 
static std::shared_ptr< AlexaInterfaceCapabilityAgentcreate (const avsCommon::utils::DeviceInfo &deviceInfo, const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier &endpointId, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender, std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > alexaMessageSender)
 

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
 CapabilityAgent (const std::string &nameSpace, std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
virtual std::shared_ptr< DirectiveInfocreateDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result)
 
virtual void preHandleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void handleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void cancelDirective (std::shared_ptr< DirectiveInfo > info)=0
 
void removeDirective (const std::string &messageId)
 
void sendExceptionEncounteredAndReportFailed (std::shared_ptr< DirectiveInfo > info, const std::string &message, avsCommon::avs::ExceptionErrorType type=avsCommon::avs::ExceptionErrorType::INTERNAL_ERROR)
 
const std::pair< std::string, std::string > buildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdString="", const std::string &payload="{}", const std::string &context="") const
 
- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
const std::string m_namespace
 The namespace of the capability agent. More...
 
std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterfacem_exceptionEncounteredSender
 Object to use to send exceptionEncountered messages. More...
 

Detailed Description

Capability Agent to handle directives under the Alexa Namespace.

Member Function Documentation

◆ cancelDirective()

void alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::cancelDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ create() [1/2]

static std::shared_ptr<AlexaInterfaceCapabilityAgent> alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::create ( const std::shared_ptr< avsCommon::utils::DeviceInfo > &  deviceInfo,
const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier endpointId,
const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &  exceptionEncounteredSender,
const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &  alexaMessageSender 
)
static

Creates an instance of AlexaInterfaceCapabilityAgent.

Parameters
deviceInfoStructure with information about the Alexa client device.
endpointIdThe EndpointIdentifier for the endpoint that will own this capability.
exceptionEncounteredSenderThe ExceptionEncounteredSender to send exceptions.
alexaMessageSenderThe AlexaInterfaceMessageSender to send AlexaInterface events.
Returns
an instance of AlexaInterfaceCapabilityAgent on success, nullptr otherwise.

◆ create() [2/2]

static std::shared_ptr<AlexaInterfaceCapabilityAgent> alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::create ( const avsCommon::utils::DeviceInfo deviceInfo,
const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier endpointId,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender,
std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface alexaMessageSender 
)
static

Creates an instance of AlexaInterfaceCapabilityAgent.

Deprecated:
Parameters
deviceInfoStructure with information about the Alexa client device.
endpointIdThe endpoint to which this capability is associated.
exceptionEncounteredSenderThe ExceptionEncounteredSender to send exceptions.
alexaMessageSenderThe AlexaInterfaceMessageSender to send AlexaInterface events.
Returns
an instance of AlexaInterfaceCapabilityAgent on success, nullptr otherwise.

◆ createDefaultAlexaInterfaceCapabilityAgent()

static std::shared_ptr<AlexaInterfaceCapabilityAgent> alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::createDefaultAlexaInterfaceCapabilityAgent ( const std::shared_ptr< avsCommon::utils::DeviceInfo > &  deviceInfo,
const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &  exceptionEncounteredSender,
const std::shared_ptr< AlexaInterfaceMessageSenderInternalInterface > &  alexaMessageSender,
const std::shared_ptr< acsdkAlexaEventProcessedNotifierInterfaces::AlexaEventProcessedNotifierInterface > &  alexaEventProcessedNotifier,
const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &  endpointCapabilitiesRegistrar 
)
static

Creates an instance of AlexaInterfaceCapabilityAgent for the default endpoint.

Parameters
deviceInfoStructure with information about the Alexa client device.
exceptionEncounteredSenderThe ExceptionEncounteredSender to send exceptions.
alexaMessageSenderThe AlexaInterfaceMessageSender to send AlexaInterface events.
alexaEventProcessedNotifierThe AlexaEventProcessedNotifierInterface to notify observers of AlexaEventProcessed events.
endpointCapabilitiesRegistrarThe EndpointCapabilitiesRegistrarInterface for the default endpoint (annotated with DefaultEndpointAnnotation), so that the SpeakerManager can register itself as a capability with the default endpoint.
Returns
an instance of AlexaInterfaceCapabilityAgent on success, nullptr otherwise.

◆ getCapabilityConfiguration()

avsCommon::avs::CapabilityConfiguration alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::getCapabilityConfiguration ( )

Get the capability configuration for this agent.

Returns
The capability configuration.

◆ getConfiguration()

avsCommon::avs::DirectiveHandlerConfiguration alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::getConfiguration ( ) const
overridevirtual

Returns the configuration of the directive handler.

The configuration consists of multiple directive routing rules and their respective blocking policy. The directives will be matched from the most specific rule (with all fields defined) to the least specific rule (which only matches the directive endpointId).

Returns
The avs::DirectiveHandlerConfiguration of the handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ handleDirective()

void alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::handleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ handleDirectiveImmediately()

void alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
overridevirtual

Handle the action specified AVSDirective. Once this has been called the DirectiveHandler should not expect to receive further calls regarding this directive.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
If this operation fails, an ExceptionEncountered message should be sent to AVS.
Parameters
directiveThe directive to handle.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ preHandleDirective()

void alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent::preHandleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

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