![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <DirectiveHandlerInterface.h>
Public Member Functions | |
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 |
virtual bool | handleDirective (const std::string &messageId)=0 |
virtual void | cancelDirective (const std::string &messageId)=0 |
virtual void | onDeregistered ()=0 |
virtual avs::DirectiveHandlerConfiguration | getConfiguration () const =0 |
Interface for handling AVSDirectives
. For each AVSDirective
received, implementations of this interface should expect either a single call to handleDirectiveImmediately()
or a call to preHandleDirective()
followed by a call to handleDirective()
unless cancelDirective()
is called first. cancelDirective()
may also be called after handleDirective().
AVSDirectives
.
|
virtualdefault |
Destructor.
|
pure virtual |
Cancel an ongoing preHandleDirective()
or handleDirective()
operation for the specified AVSDirective
. Once this has been called the DirectiveHandler
should not expect to receive further calls regarding this directive.
AVSDirectives
.messageId | The message ID of a directive previously passed to preHandleDirective(). |
Implemented in alexaClientSDK::avsCommon::avs::CapabilityAgent, and alexaClientSDK::avsCommon::avs::test::TestDirectiveHandler.
|
pure virtual |
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. Implemented in alexaClientSDK::capabilityAgents::aip::AudioInputProcessor, alexaClientSDK::avsCommon::test::MockCapabilityAgent, alexaClientSDK::acsdkBluetooth::Bluetooth, alexaClientSDK::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::acsdkExternalMediaPlayer::ExternalMediaPlayer, alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent, alexaClientSDK::acsdkNotifications::NotificationsCapabilityAgent, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::capabilityAgents::doNotDisturb::DoNotDisturbCapabilityAgent, alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent, alexaClientSDK::aplCapabilityCommon::BaseAPLCapabilityAgent, alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent, alexaClientSDK::capabilityAgents::modeController::ModeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::rangeController::RangeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::toggleController::ToggleControllerCapabilityAgent, alexaClientSDK::acsdkEqualizer::EqualizerCapabilityAgent, alexaClientSDK::capabilityAgents::system::SoftwareInfoSender, alexaClientSDK::capabilityAgents::system::UserInactivityMonitor, alexaClientSDK::capabilityAgents::powerController::PowerControllerCapabilityAgent, alexaClientSDK::capabilityAgents::system::ReportStateHandler, alexaClientSDK::capabilityAgents::system::TimeZoneHandler, alexaClientSDK::capabilityAgents::apiGateway::ApiGatewayCapabilityAgent, alexaClientSDK::capabilityAgents::system::LocaleHandler, alexaClientSDK::capabilityAgents::system::RevokeAuthorizationHandler, and alexaClientSDK::avsCommon::avs::test::TestDirectiveHandler.
|
pure virtual |
Handle the action specified by the directive identified by messageId
. The handling of subsequent directives with the same DialogRequestId
may be blocked until the DirectiveHandler
calls the setSucceeded()
method of the DirectiveHandlingResult
instance passed in to the preHandleDirective()
call for the directive specified by messageId
. If handling of this directive fails such that subsequent directives with the same DialogRequestId
should be cancelled, this DirectiveHandler
should instead call setFailed() to indicate a failure.
ExceptionEncountered
message should be sent to AVS. AVSDirectives
.messageId | The message ID of a directive previously passed to preHandleDirective() . |
false
when messageId
is not recognized, else true
. Any errors related to handling of a valid messageId should be reported using DirectiveHandlerResultInterface::setFailed()
. Implemented in alexaClientSDK::avsCommon::avs::CapabilityAgent, and alexaClientSDK::avsCommon::avs::test::TestDirectiveHandler.
|
pure virtual |
Handle the action specified AVSDirective
. Once this has been called the DirectiveHandler
should not expect to receive further calls regarding this directive.
AVSDirectives
. ExceptionEncountered
message should be sent to AVS.directive | The directive to handle. |
Implemented in alexaClientSDK::capabilityAgents::aip::AudioInputProcessor, alexaClientSDK::acsdkBluetooth::Bluetooth, alexaClientSDK::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::acsdkExternalMediaPlayer::ExternalMediaPlayer, alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::acsdkNotifications::NotificationsCapabilityAgent, alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceCapabilityAgent, alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent, alexaClientSDK::acsdkEqualizer::EqualizerCapabilityAgent, alexaClientSDK::capabilityAgents::system::SoftwareInfoSender, alexaClientSDK::capabilityAgents::modeController::ModeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::rangeController::RangeControllerCapabilityAgent, alexaClientSDK::capabilityAgents::system::UserInactivityMonitor, alexaClientSDK::capabilityAgents::toggleController::ToggleControllerCapabilityAgent, alexaClientSDK::capabilityAgents::powerController::PowerControllerCapabilityAgent, alexaClientSDK::capabilityAgents::system::ReportStateHandler, alexaClientSDK::capabilityAgents::system::TimeZoneHandler, alexaClientSDK::capabilityAgents::apiGateway::ApiGatewayCapabilityAgent, alexaClientSDK::capabilityAgents::system::LocaleHandler, and alexaClientSDK::capabilityAgents::system::RevokeAuthorizationHandler.
|
pure virtual |
Notification that this handler has been de-registered and will not receive any more calls.
Implemented in alexaClientSDK::capabilityAgents::aip::AudioInputProcessor, alexaClientSDK::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::acsdkExternalMediaPlayer::ExternalMediaPlayer, alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::avsCommon::avs::CapabilityAgent, and alexaClientSDK::avsCommon::avs::test::TestDirectiveHandler.
|
pure virtual |
Notification that a directive has arrived. This notification gives the DirectiveHandler a chance to prepare for handling the directive. For example, the DirectiveHandler
might use this notification to start downloading an asset that will be required when it becomes time to actually handle the directive. The DirectiveHandler
will be notified when it should start the actual handling of the directive by a subsequent call to handleDirective(). 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.
ExceptionEncountered
message should be sent to AVS. AVSDirectives
.directive | The directive to pre-handle. |
result | An object to receive the result of the operation. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0