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
16 #define LOG_TAG "DistributedKvDataManager"
17
18 #include "distributed_kv_data_manager.h"
19 #include "mock_single_kv_store.h"
20 #include "types.h"
21
22 namespace OHOS {
23 namespace DistributedKv {
DistributedKvDataManager()24 DistributedKvDataManager::DistributedKvDataManager()
25 {}
26
~DistributedKvDataManager()27 DistributedKvDataManager::~DistributedKvDataManager()
28 {}
29
GetSingleKvStore(const Options & options,const AppId & appId,const StoreId & storeId,std::shared_ptr<SingleKvStore> & kvStore)30 Status DistributedKvDataManager::GetSingleKvStore(const Options &options, const AppId &appId, const StoreId &storeId,
31 std::shared_ptr<SingleKvStore> &kvStore)
32 {
33 std::string storeIdTmp = storeId.storeId;
34 kvStore = std::make_shared<AnsTestSingleKvStore>();
35 return Status::SUCCESS;
36 }
37
CloseKvStore(const AppId & appId,const StoreId & storeId)38 Status DistributedKvDataManager::CloseKvStore(const AppId &appId, const StoreId &storeId)
39 {
40 return Status::SUCCESS;
41 }
42
CloseKvStore(const AppId & appId,std::shared_ptr<SingleKvStore> & kvStorePtr)43 Status DistributedKvDataManager::CloseKvStore(const AppId &appId, std::shared_ptr<SingleKvStore> &kvStorePtr)
44 {
45 return Status::SUCCESS;
46 }
47
DeleteKvStore(const AppId & appId,const StoreId & storeId)48 Status DistributedKvDataManager::DeleteKvStore(const AppId &appId, const StoreId &storeId)
49 {
50 return Status::SUCCESS;
51 }
52
RegisterKvStoreServiceDeathRecipient(std::shared_ptr<KvStoreDeathRecipient> kvStoreDeathRecipient)53 void DistributedKvDataManager::RegisterKvStoreServiceDeathRecipient(
54 std::shared_ptr<KvStoreDeathRecipient> kvStoreDeathRecipient)
55 {}
56
UnRegisterKvStoreServiceDeathRecipient(std::shared_ptr<KvStoreDeathRecipient> kvStoreDeathRecipient)57 void DistributedKvDataManager::UnRegisterKvStoreServiceDeathRecipient(
58 std::shared_ptr<KvStoreDeathRecipient> kvStoreDeathRecipient)
59 {}
60 } // namespace DistributedKv
61 } // namespace OHOS
62