Class AuditEvent
java.lang.Object
org.springframework.boot.actuate.audit.AuditEvent
- All Implemented Interfaces:
Serializable
A value object representing an audit event: at a particular time, a particular user or
agent carried out an action of a particular type. This object records the details of
such an event.
Users can inject a AuditEventRepository
to publish their own events or
alternatively use Spring's ApplicationEventPublisher
(usually obtained by
implementing ApplicationEventPublisherAware
) to publish AuditApplicationEvents
(wrappers for AuditEvent).
- Since:
- 1.0.0
- Author:
- Dave Syer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAuditEvent
(String principal, String type, String... data) Create a new audit event for the current time from data provided as name-value pairs.Create a new audit event for the current time.Create a new audit event. -
Method Summary
-
Constructor Details
-
AuditEvent
-
AuditEvent
-
AuditEvent
-
-
Method Details
-
getTimestamp
Returns the date/time that the event was logged.- Returns:
- the timestamp
-
getPrincipal
Returns the user principal responsible for the event or an empty String if the principal is not available.- Returns:
- the principal
-
getType
-
getData
-
toString
-