AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::aplCapabilityCommon::test::APLCATest Class Reference
Inheritance diagram for alexaClientSDK::aplCapabilityCommon::test::APLCATest:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::aplCapabilityCommon::test::APLCATest:
Collaboration graph
[legend]

Public Member Functions

 ~APLCATest ()=default
 
 APLCATest (std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::string aplVersion, std::shared_ptr< alexaClientSDK::aplCapabilityCommonInterfaces::VisualStateProviderInterface > visualStateProvider=nullptr)
 
BaseAPLCapabilityAgent template functions
alexaClientSDK::avsCommon::avs::DirectiveHandlerConfiguration getAPLDirectiveConfiguration () const override
 Template Methods to be implemented in Concrete Implementations. More...
 
std::unordered_set< std::shared_ptr< alexaClientSDK::avsCommon::avs::CapabilityConfiguration > > getAPLCapabilityConfigurations (const std::string &APLMaxVersion) override
 
aplCapabilityCommon::BaseAPLCapabilityAgent::DirectiveType getDirectiveType (std::shared_ptr< DirectiveInfo > info) override
 
const std::string & getConfigurationRootKey () override
 
const std::string & getMetricDataPointName (aplCapabilityCommon::BaseAPLCapabilityAgent::MetricEvent event) override
 
const std::string & getMetricActivityName (aplCapabilityCommon::BaseAPLCapabilityAgent::MetricActivity activity) override
 
aplCapabilityCommon::BaseAPLCapabilityAgent::PresentationSessionFieldNames getPresentationSessionFieldNames () override
 
const bool shouldPackPresentationSessionToAvsEvents () override
 
- Public Member Functions inherited from alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent
 BaseAPLCapabilityAgent (const std::string &avsNamespace, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, const std::string &APLMaxVersion, std::shared_ptr< alexaClientSDK::aplCapabilityCommonInterfaces::VisualStateProviderInterface > visualStateProvider=nullptr)
 
virtual ~BaseAPLCapabilityAgent ()=default
 
virtual bool initialize ()
 
void setExecutor (const std::shared_ptr< alexaClientSDK::avsCommon::utils::threading::Executor > &executor)
 Tests Facing interfaces. More...
 
void handleDirectiveImmediately (std::shared_ptr< alexaClientSDK::avsCommon::avs::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
 
alexaClientSDK::avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
std::unordered_set< std::shared_ptr< alexaClientSDK::avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations () override
 
void onContextAvailable (const std::string &jsonContext) override
 
void onContextFailure (const alexaClientSDK::avsCommon::sdkInterfaces::ContextRequestError error) override
 
void provideState (const alexaClientSDK::avsCommon::avs::NamespaceAndName &stateProviderName, unsigned int stateRequestToken) override
 
void doShutdown () override
 
void onActiveDocumentChanged (const aplCapabilityCommonInterfaces::PresentationToken &token, const alexaClientSDK::aplCapabilityCommonInterfaces::PresentationSession &session) override
 
void clearExecuteCommands (const aplCapabilityCommonInterfaces::PresentationToken &token=std::string(), const bool markAsFailed=true) override
 
void sendUserEvent (const aplCapabilityCommonInterfaces::aplEventPayload::UserEvent &eventPayload) override
 
void sendDataSourceFetchRequestEvent (const aplCapabilityCommonInterfaces::aplEventPayload::DataSourceFetch &fetchPayload) override
 
void sendRuntimeErrorEvent (const aplCapabilityCommonInterfaces::aplEventPayload::RuntimeError &errors) override
 
void onVisualContextAvailable (avsCommon::sdkInterfaces::ContextRequestToken requestToken, const aplCapabilityCommonInterfaces::aplEventPayload::VisualContext &context) override
 
void processRenderDocumentResult (const aplCapabilityCommonInterfaces::PresentationToken &token, const bool result, const std::string &error) override
 
void processExecuteCommandsResult (const aplCapabilityCommonInterfaces::PresentationToken &token, aplCapabilityCommonInterfaces::APLCommandExecutionEvent event, const std::string &error) override
 
void recordRenderComplete (const std::chrono::steady_clock::time_point &timestamp) override
 
void proactiveStateReport () 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 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::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 endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- 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::CapabilityConfigurationInterface
virtual ~CapabilityConfigurationInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::aplCapabilityCommonInterfaces::APLCapabilityAgentInterface
virtual ~APLCapabilityAgentInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::notifier::Notifier< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface >
 Notifier ()
 
void addObserver (const std::shared_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &observer) override
 Add an observer. More...
 
void removeObserver (const std::shared_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &observer) override
 Remove an observer. More...
 
void addWeakPtrObserver (const std::weak_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &observer) override
 Add a weak reference to an observer. More...
 
void removeWeakPtrObserver (const std::weak_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &observer) override
 Remove an observer. More...
 
void notifyObservers (std::function< void(const std::shared_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &)> notify) override
 Notify the observers in the order that they were added. More...
 
bool notifyObserversInReverse (std::function< void(const std::shared_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &)> notify) override
 Notify the observers in the reverse order that they were added. More...
 
void setAddObserverFunction (std::function< void(const std::shared_ptr< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface > &)> addObserverFunc) override
 Set a function for notifications on an observer additions. More...
 
- Public Member Functions inherited from alexaClientSDK::notifierInterfaces::NotifierInterface< aplCapabilityCommonInterfaces::APLCapabilityAgentObserverInterface >
virtual ~NotifierInterface ()=default
 

Additional Inherited Members

- Protected Types inherited from alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent
enum  DirectiveType {
  DirectiveType::RENDER_DOCUMENT, DirectiveType::SHOW_DOCUMENT, DirectiveType::EXECUTE_COMMAND, DirectiveType::DYNAMIC_TOKEN_DATA_SOURCE_UPDATE,
  DirectiveType::DYNAMIC_INDEX_DATA_SOURCE_UPDATE, DirectiveType::UNKNOWN
}
 Concrete Implementation Facing Interfaces. More...
 
enum  MetricEvent { MetricEvent::RENDER_DOCUMENT }
 Enumeration of timer metrics events that could be emitted. More...
 
enum  MetricActivity { MetricActivity::ACTIVITY_RENDER_DOCUMENT, MetricActivity::ACTIVITY_RENDER_DOCUMENT_FAIL }
 Enumeration of timer metric activity names that could be emitted. More...
 
- Protected Member Functions inherited from alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent
void handleUnknownDirective (std::shared_ptr< DirectiveInfo > info)
 
void setHandlingCompleted (std::shared_ptr< DirectiveInfo > info)
 
std::shared_ptr< alexaClientSDK::avsCommon::utils::threading::ExecutorgetExecutor ()
 
- 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)
 
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...
 

Constructor & Destructor Documentation

◆ ~APLCATest()

alexaClientSDK::aplCapabilityCommon::test::APLCATest::~APLCATest ( )
default

◆ APLCATest()

alexaClientSDK::aplCapabilityCommon::test::APLCATest::APLCATest ( std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionSender,
std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricRecorderInterface metricRecorder,
std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface contextManager,
std::string  aplVersion,
std::shared_ptr< alexaClientSDK::aplCapabilityCommonInterfaces::VisualStateProviderInterface visualStateProvider = nullptr 
)
inline

Constructor.

Parameters
exceptionSenderThe object to send AVS Exception messages.
messageSenderThe object to send message to AVS.
contextManagerThe object to fetch the context of the system.
visualStateProviderThe VisualStateProviderInterface object used to request visual context.

Member Function Documentation

◆ getAPLCapabilityConfigurations()

std::unordered_set<std::shared_ptr<alexaClientSDK::avsCommon::avs::CapabilityConfiguration> > alexaClientSDK::aplCapabilityCommon::test::APLCATest::getAPLCapabilityConfigurations ( const std::string &  APLMaxVersion)
inlineoverridevirtual

Get specific capability configuration for this APL Capability Agent

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getAPLDirectiveConfiguration()

alexaClientSDK::avsCommon::avs::DirectiveHandlerConfiguration alexaClientSDK::aplCapabilityCommon::test::APLCATest::getAPLDirectiveConfiguration ( ) const
inlineoverridevirtual

Template Methods to be implemented in Concrete Implementations.

Get specific directive handler configuration for this APL Capability Agent

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getConfigurationRootKey()

const std::string& alexaClientSDK::aplCapabilityCommon::test::APLCATest::getConfigurationRootKey ( )
inlineoverridevirtual

Get root key for the configuration values in the AVS json configuration

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getDirectiveType()

aplCapabilityCommon::BaseAPLCapabilityAgent::DirectiveType alexaClientSDK::aplCapabilityCommon::test::APLCATest::getDirectiveType ( std::shared_ptr< DirectiveInfo info)
inlineoverridevirtual

Get DirectiveType from Directive header information

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getMetricActivityName()

const std::string& alexaClientSDK::aplCapabilityCommon::test::APLCATest::getMetricActivityName ( aplCapabilityCommon::BaseAPLCapabilityAgent::MetricActivity  activity)
inlineoverridevirtual

Given a Metric Activity, provide the metric data point name to publish.

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getMetricDataPointName()

const std::string& alexaClientSDK::aplCapabilityCommon::test::APLCATest::getMetricDataPointName ( aplCapabilityCommon::BaseAPLCapabilityAgent::MetricEvent  event)
inlineoverridevirtual

Given a Metric Event, provide the metric data point name to publish.

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ getPresentationSessionFieldNames()

aplCapabilityCommon::BaseAPLCapabilityAgent::PresentationSessionFieldNames alexaClientSDK::aplCapabilityCommon::test::APLCATest::getPresentationSessionFieldNames ( )
inlineoverridevirtual

In presentation session part of RenderDocument directives, there are some field names that differ slightly between CAs, the derived class may override this function to provide the field names that represent these fields in the directive.

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.

◆ shouldPackPresentationSessionToAvsEvents()

const bool alexaClientSDK::aplCapabilityCommon::test::APLCATest::shouldPackPresentationSessionToAvsEvents ( )
inlineoverridevirtual

Whether AVS events should include presentationSession in their payload.

Implements alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent.


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