Package com.tnsai.security.audit
Record Class AuditEvent
java.lang.Object
java.lang.Record
com.tnsai.security.audit.AuditEvent
- Record Components:
id- unique event identifiertimestamp- when the event occurredagentId- the agent that triggered the actionaction- the action or tool namedecision- outcome: APPROVED, REJECTED, AUTO_APPROVED, TIMEOUTapprover- who made the decision: user, system, autocontext- additional key-value metadatasessionId- the session in which the event occurred
public record AuditEvent(String id, Instant timestamp, String agentId, String action, String decision, String approver, Map<String,Object> context, String sessionId)
extends Record
Immutable audit event recording a security-relevant decision.
Captures tool approval/rejection decisions, permission checks, and other security actions for compliance and forensic analysis.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.agentId()Returns the value of theagentIdrecord component.approver()Returns the value of theapproverrecord component.static AuditEvent.Builderbuilder()Creates a builder for constructing audit events.context()Returns the value of thecontextrecord component.decision()Returns the value of thedecisionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thesessionIdrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
builder
Creates a builder for constructing audit events.- Returns:
- new builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
decision
Returns the value of thedecisionrecord component.- Returns:
- the value of the
decisionrecord component
-
approver
Returns the value of theapproverrecord component.- Returns:
- the value of the
approverrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-