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
ConstructorDescriptionAuditEvent
(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
Create a new audit event for the current time.- Parameters:
principal
- the user principal responsibletype
- the event typedata
- the event data
-
AuditEvent
Create a new audit event for the current time from data provided as name-value pairs.- Parameters:
principal
- the user principal responsibletype
- the event typedata
- the event data in the form 'key=value' or simply 'key'
-
AuditEvent
Create a new audit event.- Parameters:
timestamp
- the date/time of the eventprincipal
- the user principal responsibletype
- the event typedata
- the event data
-
-
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
Returns the type of event.- Returns:
- the event type
-
getData
Returns the event data.- Returns:
- the event data
-
toString
-