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 #ifndef OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_NOTIFIER_PROXY_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_NOTIFIER_PROXY_H
18 
19 #include "ikvdb_notifier.h"
20 #include "iremote_broker.h"
21 #include "iremote_proxy.h"
22 
23 namespace OHOS {
24 namespace DistributedKv {
25 class API_EXPORT KVDBNotifierProxy : public IRemoteProxy<IKVDBNotifier> {
26 public:
27     explicit KVDBNotifierProxy(const sptr<IRemoteObject> &impl);
28     ~KVDBNotifierProxy() = default;
29     void SyncCompleted(const std::map<std::string, Status> &results, uint64_t sequenceId) override;
30     void SyncCompleted(uint64_t seqNum, ProgressDetail &&detail) override;
31     void OnRemoteChange(const std::map<std::string, bool> &mask, int32_t dataType) override;
32     void OnSwitchChange(const SwitchNotification &notification) override;
33 
34 private:
35     static inline BrokerDelegator<KVDBNotifierProxy> delegator_;
36     sptr<IRemoteObject> remote_;
37 };
38 } // namespace DistributedKv
39 } // namespace OHOS
40 
41 #endif // OHOS_DISTRIBUTED_DATA_SERVICE_KVDB_NOTIFIER_PROXY_H