16 #ifndef ACSDKASSETMANAGER_ASSETMANAGER_H_ 17 #define ACSDKASSETMANAGER_ASSETMANAGER_H_ 24 #include <unordered_set> 31 namespace acsdkAssets {
34 class RequesterFactory;
41 :
public std::enable_shared_from_this<AssetManager>
54 static std::shared_ptr<AssetManager> create(
55 const std::shared_ptr<commonInterfaces::AmdCommunicationInterface>& communicationHandler,
56 const std::shared_ptr<davs::DavsClient>& davsClient,
58 const std::shared_ptr<alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface>& authDelegate,
59 const std::shared_ptr<UrlAllowListWrapper>& allowList);
70 bool downloadArtifact(
const std::shared_ptr<commonInterfaces::ArtifactRequest>& request);
74 m_executor.execute([
this, request] { downloadArtifact(request); });
83 bool queueDownloadArtifact(
const std::string& requestString);
90 void deleteArtifact(
const std::string& summaryString);
94 m_executor.execute([
this, summaryString] { deleteArtifact(summaryString); });
103 void handleUpdate(
const std::string& summaryString,
bool acceptUpdate);
107 m_executor.execute([
this, summaryString, acceptUpdate] { handleUpdate(summaryString, acceptUpdate); });
119 bool freeUpSpace(
size_t requestedAmount);
123 m_executor.execute([
this, requestedAmount] { freeUpSpace(requestedAmount); });
130 void onIdleChanged(
int value);
144 void setBudget(uint32_t valueMB);
151 std::shared_ptr<commonInterfaces::AmdCommunicationInterface> communicationHandler,
152 std::shared_ptr<davs::DavsClient> davsClient,
154 std::shared_ptr<alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface> authDelegate,
155 std::shared_ptr<UrlAllowListWrapper> allowUrlList);
170 std::shared_ptr<Requester> findRequesterLocked(
171 const std::shared_ptr<commonInterfaces::ArtifactRequest>& request)
const;
174 const std::shared_ptr<commonInterfaces::AmdCommunicationInterface> m_communicationHandler;
175 const std::shared_ptr<davs::DavsClient> m_davsClient;
179 const std::shared_ptr<alexaClientSDK::avsCommon::sdkInterfaces::AuthDelegateInterface> m_authDelegate;
180 const std::shared_ptr<UrlAllowListWrapper> m_urlAllowList;
181 std::unique_ptr<RequesterFactory> m_requesterFactory;
183 std::mutex m_requestersMutex;
184 std::unordered_set<std::shared_ptr<Requester>> m_requesters;
185 std::shared_ptr<StorageManager> m_storageManager;
192 #endif // ACSDKASSETMANAGER_ASSETMANAGER_H_ void queueFreeUpSpace(size_t requestedAmount)
Definition: AssetManager.h:122
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
void queueDeleteArtifact(const std::string &summaryString)
Definition: AssetManager.h:93
Definition: AssetManager.h:40
IdleState
Definition: AssetManager.h:38
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: FunctionInvokerInterface.h:30
void queueDownloadArtifact(const std::shared_ptr< commonInterfaces::ArtifactRequest > &request)
Definition: AssetManager.h:73
void queueHandleUpdate(const std::string &summaryString, bool acceptUpdate)
Definition: AssetManager.h:106
Requester
An enum class indicating whether an operation originated from a Device or Cloud (AVS).
Definition: Requester.h:24