1 /*
2  * Copyright (c) 2023 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 "cloud/cloud_server.h"
17 namespace OHOS::DistributedData {
18 CloudServer *CloudServer::instance_ = nullptr;
GetInstance()19 CloudServer *CloudServer::GetInstance()
20 {
21     return instance_;
22 }
23 
RegisterCloudInstance(CloudServer * instance)24 bool CloudServer::RegisterCloudInstance(CloudServer *instance)
25 {
26     if (instance_ != nullptr) {
27         return false;
28     }
29     instance_ = instance;
30     return true;
31 }
32 
GetServerInfo(int32_t userId,bool needSpaceInfo)33 CloudInfo CloudServer::GetServerInfo(int32_t userId, bool needSpaceInfo)
34 {
35     return CloudInfo();
36 }
37 
GetAppSchema(int32_t userId,const std::string & bundleName)38 std::pair<int32_t, SchemaMeta> CloudServer::GetAppSchema(int32_t userId, const std::string &bundleName)
39 {
40     return { 0, SchemaMeta() };
41 }
42 
Subscribe(int32_t userId,const std::map<std::string,std::vector<Database>> & dbs)43 int32_t CloudServer::Subscribe(int32_t userId, const std::map<std::string, std::vector<Database>> &dbs)
44 {
45     return 0;
46 }
47 
Unsubscribe(int32_t userId,const std::map<std::string,std::vector<Database>> & dbs)48 int32_t CloudServer::Unsubscribe(int32_t userId, const std::map<std::string, std::vector<Database>> &dbs)
49 {
50     return 0;
51 }
52 
ConnectAssetLoader(uint32_t tokenId,const CloudServer::Database & dbMeta)53 std::shared_ptr<AssetLoader> CloudServer::ConnectAssetLoader(uint32_t tokenId, const CloudServer::Database &dbMeta)
54 {
55     return nullptr;
56 }
57 
ConnectAssetLoader(const std::string & bundleName,int user,const CloudServer::Database & dbMeta)58 std::shared_ptr<AssetLoader> CloudServer::ConnectAssetLoader(
59     const std::string &bundleName, int user, const CloudServer::Database &dbMeta)
60 {
61     return nullptr;
62 }
63 
ConnectCloudDB(uint32_t tokenId,const CloudServer::Database & dbMeta)64 std::shared_ptr<CloudDB> CloudServer::ConnectCloudDB(uint32_t tokenId, const CloudServer::Database &dbMeta)
65 {
66     return nullptr;
67 }
68 
ConnectCloudDB(const std::string & bundleName,int user,const CloudServer::Database & dbMeta)69 std::shared_ptr<CloudDB> CloudServer::ConnectCloudDB(
70     const std::string &bundleName, int user, const CloudServer::Database &dbMeta)
71 {
72     return nullptr;
73 }
74 
ConnectSharingCenter(int32_t userId,const std::string & bunleName)75 std::shared_ptr<SharingCenter> CloudServer::ConnectSharingCenter(int32_t userId, const std::string &bunleName)
76 {
77     return nullptr;
78 }
79 
Clean(int32_t userId)80 void CloudServer::Clean(int32_t userId)
81 {
82 }
83 
ReleaseUserInfo(int32_t userId)84 void CloudServer::ReleaseUserInfo(int32_t userId)
85 {
86 }
87 
Bind(std::shared_ptr<ExecutorPool> executor)88 void CloudServer::Bind(std::shared_ptr<ExecutorPool> executor)
89 {
90 }
91 
IsSupportCloud(int32_t userId)92 bool CloudServer::IsSupportCloud(int32_t userId)
93 {
94     return false;
95 }
96 } // namespace OHOS::DistributedData