AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Public Member Functions | |
MockCapabilityAgent (const std::string &nameSpace, const std::shared_ptr< MockExceptionEncounteredSender > &m_exceptionSender) | |
~MockCapabilityAgent () override | |
void | handleDirectiveImmediately (std::shared_ptr< AVSDirective > directive) override |
void | preHandleDirective (std::shared_ptr< DirectiveInfo > info) override |
void | handleDirective (std::shared_ptr< DirectiveInfo > info) override |
void | cancelDirective (std::shared_ptr< DirectiveInfo > info) override |
avs::DirectiveHandlerConfiguration | getConfiguration () const override |
void | testsendExceptionEncounteredAndReportFailed (std::shared_ptr< AVSDirective > directiveIn, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > resultIn) |
FunctionCalled | waitForFunctionCalls (const std::chrono::milliseconds duration=std::chrono::milliseconds(400)) |
const std::pair< std::string, std::string > | callBuildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdValue, const std::string &jsonPayloadValue, const std::string &jsonContext) |
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 | handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive)=0 |
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< MockCapabilityAgent > | create (const std::string &nameSpace, const std::shared_ptr< MockExceptionEncounteredSender > &m_exceptionSender) |
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< DirectiveInfo > | createDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) |
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::ExceptionEncounteredSenderInterface > | m_exceptionEncounteredSender |
Object to use to send exceptionEncountered messages. More... | |
alexaClientSDK::avsCommon::test::MockCapabilityAgent::MockCapabilityAgent | ( | const std::string & | nameSpace, |
const std::shared_ptr< MockExceptionEncounteredSender > & | m_exceptionSender | ||
) |
MockCapabilityAgent Constructor.
nameSpace | The namespace of the Capability Agent. |
m_exceptionSender | The ExceptionEncounteredSenderInterface instance. |
|
override |
const std::pair< std::string, std::string > alexaClientSDK::avsCommon::test::MockCapabilityAgent::callBuildJsonEventString | ( | const std::string & | eventName, |
const std::string & | dialogRequestIdValue, | ||
const std::string & | jsonPayloadValue, | ||
const std::string & | jsonContext | ||
) |
|
overridevirtual |
Cancel an ongoing preHandleDirective()
or handleDirective()
operation for the AVSDirective
in . Once this has been called the CapabilityAgent
should not expect to receive further calls regarding this directive.
AVSDirectives
.info | The DirectiveInfo instance for the AVSDirective to process. |
Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.
|
static |
Creates an instance of the MockCapabilityAgent
.
nameSpace | The namespace of the Capability Agent. |
m_exceptionSender | The ExceptionEncounteredSenderInterface instance. |
MockCapabilityAgent
.
|
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).
avs::DirectiveHandlerConfiguration
of the handler. Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.
|
overridevirtual |
Handle the action specified by the AVSDirective
in info
. The handling of subsequent directives with the same DialogRequestId
may be blocked until the DirectiveHandler
calls the setSucceeded()
method of the DirectiveHandlingResult
present in info
. If handling of this directive fails setFailed()
should be called to indicate a failure.
AVSDirectives
.info | The DirectiveInfo instance for the AVSDirective to process. |
Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.
|
override |
|
overridevirtual |
Notification that a directive has arrived. This notification gives the DirectiveHandler a chance to prepare for handling of an AVSDirective
. If an error occurs during the pre-Handling phase and that error should cancel the handling of subsequent AVSDirectives
with the same DialogRequestId
, the DirectiveHandler
should call the setFailed
method on the result
instance passed in to this call.
AVSDirectives
.info | The DirectiveInfo instance for the AVSDirective to process. |
Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.
void alexaClientSDK::avsCommon::test::MockCapabilityAgent::testsendExceptionEncounteredAndReportFailed | ( | std::shared_ptr< AVSDirective > | directiveIn, |
std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > | resultIn | ||
) |
Wrapper function to test protected method sendExceptionEncounteredAndReportFailed
directiveIn | The AVSDirective to pass to sendExceptionEncounteredAndReportFailed . |
resultIn | The DirectiveHandlerResultInterface to pass to sendExceptionEncounteredAndReportFailed . |
MockCapabilityAgent::FunctionCalled alexaClientSDK::avsCommon::test::MockCapabilityAgent::waitForFunctionCalls | ( | const std::chrono::milliseconds | duration = std::chrono::milliseconds(400) | ) |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0