#include <AssetManager.h>
◆ ~AssetManager()
alexaClientSDK::acsdkAssets::manager::AssetManager::~AssetManager |
( |
| ) |
|
|
override |
◆ create()
Creates a a new Asset Manager with a davs client handle and base directory to work off of.
- Parameters
-
communicationHandler | REQUIRED, used to communicate the values of properties and functions |
davsClient | REQUIRED, used to register artifact and communicate with DAVS. |
artifactsDirectory | REQUIRED, base directory where the artifacts are to be stored. |
authDelegate | REQUIRED, the Authentication Delegate to generate the authentication token. |
allowList | REQUIRED, URL allow list wrapper used for managing downloads from URLs. |
- Returns
- NULLABLE, pointer to new AssetManager, null if failed.
◆ deleteArtifact()
void alexaClientSDK::acsdkAssets::manager::AssetManager::deleteArtifact |
( |
const std::string & |
summaryString | ) |
|
Requests the deletion and removal of an existing artifact by deleting its requester.
- Parameters
-
summaryString | REQUIRED, summary of an existing artifact. |
◆ downloadArtifact()
Requests a creation of a new requester if it does not already exists based off a json request. Use an existing requester if it matches the json request.
- Parameters
-
request | REQUIRED, a request that represents an artifact in DAVS. |
- Returns
- weather the operation was successful.
◆ freeUpSpace()
bool alexaClientSDK::acsdkAssets::manager::AssetManager::freeUpSpace |
( |
size_t |
requestedAmount | ) |
|
Goes through the available requesters and deletes unused requesters and their artifacts based on used time and priority.
- Note
- this operation could take a while as it goes through and deletes artifacts until the requested amount is satisfied.
- Parameters
-
requestedAmount | size in bytes that is needed to be cleared. |
- Returns
- true if the requested amount was freed up, false otherwise.
◆ functionToBeInvoked()
bool alexaClientSDK::acsdkAssets::manager::AssetManager::functionToBeInvoked |
( |
const std::string & |
name, |
|
|
std::string |
arg |
|
) |
| |
|
override |
◆ getBudget()
size_t alexaClientSDK::acsdkAssets::manager::AssetManager::getBudget |
( |
| ) |
|
- Returns
- Get the current budget in MB
◆ handleUpdate()
void alexaClientSDK::acsdkAssets::manager::AssetManager::handleUpdate |
( |
const std::string & |
summaryString, |
|
|
bool |
acceptUpdate |
|
) |
| |
Handles the pending update for a specific requester given its summary string.
- Parameters
-
summaryString | for an artifact request that maps to a requester handling the update. |
acceptUpdate | weather to accept the update or reject it. |
◆ onIdleChanged()
void alexaClientSDK::acsdkAssets::manager::AssetManager::onIdleChanged |
( |
int |
value | ) |
|
Callback method when application changes idle state.
- Parameters
-
value,int | value that will be parsed to a bool |
◆ queueDeleteArtifact()
void alexaClientSDK::acsdkAssets::manager::AssetManager::queueDeleteArtifact |
( |
const std::string & |
summaryString | ) |
|
|
inline |
Queues up a call to deleteArtifact in an executor. Returns immediately.
◆ queueDownloadArtifact() [1/2]
Queues up a call to downloadArtifact in an executor. Returns immediately.
◆ queueDownloadArtifact() [2/2]
bool alexaClientSDK::acsdkAssets::manager::AssetManager::queueDownloadArtifact |
( |
const std::string & |
requestString | ) |
|
Takes string and tries to make it a ArtifactRequest Queues up a call to downloadArtifact in an executor. Returns immediately.
- Parameters
-
requestString | string that represents the ArtifactRequest |
- Returns
- true, if successfully able to queue up call, false otherwise
◆ queueFreeUpSpace()
void alexaClientSDK::acsdkAssets::manager::AssetManager::queueFreeUpSpace |
( |
size_t |
requestedAmount | ) |
|
|
inline |
Queues up a call to freeUpSpace in an executor. Returns immediately.
◆ queueHandleUpdate()
void alexaClientSDK::acsdkAssets::manager::AssetManager::queueHandleUpdate |
( |
const std::string & |
summaryString, |
|
|
bool |
acceptUpdate |
|
) |
| |
|
inline |
Queues up a call to handleUpdate in an executor. Returns immediately.
◆ setBudget()
void alexaClientSDK::acsdkAssets::manager::AssetManager::setBudget |
( |
uint32_t |
valueMB | ) |
|
This method sets the budget for asset manager in megabytes. If the new budget is set to a number less than the current data stored asset manager will attempt to clear as many artifacts as possible to be within the threshold.
- Parameters
-
valueMB,int | the number of MB for the new budget. |
The documentation for this class was generated from the following file:
- /workplace/avs-device-sdk/capabilities/AssetManager/acsdkAssetManager/include/acsdkAssetManager/AssetManager.h
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0