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

#include <DavsRequester.h>

Inheritance diagram for alexaClientSDK::acsdkAssets::manager::DavsRequester:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAssets::manager::DavsRequester:
Collaboration graph
[legend]

Public Member Functions

 ~DavsRequester () override
 
DavsCheckCallbackInterface Functions
bool checkIfOkToDownload (std::shared_ptr< commonInterfaces::VendableArtifact > availableArtifact, size_t freeSpaceNeeded) override
 
void onCheckFailure (commonInterfaces::ResultCode errorCode) override
 
DavsDownloadCallbackInterface Functions
void onStart () override
 
void onArtifactDownloaded (std::shared_ptr< commonInterfaces::VendableArtifact > downloadedArtifact, const std::string &path) override
 
void onDownloadFailure (commonInterfaces::ResultCode errorCode) override
 
void onProgressUpdate (int progress) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkAssets::manager::Requester
virtual ~Requester ()
 
size_t deleteAndCleanup ()
 
void handleUpdate (bool accept)
 
std::string name () const
 
const std::shared_ptr< commonInterfaces::ArtifactRequest > & getArtifactRequest () const
 
commonInterfaces::State getState () const
 
std::chrono::milliseconds getLastUsed () const
 
commonInterfaces::Priority getPriority () const
 
bool isDownloaded ()
 
std::string getArtifactPath ()
 
virtual void setPriority (commonInterfaces::Priority newPriority)
 
bool validateWriteRequest (const std::string &name, int newValue) override
 Override of the CommunicationPropertyValidatorInterface. More...
 
std::string functionToBeInvoked (const std::string &Name) override
 Override of the InvokeFunctionInterface. More...
 
- Public Member Functions inherited from alexaClientSDK::acsdkCommunicationInterfaces::CommunicationPropertyValidatorInterface< int >
virtual ~CommunicationPropertyValidatorInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkCommunicationInterfaces::FunctionInvokerInterface< std::string >
virtual ~FunctionInvokerInterface ()=default
 
virtual std::string functionToBeInvoked (const std::string &name, Types... args)=0
 
- Public Member Functions inherited from alexaClientSDK::acsdkAssets::davsInterfaces::DavsCheckCallbackInterface
virtual ~DavsCheckCallbackInterface ()=default
 
virtual bool checkIfOkToDownload (std::shared_ptr< commonInterfaces::VendableArtifact > artifact, size_t freeSpaceNeeded)=0
 
- Public Member Functions inherited from alexaClientSDK::acsdkAssets::davsInterfaces::DavsDownloadCallbackInterface
virtual ~DavsDownloadCallbackInterface ()=default
 
virtual void onArtifactDownloaded (std::shared_ptr< commonInterfaces::VendableArtifact > artifact, const std::string &path)=0
 

Requester Functions

bool download () override
 
bool validateWriteRequest (const std::string &name, int newValue) override
 

Additional Inherited Members

- Static Public Attributes inherited from alexaClientSDK::acsdkAssets::manager::Requester
static std::chrono::milliseconds START_TIME_OFFSET = milliseconds(0)
 
- Protected Member Functions inherited from alexaClientSDK::acsdkAssets::manager::Requester
 Requester (std::shared_ptr< StorageManager > storageManager, std::shared_ptr< commonInterfaces::AmdCommunicationInterface > communicationHandler, std::shared_ptr< RequesterMetadata > metadata, std::string metadataFilePath)
 
bool initializeFromStorage ()
 
bool registerCommunicationHandlerPropsLocked ()
 
void deregisterCommunicationHandlerPropsLocked (std::unique_lock< std::mutex > &lock)
 
void setStateLocked (commonInterfaces::State newState)
 
void updateLastUsedTimestampLocked ()
 
void notifyUpdateIsAvailableLocked (std::unique_lock< std::mutex > &lock)
 
bool handleAcquiredResourceLocked (std::unique_lock< std::mutex > &lock, const std::shared_ptr< Resource > &newResource)
 
void handleDownloadFailureLocked (std::unique_lock< std::mutex > &lock)
 
void handleUpdateLocked (std::unique_lock< std::mutex > &lock, bool accept)
 
- Protected Attributes inherited from alexaClientSDK::acsdkAssets::manager::Requester
const std::shared_ptr< StorageManagerm_storageManager
 
const std::shared_ptr< commonInterfaces::AmdCommunicationInterfacem_communicationHandler
 
const std::shared_ptr< RequesterMetadatam_metadata
 
const std::string m_metadataFilePath
 
std::unique_ptr< StorageManager::ReservationTokenm_storageReservationToken
 
std::shared_ptr< Resourcem_resource
 
std::shared_ptr< Resourcem_pendingUpdate
 
int m_updateNotificationsSent
 
alexaClientSDK::avsCommon::utils::timing::Timer m_timer
 
std::mutex m_eventMutex
 
bool m_communicationHandlerRegistered
 
friend RequesterFactory
 
std::shared_ptr< acsdkCommunicationInterfaces::CommunicationProperty< int > > m_stateProperty
 
std::shared_ptr< acsdkCommunicationInterfaces::CommunicationProperty< int > > m_priorityProperty
 
std::shared_ptr< acsdkCommunicationInterfaces::CommunicationProperty< std::string > > m_updateProperty
 

Constructor & Destructor Documentation

◆ ~DavsRequester()

alexaClientSDK::acsdkAssets::manager::DavsRequester::~DavsRequester ( )
inlineoverride

Deregister this artifact from DAVS Client.

Member Function Documentation

◆ checkIfOkToDownload()

bool alexaClientSDK::acsdkAssets::manager::DavsRequester::checkIfOkToDownload ( std::shared_ptr< commonInterfaces::VendableArtifact availableArtifact,
size_t  freeSpaceNeeded 
)
override

◆ download()

bool alexaClientSDK::acsdkAssets::manager::DavsRequester::download ( )
overridevirtual

Issues a download request if not already in progress.

Returns
true if the artifact is already downloaded or can download.

Implements alexaClientSDK::acsdkAssets::manager::Requester.

◆ onArtifactDownloaded()

void alexaClientSDK::acsdkAssets::manager::DavsRequester::onArtifactDownloaded ( std::shared_ptr< commonInterfaces::VendableArtifact downloadedArtifact,
const std::string &  path 
)
override

◆ onCheckFailure()

void alexaClientSDK::acsdkAssets::manager::DavsRequester::onCheckFailure ( commonInterfaces::ResultCode  errorCode)
overridevirtual

An event that is called when the check failed with a specific reason.

Parameters
errorCodereason for the failure.

Implements alexaClientSDK::acsdkAssets::davsInterfaces::DavsCheckCallbackInterface.

◆ onDownloadFailure()

void alexaClientSDK::acsdkAssets::manager::DavsRequester::onDownloadFailure ( commonInterfaces::ResultCode  errorCode)
overridevirtual

An event that is called when the download fails, providing a reason for failure.

Parameters
errorCodereason for the failure.

Implements alexaClientSDK::acsdkAssets::davsInterfaces::DavsDownloadCallbackInterface.

◆ onProgressUpdate()

void alexaClientSDK::acsdkAssets::manager::DavsRequester::onProgressUpdate ( int  progress)
overridevirtual

An event that is called periodically to denote the progress of the download.

Parameters
progressALWAYS VALID, between 0 and 100

Implements alexaClientSDK::acsdkAssets::davsInterfaces::DavsDownloadCallbackInterface.

◆ onStart()

void alexaClientSDK::acsdkAssets::manager::DavsRequester::onStart ( )
overridevirtual

An event that is called as soon as the download has started.

Implements alexaClientSDK::acsdkAssets::davsInterfaces::DavsDownloadCallbackInterface.

◆ validateWriteRequest()

bool alexaClientSDK::acsdkAssets::manager::DavsRequester::validateWriteRequest ( const std::string &  propertyName,
int  newValue 
)
overridevirtual

Called when we want to write to a property. Used to validate before we write the newValue

Parameters
propertyNameThe name of the property
newValueThe new value of the property
Returns
true if alright to write value, false otherwise.

Implements alexaClientSDK::acsdkCommunicationInterfaces::CommunicationPropertyValidatorInterface< int >.


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

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