• 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 #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 
IsSchemaExist() const32 bool RelationalDBProperties::IsSchemaExist() const
33 {
34     return schema_.IsSchemaValid();
35 }
36 
SetSchema(const RelationalSchemaObject & schema)37 void RelationalDBProperties::SetSchema(const RelationalSchemaObject &schema)
38 {
39     schema_ = schema;
40 }
41 
GetSchema() const42 RelationalSchemaObject RelationalDBProperties::GetSchema() const
43 {
44     return schema_;
45 }
46 
SetCipherArgs(CipherType cipherType,const CipherPassword & passwd,uint32_t iterTimes)47 void RelationalDBProperties::SetCipherArgs(CipherType cipherType, const CipherPassword &passwd, uint32_t iterTimes)
48 {
49     isEncrypted_ = true;
50     cipherType_ = cipherType;
51     passwd_ = passwd;
52     iterTimes_ = iterTimes;
53 }
54 
IsEncrypted() const55 bool RelationalDBProperties::IsEncrypted() const
56 {
57     return isEncrypted_;
58 }
59 
GetCipherType() const60 CipherType RelationalDBProperties::GetCipherType() const
61 {
62     return cipherType_;
63 }
64 
GetPasswd() const65 const CipherPassword &RelationalDBProperties::GetPasswd() const
66 {
67     return passwd_;
68 }
69 
GetIterTimes() const70 uint32_t RelationalDBProperties::GetIterTimes() const
71 {
72     return iterTimes_;
73 }
74 }
75 #endif