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 // set schema 32 void SetSchema(const RelationalSchemaObject &schema); 33 34 // get schema 35 RelationalSchemaObject GetSchema() const; 36 37 void SetCipherArgs(CipherType cipherType, const CipherPassword &passwd, uint32_t iterTimes); 38 39 bool IsEncrypted() const; 40 CipherType GetCipherType() const; 41 const CipherPassword &GetPasswd() const; 42 uint32_t GetIterTimes() const; 43 44 static const std::string DISTRIBUTED_TABLE_MODE; 45 46 private: 47 RelationalSchemaObject schema_; 48 49 bool isEncrypted_; 50 CipherType cipherType_; 51 CipherPassword passwd_; 52 uint32_t iterTimes_; 53 }; 54 } 55 #endif 56 #endif