1 /* 2 * Copyright (c) 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 OHOS_DP_ACCESS_CONTROL_PROFILE_H 17 #define OHOS_DP_ACCESS_CONTROL_PROFILE_H 18 19 #include <string> 20 21 #include "accesser.h" 22 #include "accessee.h" 23 #include "distributed_device_profile_enums.h" 24 #include "dp_parcel.h" 25 26 namespace OHOS { 27 namespace DistributedDeviceProfile { 28 class AccessControlProfile : public DpParcel { 29 public: 30 AccessControlProfile(); 31 ~AccessControlProfile() = default; 32 33 public: 34 int64_t GetAccessControlId() const; 35 void SetAccessControlId(int64_t accessControlId); 36 int64_t GetAccesserId() const; 37 void SetAccesserId(int64_t accesserId); 38 int64_t GetAccesseeId() const; 39 void SetAccesseeId(int64_t accesseeId); 40 std::string GetSessionKey() const; 41 void SetSessionKey(const std::string& sessionKey); 42 std::string GetTrustDeviceId() const; 43 void SetTrustDeviceId(const std::string& trustDeviceId); 44 uint32_t GetBindType() const; 45 void SetBindType(uint32_t bindType); 46 uint32_t GetAuthenticationType() const; 47 void SetAuthenticationType(uint32_t authenticationType); 48 int32_t GetStatus() const; 49 void SetStatus(int32_t status); 50 int32_t GetValidPeriod() const; 51 void SetValidPeriod(int32_t validPeriod); 52 int32_t GetLastAuthTime() const; 53 void SetLastAuthTime(int32_t lastAuthTime); 54 Accesser GetAccesser() const; 55 void SetAccesser(const Accesser &accesser); 56 Accessee GetAccessee() const; 57 void SetAccessee(const Accessee &accessee); 58 uint32_t GetBindLevel() const; 59 void SetBindLevel(uint32_t bindLevel); 60 uint32_t GetDeviceIdType() const; 61 void SetDeviceIdType(uint32_t deviceIdType); 62 std::string GetDeviceIdHash() const; 63 void SetDeviceIdHash(const std::string& deviceIdHash); 64 bool Marshalling(MessageParcel& parcel) const override; 65 bool UnMarshalling(MessageParcel& parcel) override; 66 std::string dump() const override; 67 68 private: 69 int64_t accessControlId_; 70 int64_t accesserId_; 71 int64_t accesseeId_; 72 std::string sessionKey_; 73 uint32_t bindType_; 74 uint32_t authenticationType_; 75 uint32_t bindLevel_; 76 int32_t status_; 77 int32_t validPeriod_; 78 int32_t lastAuthTime_; 79 std::string trustDeviceId_; 80 uint32_t deviceIdType_; 81 std::string deviceIdHash_; 82 Accesser accesser_; 83 Accessee accessee_; 84 }; 85 } // namespace DistributedDeviceProfile 86 } // namespace OHOS 87 #endif // OHOS_DP_ACCESS_CONTROL_PROFILE_H 88