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 #ifdef RELATIONAL_STORE
16 #include "relationaldb_properties.h"
17 
18 namespace DistributedDB {
19 const std::string RelationalDBProperties::DISTRIBUTED_TABLE_MODE = "distributed_table_mode";
20 
RelationalDBProperties()21 RelationalDBProperties::RelationalDBProperties()
22     : schema_(),
23       isEncrypted_(false),
24       cipherType_(),
25       passwd_(),
26       iterTimes_(0)
27 {}
28 
~RelationalDBProperties()29 RelationalDBProperties::~RelationalDBProperties()
30 {}
31 
SetSchema(const RelationalSchemaObject & schema)32 void RelationalDBProperties::SetSchema(const RelationalSchemaObject &schema)
33 {
34     schema_ = schema;
35 }
36 
GetSchema() const37 RelationalSchemaObject RelationalDBProperties::GetSchema() const
38 {
39     return schema_;
40 }
41 
SetCipherArgs(CipherType cipherType,const CipherPassword & passwd,uint32_t iterTimes)42 void RelationalDBProperties::SetCipherArgs(CipherType cipherType, const CipherPassword &passwd, uint32_t iterTimes)
43 {
44     isEncrypted_ = true;
45     cipherType_ = cipherType;
46     passwd_ = passwd;
47     iterTimes_ = iterTimes;
48 }
49 
IsEncrypted() const50 bool RelationalDBProperties::IsEncrypted() const
51 {
52     return isEncrypted_;
53 }
54 
GetCipherType() const55 CipherType RelationalDBProperties::GetCipherType() const
56 {
57     return cipherType_;
58 }
59 
GetPasswd() const60 const CipherPassword &RelationalDBProperties::GetPasswd() const
61 {
62     return passwd_;
63 }
64 
GetIterTimes() const65 uint32_t RelationalDBProperties::GetIterTimes() const
66 {
67     return iterTimes_;
68 }
69 }
70 #endif