AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AlertStorageInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKALERTS_STORAGE_ALERTSTORAGEINTERFACE_H_
17 #define ACSDKALERTS_STORAGE_ALERTSTORAGEINTERFACE_H_
18 
19 #include "acsdkAlerts/Alert.h"
20 
22 
23 #include <list>
24 #include <memory>
25 #include <string>
26 #include <vector>
27 
28 namespace alexaClientSDK {
29 namespace acsdkAlerts {
30 namespace storage {
31 
37 public:
41  virtual ~AlertStorageInterface() = default;
42 
51  virtual bool createDatabase() = 0;
52 
60  virtual bool open() = 0;
61 
65  virtual void close() = 0;
66 
73  virtual bool store(std::shared_ptr<Alert> alert) = 0;
74 
83  virtual bool storeOfflineAlert(
84  const std::string& token,
85  const std::string& scheduledTime,
86  const std::string& eventTime) = 0;
87 
95  virtual bool load(
96  std::vector<std::shared_ptr<Alert>>* alertContainer,
97  std::shared_ptr<settings::DeviceSettingsManager> settingsManager) = 0;
98 
106  virtual bool loadOfflineAlerts(rapidjson::Value* alertContainer, rapidjson::Document::AllocatorType& allocator) = 0;
107 
116  virtual bool modify(std::shared_ptr<Alert> alert) = 0;
117 
124  virtual bool erase(std::shared_ptr<Alert> alert) = 0;
125 
133  virtual bool eraseOffline(const std::string& token, int id) = 0;
134 
144  virtual bool bulkErase(const std::list<std::shared_ptr<Alert>>& alertList) = 0;
145 
152  virtual bool clearDatabase() = 0;
153 };
154 
155 } // namespace storage
156 } // namespace acsdkAlerts
157 } // namespace alexaClientSDK
158 
159 #endif // ACSDKALERTS_STORAGE_ALERTSTORAGEINTERFACE_H_
virtual bool bulkErase(const std::list< std::shared_ptr< Alert >> &alertList)=0
virtual bool store(std::shared_ptr< Alert > alert)=0
virtual bool eraseOffline(const std::string &token, int id)=0
virtual bool loadOfflineAlerts(rapidjson::Value *alertContainer, rapidjson::Document::AllocatorType &allocator)=0
virtual bool modify(std::shared_ptr< Alert > alert)=0
virtual bool storeOfflineAlert(const std::string &token, const std::string &scheduledTime, const std::string &eventTime)=0
virtual bool erase(std::shared_ptr< Alert > alert)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual bool load(std::vector< std::shared_ptr< Alert >> *alertContainer, std::shared_ptr< settings::DeviceSettingsManager > settingsManager)=0

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