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::capabilitiesDelegate::DiscoveryEventSender Class Reference

#include <DiscoveryEventSender.h>

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

Public Member Functions

 ~DiscoveryEventSender ()
 
DiscoveryEventSenderInterface method overrides.
bool sendDiscoveryEvents (const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender) override
 
void stop () override
 
void addDiscoveryStatusObserver (const std::shared_ptr< DiscoveryStatusObserverInterface > &observer) override
 
void removeDiscoveryStatusObserver (const std::shared_ptr< DiscoveryStatusObserverInterface > &observer) override
 
AlexaEventProcessedObserverInterface method overrides.
void onAlexaEventProcessedReceived (const std::string &eventCorrelationToken) override
 
AuthObserverInterface method overrides.
void onAuthStateChange (AuthObserverInterface::State newState, AuthObserverInterface::Error newError) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AlexaEventProcessedObserverInterface
virtual ~AlexaEventProcessedObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
virtual ~AuthObserverInterface ()=default
 
virtual void onAuthStateChange (State newState, Error error)=0
 

Static Public Member Functions

static std::shared_ptr< DiscoveryEventSendercreate (const std::unordered_map< std::string, std::string > &addOrUpdateReportEndpoints, const std::unordered_map< std::string, std::string > &deleteReportEndpoints, const std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > &authDelegate, bool waitForEventProcessed=true, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder=nullptr, bool postConnect=false)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
enum  State {
  State::UNINITIALIZED, State::REFRESHED, State::EXPIRED, State::UNRECOVERABLE_ERROR,
  State::AUTHORIZING
}
 The enum State describes the state of authorization. More...
 
enum  Error {
  Error::SUCCESS, Error::UNKNOWN_ERROR, Error::AUTHORIZATION_FAILED, Error::UNAUTHORIZED_CLIENT,
  Error::SERVER_ERROR, Error::INVALID_REQUEST, Error::INVALID_VALUE, Error::AUTHORIZATION_EXPIRED,
  Error::UNSUPPORTED_GRANT_TYPE, Error::INVALID_CODE_PAIR, Error::AUTHORIZATION_PENDING, Error::SLOW_DOWN,
  Error::INTERNAL_ERROR, Error::INVALID_CBL_CLIENT_ID
}
 The enum Error encodes possible errors which may occur when changing state. More...
 

Detailed Description

This class publishes Discovery.AddOrUpdateReport and Discovery.DeleteReport events.

Constructor & Destructor Documentation

◆ ~DiscoveryEventSender()

alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::~DiscoveryEventSender ( )

Destructor.

Member Function Documentation

◆ addDiscoveryStatusObserver()

void alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::addDiscoveryStatusObserver ( const std::shared_ptr< DiscoveryStatusObserverInterface > &  observer)
overridevirtual

◆ create()

static std::shared_ptr<DiscoveryEventSender> alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::create ( const std::unordered_map< std::string, std::string > &  addOrUpdateReportEndpoints,
const std::unordered_map< std::string, std::string > &  deleteReportEndpoints,
const std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > &  authDelegate,
bool  waitForEventProcessed = true,
const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &  metricRecorder = nullptr,
bool  postConnect = false 
)
static

Creates a new instance of the DiscoveryEventSender.

Parameters
addOrUpdateReportEndpointsThe map of endpoints for which the Discovery.AddOrUpdateReport event will be sent.
deleteReportEndpointsThe map of endpoints for which the Discovery.DeleteReport event will be sent.
authDelegateThe auth delegate instance to request the auth token from to be sent in the Discovery events.
waitForEventProcessedIndicate if sender should wait for the EventProcessed directive. Default is true.
metricRecorderOptional (may be nullptr) reference to metric recorder.
postConnectIndicate if sender is operating in post-connect operation context. Default is false.
Returns
a new instance of the DiscoveryEventSender.

◆ onAlexaEventProcessedReceived()

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

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

Parameters
eventCorrelationTokenThe EventCorrelationToken string.

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

◆ onAuthStateChange()

void alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::onAuthStateChange ( AuthObserverInterface::State  newState,
AuthObserverInterface::Error  newError 
)
override

◆ removeDiscoveryStatusObserver()

void alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::removeDiscoveryStatusObserver ( const std::shared_ptr< DiscoveryStatusObserverInterface > &  observer)
overridevirtual

◆ sendDiscoveryEvents()

bool alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::sendDiscoveryEvents ( const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &  messageSender)
overridevirtual

Sends Discovery.AddOrUpdateReport and Discovery.deleteReport events for the addOrUpdateEndpoints and deleteReportEndpoints with which this object was created.

Parameters
messageSenderThe MessageSenderInterface to send messages.
Returns
Whether sending the Discovery events was successful.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryEventSenderInterface.

◆ stop()

void alexaClientSDK::capabilitiesDelegate::DiscoveryEventSender::stop ( )
overridevirtual

Method to stop execution and unblock any condition variables that are waiting.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryEventSenderInterface.


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