public class AuditEvent
extends java.lang.Object
implements java.io.Serializable
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).
AuditEventRepository,
Serialized Form| Constructor and Description |
|---|
AuditEvent(java.time.Instant timestamp,
java.lang.String principal,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> data)
Create a new audit event.
|
AuditEvent(java.lang.String principal,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> data)
Create a new audit event for the current time.
|
AuditEvent(java.lang.String principal,
java.lang.String type,
java.lang.String... data)
Create a new audit event for the current time from data provided as name-value
pairs.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getData()
Returns the event data.
|
java.lang.String |
getPrincipal()
Returns the user principal responsible for the event or an empty String if the
principal is not available.
|
java.time.Instant |
getTimestamp()
Returns the date/time that the event was logged.
|
java.lang.String |
getType()
Returns the type of event.
|
java.lang.String |
toString() |
public AuditEvent(java.lang.String principal,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> data)
principal - the user principal responsibletype - the event typedata - the event datapublic AuditEvent(java.lang.String principal,
java.lang.String type,
java.lang.String... data)
principal - the user principal responsibletype - the event typedata - the event data in the form 'key=value' or simply 'key'public AuditEvent(java.time.Instant timestamp,
java.lang.String principal,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> data)
timestamp - the date/time of the eventprincipal - the user principal responsibletype - the event typedata - the event datapublic java.time.Instant getTimestamp()
public java.lang.String getPrincipal()
public java.lang.String getType()
public java.util.Map<java.lang.String,java.lang.Object> getData()
public java.lang.String toString()
toString in class java.lang.Object