1 /*
2  * Copyright (c) 2023-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 #ifndef PUBLISH_EVENT_ADAPTER_H
17 #define PUBLISH_EVENT_ADAPTER_H
18 
19 #include <mutex>
20 #include <string>
21 
22 namespace OHOS {
23 namespace UserIam {
24 namespace UserAuth {
25 class PublishEventAdapter {
26 public:
27     static PublishEventAdapter &GetInstance();
28     void PublishDeletedEvent(int32_t userId);
29     void PublishCreatedEvent(int32_t userId, uint64_t scheduleId);
30     void PublishUpdatedEvent(int32_t userId, uint64_t scheduleId);
31     void PublishCredentialUpdatedEvent(int32_t userId, int32_t authType, uint32_t credentialCount);
32     void CachePinUpdateParam(int32_t userId, uint64_t scheduleId, uint64_t credentialId);
33 
34 private:
35     PublishEventAdapter() = default;
36     ~PublishEventAdapter() = default;
37 
38     std::mutex mutex_;
39     int32_t userId_ {0};
40     uint64_t scheduleId_ {0};
41     uint64_t credentialId_ {0};
42 };
43 } // namespace UserAuth
44 } // namespace UserIam
45 } // namespace OHOS
46 #endif //PUBLISH_EVENT_ADAPTER_H