AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::acsdkAssets::davs::DavsClient Class Reference

#include <DavsClient.h>

Inheritance diagram for alexaClientSDK::acsdkAssets::davs::DavsClient:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAssets::davs::DavsClient:
Collaboration graph
[legend]

Classes

struct  ArtifactGroup
 

Public Member Functions

 ~DavsClient () override=default
 
bool getIdleState () const
 
void setIdleState (bool idleState)
 
ArtifactHandlerInterface Functions
std::string registerArtifact (std::shared_ptr< commonInterfaces::DavsRequest > artifactRequest, std::shared_ptr< davsInterfaces::DavsDownloadCallbackInterface > downloadCallback, std::shared_ptr< davsInterfaces::DavsCheckCallbackInterface > checkCallback, bool downloadImmediately) override
 
void deregisterArtifact (const std::string &requestUUID) override
 
std::string downloadOnce (std::shared_ptr< commonInterfaces::DavsRequest > artifactRequest, std::shared_ptr< davsInterfaces::DavsDownloadCallbackInterface > downloadCallback, std::shared_ptr< davsInterfaces::DavsCheckCallbackInterface > checkCallback) override
 
void enableAutoUpdate (const std::string &requestUUID, bool enable) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkAssets::davsInterfaces::ArtifactHandlerInterface
virtual ~ArtifactHandlerInterface ()=default
 
virtual std::string registerArtifact (std::shared_ptr< commonInterfaces::DavsRequest > artifactRequest, std::shared_ptr< DavsDownloadCallbackInterface > downloadCallback, std::shared_ptr< DavsCheckCallbackInterface > checkCallback, bool downloadImmediately)=0
 
virtual std::string downloadOnce (std::shared_ptr< commonInterfaces::DavsRequest > artifactRequest, std::shared_ptr< DavsDownloadCallbackInterface > downloadCallback, std::shared_ptr< DavsCheckCallbackInterface > checkCallback)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionObserverInterface
virtual ~InternetConnectionObserverInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< DavsClientcreate (std::string workingDirectory, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface > authDelegate, std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionMonitorInterface > wifiMonitor, std::shared_ptr< davsInterfaces::DavsEndpointHandlerInterface > davsEndpointHandler, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr, std::chrono::seconds forcedUpdateInterval=std::chrono::seconds(0))
 

InternetConnectionObserverInterface functions

void onConnectionStatusChanged (bool connected) override
 AuthDelegate that curlWrapper will use to get the Authentication Token. More...
 
void checkAndUpdateArtifactGroupFromJson (const std::string &jsonArtifactList)
 AuthDelegate that curlWrapper will use to get the Authentication Token. More...
 
void checkAndUpdateArtifactGroupVector (const std::vector< DavsClient::ArtifactGroup > &artifactVector)
 AuthDelegate that curlWrapper will use to get the Authentication Token. More...
 

Constructor & Destructor Documentation

◆ ~DavsClient()

alexaClientSDK::acsdkAssets::davs::DavsClient::~DavsClient ( )
overridedefault

Member Function Documentation

◆ checkAndUpdateArtifactGroupFromJson()

void alexaClientSDK::acsdkAssets::davs::DavsClient::checkAndUpdateArtifactGroupFromJson ( const std::string &  jsonArtifactList)

AuthDelegate that curlWrapper will use to get the Authentication Token.

◆ checkAndUpdateArtifactGroupVector()

void alexaClientSDK::acsdkAssets::davs::DavsClient::checkAndUpdateArtifactGroupVector ( const std::vector< DavsClient::ArtifactGroup > &  artifactVector)

AuthDelegate that curlWrapper will use to get the Authentication Token.

◆ create()

static std::shared_ptr<DavsClient> alexaClientSDK::acsdkAssets::davs::DavsClient::create ( std::string  workingDirectory,
std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface authDelegate,
std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionMonitorInterface wifiMonitor,
std::shared_ptr< davsInterfaces::DavsEndpointHandlerInterface davsEndpointHandler,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr,
std::chrono::seconds  forcedUpdateInterval = std::chrono::seconds(0) 
)
static

Creates a DAVS Client given a working directory.

Parameters
workingDirectoryREQUIRED, place to store the temporary davs files, will be wiped on initialization.
authDelegateREQUIRED, the Authentication Delegate to generate the authentication token
wifiMonitorREQUIRED, the InternetConnectionMonitor that Davs client will subscribe to. It will check to see if we are connected to the internet or not and notify the DAVS client.
davsEndpointHandlerREQUIRED, the endpoint handler which is used to generate the proper DAVS request URL.
metricRecorderOPTIONAL, metric recorder used for recording metrics.
forcedUpdateIntervalOPTIONAL, sets the update interval for all artifact to a specific value. This is to be use only for testing! your devices will be throttled if used in production!
Returns
NULLABLE, new DAVS Client

◆ deregisterArtifact()

void alexaClientSDK::acsdkAssets::davs::DavsClient::deregisterArtifact ( const std::string &  requestUUID)
overridevirtual

Deregister an artifact, this cancels any download that's already been started and removes the request from the registration list.

Parameters
requestUUIDREQUIRED, uuid of the request to be deregistered.

Implements alexaClientSDK::acsdkAssets::davsInterfaces::ArtifactHandlerInterface.

◆ downloadOnce()

std::string alexaClientSDK::acsdkAssets::davs::DavsClient::downloadOnce ( std::shared_ptr< commonInterfaces::DavsRequest artifactRequest,
std::shared_ptr< davsInterfaces::DavsDownloadCallbackInterface downloadCallback,
std::shared_ptr< davsInterfaces::DavsCheckCallbackInterface checkCallback 
)
override

◆ enableAutoUpdate()

void alexaClientSDK::acsdkAssets::davs::DavsClient::enableAutoUpdate ( const std::string &  requestUUID,
bool  enable 
)
overridevirtual

Can set a downloadOnce artifact to auto update (like registerArtifact) or prevent an artifact from updating (like downloadOnce).

Parameters
requestUUIDREQUIRED, uuid of the request to be deregistered.
enableweather to enable auto update or disable it (the difference between registerArtifact and downloadOnce).

Implements alexaClientSDK::acsdkAssets::davsInterfaces::ArtifactHandlerInterface.

◆ getIdleState()

bool alexaClientSDK::acsdkAssets::davs::DavsClient::getIdleState ( ) const
Returns
true if the device is idle

◆ onConnectionStatusChanged()

void alexaClientSDK::acsdkAssets::davs::DavsClient::onConnectionStatusChanged ( bool  connected)
overridevirtual

AuthDelegate that curlWrapper will use to get the Authentication Token.

Implements alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionObserverInterface.

◆ registerArtifact()

std::string alexaClientSDK::acsdkAssets::davs::DavsClient::registerArtifact ( std::shared_ptr< commonInterfaces::DavsRequest artifactRequest,
std::shared_ptr< davsInterfaces::DavsDownloadCallbackInterface downloadCallback,
std::shared_ptr< davsInterfaces::DavsCheckCallbackInterface checkCallback,
bool  downloadImmediately 
)
override

◆ setIdleState()

void alexaClientSDK::acsdkAssets::davs::DavsClient::setIdleState ( bool  idleState)

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