1 /*
2 * Copyright (c) 2024 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 #include "all_connect_manager_mock.h"
17
18 namespace OHOS {
19 namespace Storage {
20 namespace DistributedFile {
AllConnectManager()21 AllConnectManager::AllConnectManager()
22 {
23 }
24
GetInstance()25 AllConnectManager &AllConnectManager::GetInstance()
26 {
27 static AllConnectManager instance;
28 return instance;
29 }
30
InitAllConnectManager()31 int32_t AllConnectManager::InitAllConnectManager()
32 {
33 return 0;
34 }
35
UnInitAllConnectManager()36 int32_t AllConnectManager::UnInitAllConnectManager()
37 {
38 return 0;
39 }
40
PublishServiceState(DfsConnectCode code,const std::string & peerNetworkId,ServiceCollaborationManagerBussinessStatus state)41 int32_t AllConnectManager::PublishServiceState(DfsConnectCode code, const std::string &peerNetworkId,
42 ServiceCollaborationManagerBussinessStatus state)
43 {
44 return 0;
45 }
46
ApplyAdvancedResource(const std::string & peerNetworkId,ServiceCollaborationManager_ResourceRequestInfoSets * resourceRequest)47 int32_t AllConnectManager::ApplyAdvancedResource(const std::string &peerNetworkId,
48 ServiceCollaborationManager_ResourceRequestInfoSets *resourceRequest)
49 {
50 if (IAllConnectManagerMock::iAllConnectManagerMock_ == nullptr) {
51 return -1;
52 }
53 return IAllConnectManagerMock::iAllConnectManagerMock_->ApplyAdvancedResource(peerNetworkId, resourceRequest);
54 }
55
GetPublicState(DfsConnectCode code,const std::string & peerNetworkId,ServiceCollaborationManagerBussinessStatus state)56 bool GetPublicState(DfsConnectCode code, const std::string &peerNetworkId,
57 ServiceCollaborationManagerBussinessStatus state)
58 {
59 return true;
60 }
61
GetAllConnectSoLoad()62 int32_t AllConnectManager::GetAllConnectSoLoad()
63 {
64 return 0;
65 }
66
RegisterLifecycleCallback()67 int32_t AllConnectManager::RegisterLifecycleCallback()
68 {
69 return 0;
70 }
71
UnRegisterLifecycleCallback()72 int32_t AllConnectManager::UnRegisterLifecycleCallback()
73 {
74 return 0;
75 }
76
ApplyResult(int32_t errorcode,int32_t result,const char * reason)77 int32_t AllConnectManager::ApplyResult(int32_t errorcode, int32_t result, const char *reason)
78 {
79 return 0;
80 }
81
OnStop(const char * peerNetworkId)82 int32_t AllConnectManager::OnStop(const char *peerNetworkId)
83 {
84 return 0;
85 }
86
BuildResourceRequest()87 std::shared_ptr<ServiceCollaborationManager_ResourceRequestInfoSets> AllConnectManager::BuildResourceRequest()
88 {
89 auto resourceRequest = std::make_shared<ServiceCollaborationManager_ResourceRequestInfoSets>();
90 return resourceRequest;
91 }
92 } // namespace DistributedFile
93 } // namespace Storage
94 } // namespace OHOS