• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef RELATIONALDB_PROPERTIES_H
16 #define RELATIONALDB_PROPERTIES_H
17 #ifdef RELATIONAL_STORE
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 #include "db_properties.h"
23 #include "relational_schema_object.h"
24 
25 namespace DistributedDB {
26 class RelationalDBProperties final : public DBProperties {
27 public:
28     RelationalDBProperties();
29     ~RelationalDBProperties() override;
30 
31     // is schema exist
32     bool IsSchemaExist() const;
33 
34     // set schema
35     void SetSchema(const RelationalSchemaObject &schema);
36 
37     // get schema
38     RelationalSchemaObject GetSchema() const;
39 
40     void SetCipherArgs(CipherType cipherType, const CipherPassword &passwd, uint32_t iterTimes);
41 
42     bool IsEncrypted() const;
43     CipherType GetCipherType() const;
44     const CipherPassword &GetPasswd() const;
45     uint32_t GetIterTimes() const;
46 
47     static const std::string DISTRIBUTED_TABLE_MODE;
48 
49 private:
50     RelationalSchemaObject schema_;
51 
52     bool isEncrypted_;
53     CipherType cipherType_;
54     CipherPassword passwd_;
55     uint32_t iterTimes_;
56 };
57 }
58 #endif
59 #endif