AlexaClientSDK  1.25.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
 

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, const bool waitForEventProcessed=true)
 

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()

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,
const bool  waitForEventProcessed = true 
)
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.
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  error 
)
overridevirtual

Notification that an authorization state has changed.

Note
Implementations of this method must not call AuthDelegate methods because the AuthDelegate may be in a 'locked' state at the time this call is made.
Parameters
newStateThe new state of the authorization token.
errorThe error associated to the state change.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface.

◆ 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.

Ensure that sendDiscoveryEvents method cannot be called twice.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryEventSenderInterface.

◆ stop()

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

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

Reset the observer.

Implements alexaClientSDK::capabilitiesDelegate::DiscoveryEventSenderInterface.


The documentation for this class was generated from the following files:

AlexaClientSDK 1.25.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0