AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | List of all members
alexaClientSDK::integration::test::TestMessageSender Class Reference

#include <TestMessageSender.h>

Inheritance diagram for alexaClientSDK::integration::test::TestMessageSender:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::integration::test::TestMessageSender:
Collaboration graph
[legend]

Classes

class  SendParams
 

Public Member Functions

 ~TestMessageSender ()=default
 Destructor. More...
 
void sendMessage (std::shared_ptr< avsCommon::avs::MessageRequest > request) override
 
 TestMessageSender (std::shared_ptr< acl::MessageRouterInterface > messageRouter, bool isEnabled, std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface > connectionStatusObserver, std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > messageObserver)
 
SendParams waitForNext (const std::chrono::seconds duration)
 
void enable ()
 
void disable ()
 
bool isEnabled ()
 
void reconnect ()
 
void setAVSGateway (const std::string &avsGateway)
 
void addConnectionStatusObserver (std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface > observer)
 
void removeConnectionStatusObserver (std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface > observer)
 
void addMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)
 
void removeMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)
 
void doShutdown () override
 
std::shared_ptr< acl::AVSConnectionManagergetConnectionManager () const
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MessageSenderInterface
virtual ~MessageSenderInterface ()=default
 Destructor. More...
 
virtual void sendMessage (std::shared_ptr< avs::MessageRequest > request)=0
 
- 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
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ ~TestMessageSender()

alexaClientSDK::integration::test::TestMessageSender::~TestMessageSender ( )
default

Destructor.

◆ TestMessageSender()

alexaClientSDK::integration::test::TestMessageSender::TestMessageSender ( std::shared_ptr< acl::MessageRouterInterface messageRouter,
bool  isEnabled,
std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface connectionStatusObserver,
std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface messageObserver 
)

Member Function Documentation

◆ addConnectionStatusObserver()

void alexaClientSDK::integration::test::TestMessageSender::addConnectionStatusObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface observer)

◆ addMessageObserver()

void alexaClientSDK::integration::test::TestMessageSender::addMessageObserver ( std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface observer)

Adds an observer to be notified of message receptions.

Parameters
observerThe observer object to add.

◆ disable()

void alexaClientSDK::integration::test::TestMessageSender::disable ( )

Disable the AVSConnectionManager object. If the object is currently connected to AVS, then calling this function will cause the connection to be closed. If the object is not connected, then calling this function will do nothing.

◆ doShutdown()

void alexaClientSDK::integration::test::TestMessageSender::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ enable()

void alexaClientSDK::integration::test::TestMessageSender::enable ( )

Enable the AVSConnectionManager object to make connections to AVS. Once enabled, the object will attempt to create a connection to AVS. If the object is already connected, this function will do nothing.

◆ getConnectionManager()

std::shared_ptr< acl::AVSConnectionManager > alexaClientSDK::integration::test::TestMessageSender::getConnectionManager ( ) const

◆ isEnabled()

bool alexaClientSDK::integration::test::TestMessageSender::isEnabled ( )

Returns if the object is enabled for making connections to AVS.

Returns
Whether this Connection object is enabled to make connections.

◆ reconnect()

void alexaClientSDK::integration::test::TestMessageSender::reconnect ( )

This function causes the object, if enabled, to create new connection to AVS. If the object is already connected, then that connection will be closed and a new one created. If the object is not connected, but perhaps in the process of waiting for its next connection attempt, then its waiting policy will be reset and it will attempt to create a new connection immediately. If the object is disabled, then this function will do nothing.

◆ removeConnectionStatusObserver()

void alexaClientSDK::integration::test::TestMessageSender::removeConnectionStatusObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface observer)

Removes an observer from being notified of connection status changes.

Parameters
observerThe observer object to remove.

◆ removeMessageObserver()

void alexaClientSDK::integration::test::TestMessageSender::removeMessageObserver ( std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface observer)

Removes an observer from being notified of message receptions.

Parameters
observerThe observer object to remove.

◆ sendMessage()

void alexaClientSDK::integration::test::TestMessageSender::sendMessage ( std::shared_ptr< avsCommon::avs::MessageRequest request)
override

◆ setAVSGateway()

void alexaClientSDK::integration::test::TestMessageSender::setAVSGateway ( const std::string &  avsGateway)

Set the gateway URL for the AVS connection. Calling this function with a new value will cause the current active connection to be closed, and a new one opened to the new gateway.

Parameters
avsGatewayThe URL for the new AVS gateway.

◆ waitForNext()

TestMessageSender::SendParams alexaClientSDK::integration::test::TestMessageSender::waitForNext ( const std::chrono::seconds  duration)

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

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