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 ACCESSTOKEN_MANAGER_CLIENT_H
17 #define ACCESSTOKEN_MANAGER_CLIENT_H
18 
19 #include <string>
20 
21 #include "access_token.h"
22 #include "hap_token_info.h"
23 #include "i_token_sync_manager.h"
24 #include "nocopyable.h"
25 
26 namespace OHOS {
27 namespace Security {
28 namespace AccessToken {
29 class TokenSyncManagerClient final {
30 public:
31     static TokenSyncManagerClient& GetInstance();
32 
33     virtual ~TokenSyncManagerClient();
34 
35     int GetRemoteHapTokenInfo(const std::string& deviceID, AccessTokenID tokenID) const;
36     int DeleteRemoteHapTokenInfo(AccessTokenID tokenID) const;
37     int UpdateRemoteHapTokenInfo(const HapTokenInfoForSync& tokenInfo) const;
38 
39 private:
40     TokenSyncManagerClient();
41 
42     DISALLOW_COPY_AND_MOVE(TokenSyncManagerClient);
43 
44     sptr<ITokenSyncManager> GetProxy() const;
45 };
46 } // namespace AccessToken
47 } // namespace Security
48 } // namespace OHOS
49 #endif // ACCESSTOKEN_MANAGER_CLIENT_H
50