1 /* 2 * Copyright (c) 2023-2025 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_DP_ACCESSER_H 17 #define OHOS_DP_ACCESSER_H 18 19 #include <cstdint> 20 #include <string> 21 #include "distributed_device_profile_enums.h" 22 #include "dp_parcel.h" 23 24 namespace OHOS { 25 namespace DistributedDeviceProfile { 26 class Accesser : public DpParcel { 27 public: 28 Accesser(); 29 ~Accesser() = default; 30 31 int64_t GetAccesserId(); 32 void SetAccesserId(int64_t accesserId); 33 std::string GetAccesserDeviceId() const; 34 void SetAccesserDeviceId(const std::string& accesserDeviceId); 35 int32_t GetAccesserUserId() const; 36 void SetAccesserUserId(int32_t accesserUserId); 37 std::string GetAccesserAccountId() const; 38 void SetAccesserAccountId(const std::string& accesserAccountId); 39 int64_t GetAccesserTokenId() const; 40 void SetAccesserTokenId(int64_t accesserTokenId); 41 std::string GetAccesserBundleName() const; 42 void SetAccesserBundleName(const std::string& accesserBundleName); 43 std::string GetAccesserHapSignature() const; 44 void SetAccesserHapSignature(const std::string& accesserHapSignature); 45 uint32_t GetAccesserBindLevel() const; 46 void SetAccesserBindLevel(uint32_t accesserBindLevel); 47 std::string GetAccesserDeviceName() const; 48 void SetAccesserDeviceName(const std::string& accesserDeviceName); 49 std::string GetAccesserServiceName() const; 50 void SetAccesserServiceName(const std::string& accesserServiceName); 51 int32_t GetAccesserCredentialId() const; 52 void SetAccesserCredentialId(int32_t accesserCredentialId); 53 std::string GetAccesserCredentialIdStr() const; 54 void SetAccesserCredentialIdStr(const std::string& accesserCredentialIdStr); 55 int32_t GetAccesserStatus() const; 56 void SetAccesserStatus(int32_t accesserStatus); 57 int32_t GetAccesserSessionKeyId() const; 58 void SetAccesserSessionKeyId(int32_t accesserSessionKeyId); 59 int64_t GetAccesserSKTimeStamp() const; 60 void SetAccesserSKTimeStamp(int64_t accesserSKTimeStamp); 61 std::string GetAccesserExtraData() const; 62 void SetAccesserExtraData(const std::string& accesserExtraData); 63 bool Marshalling(MessageParcel& parcel) const override; 64 bool UnMarshalling(MessageParcel& parcel) override; 65 std::string dump() const override; 66 67 private: 68 int64_t accesserId_; 69 std::string accesserDeviceId_; 70 int32_t accesserUserId_; 71 std::string accesserAccountId_; 72 int64_t accesserTokenId_; 73 std::string accesserBundleName_; 74 std::string accesserHapSignature_; 75 uint32_t accesserBindLevel_; 76 std::string accesserDeviceName_; 77 std::string accesserServiceName_; 78 int32_t accesserCredentialId_; 79 std::string accesserCredentialIdStr_; 80 int32_t accesserStatus_; 81 int32_t accesserSessionKeyId_; 82 int64_t accesserSKTimeStamp_; 83 std::string accesserExtraData_; 84 }; 85 } // namespace DistributedDeviceProfile 86 } // namespace OHOS 87 #endif //OHOS_DP_ACCESSER_H 88