Record Class AuditChangeContext
java.lang.Object
java.lang.Record
io.leandev.appfuse.audit.entity.AuditChangeContext
public record AuditChangeContext(String subjectId, String actorId, List<String> grantorIds, AuditPrincipalKind principalKind, String tenantId, String requestId, String sessionId, AuditSource source)
extends Record
一次持久化 changeset 的身份與關聯脈絡。
subjectId、actorId、grantorIds 一律承載 stable subject,不是 username 或顯示名稱:
- 一般操作:subject = actor、grantors = []
- 模擬:subject = 被模擬者、actor = 真實操作者
- 代理:subject = actor、grantors = 授權人集合
- 兩者並存:subject = 被模擬者、actor = 真實操作者、grantors = 授權人集合
本型別不含 Hibernate/Envers API,可由不同 Entity history adapter 共用。
-
Constructor Summary
ConstructorsConstructorDescriptionAuditChangeContext(String subjectId, String actorId, List<String> grantorIds, AuditPrincipalKind principalKind, String tenantId, String requestId, String sessionId, AuditSource source) Creates an instance of aAuditChangeContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionactorId()Returns the value of theactorIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegrantorIdsrecord component.final inthashCode()Returns a hash code value for this object.booleanbooleanReturns the value of theprincipalKindrecord component.Returns the value of therequestIdrecord component.Returns the value of thesessionIdrecord component.source()Returns the value of thesourcerecord component.Returns the value of thesubjectIdrecord component.tenantId()Returns the value of thetenantIdrecord component.final StringtoString()Returns a string representation of this record class.withTenantId(String tenantId) 以相同 changeset 脈絡補上應用層資料範圍;tenantless 應用維持null。
-
Constructor Details
-
AuditChangeContext
public AuditChangeContext(String subjectId, String actorId, List<String> grantorIds, AuditPrincipalKind principalKind, String tenantId, String requestId, String sessionId, AuditSource source) Creates an instance of aAuditChangeContextrecord class.- Parameters:
subjectId- the value for thesubjectIdrecord componentactorId- the value for theactorIdrecord componentgrantorIds- the value for thegrantorIdsrecord componentprincipalKind- the value for theprincipalKindrecord componenttenantId- the value for thetenantIdrecord componentrequestId- the value for therequestIdrecord componentsessionId- the value for thesessionIdrecord componentsource- the value for thesourcerecord component
-
-
Method Details
-
withTenantId
以相同 changeset 脈絡補上應用層資料範圍;tenantless 應用維持null。 -
isImpersonating
public boolean isImpersonating() -
isDelegating
public boolean isDelegating() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
subjectId
Returns the value of thesubjectIdrecord component.- Returns:
- the value of the
subjectIdrecord component
-
actorId
Returns the value of theactorIdrecord component.- Returns:
- the value of the
actorIdrecord component
-
grantorIds
-
principalKind
Returns the value of theprincipalKindrecord component.- Returns:
- the value of the
principalKindrecord component
-
tenantId
Returns the value of thetenantIdrecord component.- Returns:
- the value of the
tenantIdrecord component
-
requestId
Returns the value of therequestIdrecord component.- Returns:
- the value of the
requestIdrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-