AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SQLiteMessageStorage.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 ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_SQLITEMESSAGESTORAGE_H_
17 #define ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_SQLITEMESSAGESTORAGE_H_
18 
20 
23 
24 namespace alexaClientSDK {
25 namespace certifiedSender {
26 
33 public:
40  static std::shared_ptr<MessageStorageInterface> createMessageStorageInterface(
41  const std::shared_ptr<avsCommon::utils::configuration::ConfigurationNode>& configurationRoot);
42 
49  static std::unique_ptr<SQLiteMessageStorage> create(
51 
57  SQLiteMessageStorage(const std::string& databaseFilePath);
58 
60 
61  bool createDatabase() override;
62 
63  bool open() override;
64 
65  void close() override;
66 
67  bool store(const std::string& message, int* id) override;
68 
69  bool store(const std::string& message, const std::string& uriPathExtension, int* id) override;
70 
71  bool load(std::queue<StoredMessage>* messageContainer) override;
72 
73  bool erase(int messageId) override;
74 
75  bool clearDatabase() override;
76 
77 private:
80 
89  int isDatabaseLegacy();
90 
97  bool dropTable();
98 
105  bool eraseMessageOverAgeLimit();
106 
113  bool eraseMessageOverSizeLimit();
114 };
115 
116 } // namespace certifiedSender
117 } // namespace alexaClientSDK
118 
119 #endif // ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_SQLITEMESSAGESTORAGE_H_
bool store(const std::string &message, int *id) override
::std::string string
Definition: gtest-port.h:1097
Definition: MessageStorageInterface.h:34
static std::unique_ptr< SQLiteMessageStorage > create(const avsCommon::utils::configuration::ConfigurationNode &configurationRoot)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: SQLiteMessageStorage.h:32
bool load(std::queue< StoredMessage > *messageContainer) override
SQLiteMessageStorage(const std::string &databaseFilePath)
static std::shared_ptr< MessageStorageInterface > createMessageStorageInterface(const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot)
tuple message
Definition: gtest_output_test.py:331

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