AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <Requester.h>
Public Member Functions | |
virtual | ~Requester () |
virtual bool | download ()=0 |
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 |
Static Public Attributes | |
static std::chrono::milliseconds | START_TIME_OFFSET = milliseconds(0) |
Protected Member Functions | |
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) |
virtual size_t | deleteAndCleanupLocked (std::unique_lock< std::mutex > &lock) |
Protected Attributes | |
const std::shared_ptr< StorageManager > | m_storageManager |
const std::shared_ptr< commonInterfaces::AmdCommunicationInterface > | m_communicationHandler |
const std::shared_ptr< RequesterMetadata > | m_metadata |
const std::string | m_metadataFilePath |
std::unique_ptr< StorageManager::ReservationToken > | m_storageReservationToken |
std::shared_ptr< Resource > | m_resource |
std::shared_ptr< Resource > | m_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 |
This class represents an artifact as it exists on the system or as it is being downloaded. Given an artifact directory, it will maintain a metadata json file that will maintain its state and description on the same path. The artifact will be stored or unzipped inside this directory to handle its update and maintenance.
|
virtual |
Ensures that the Communication Handler properties are all cleared away.
|
protected |
|
inline |
Deletes the artifact and deregisters Communication Handler properties accordingly.
|
protectedvirtual |
Deletes the artifact and deregisters from DAVS Client accordingly.
|
protected |
Deletes the artifact and deregisters communication properties accordingly.
|
pure virtual |
Issues a download request if not already in progress.
Implemented in alexaClientSDK::acsdkAssets::manager::UrlRequester, and alexaClientSDK::acsdkAssets::manager::DavsRequester.
|
override |
Override of the InvokeFunctionInterface.
string alexaClientSDK::acsdkAssets::manager::Requester::getArtifactPath | ( | ) |
Returns the path where the artifact is stored and updates the last used timestamp if the path exists.
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
void alexaClientSDK::acsdkAssets::manager::Requester::handleUpdate | ( | bool | accept | ) |
Handles pendingUpdate resource according to this function call.
accept | the pendingUpdate change or not. If accepted, release the old resource and set the new one. If rejected, then release the pendingUpdate. |
|
protected |
|
protected |
Attempts to fetch the resource from storage manager.
|
inline |
|
inline |
|
protected |
|
protected |
Registers the Communication Handler properties, if not already registered, for state, priority, and path.
|
virtual |
Sets the priority of this artifact to a new value.
|
inlineprotected |
Sets the existing state and informs the manager of the new state.
|
protected |
Sets the last used timestamp to the current time.
|
overridevirtual |
Override of the CommunicationPropertyValidatorInterface.
Implements alexaClientSDK::acsdkCommunicationInterfaces::CommunicationPropertyValidatorInterface< int >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
steady_clock starting offset based off of the previous artifact times.
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0