• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #ifndef OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_SERVICE_STUB_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_SERVICE_STUB_H
18 #include "iremote_stub.h"
19 #include "kvdb_service.h"
20 #include "feature/feature_system.h"
21 namespace OHOS::DistributedKv {
22 class API_EXPORT KVDBServiceStub : public KVDBService, public DistributedData::FeatureSystem::Feature {
23 public:
24     int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply) override;
25 
26 private:
27     using Handler = int32_t (KVDBServiceStub::*)(
28         const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
29     int32_t OnGetStoreIds(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
30     int32_t OnBeforeCreate(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
31     int32_t OnAfterCreate(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
32     int32_t OnDelete(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
33     int32_t OnSync(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
34     int32_t OnRegisterCallback(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
35     int32_t OnUnregisterCallback(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
36     int32_t OnSetSyncParam(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
37     int32_t OnGetSyncParam(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
38     int32_t OnEnableCap(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
39     int32_t OnDisableCap(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
40     int32_t OnSetCapability(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
41     int32_t OnAddSubInfo(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
42     int32_t OnRmvSubInfo(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
43     int32_t OnSubscribe(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
44     int32_t OnUnsubscribe(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
45     int32_t OnGetBackupPassword(const AppId &appId, const StoreId &storeId, MessageParcel &data, MessageParcel &reply);
46     static const Handler HANDLERS[TRANS_BUTT];
47 };
48 } // namespace OHOS::DistributedKv
49 #endif // OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_SERVICE_STUB_H
50