public class AuditEvent extends Object implements Serializable
Users can inject a AuditEventRepository
to publish their own events or
alternatively use Springs AuthenticationEventPublisher
(usually obtained by
implementing ApplicationEventPublisherAware
).
AuditEventRepository
,
Serialized FormConstructor and Description |
---|
AuditEvent(Date timestamp,
String principal,
String type,
Map<String,Object> data)
Create a new audit event.
|
AuditEvent(String principal,
String type,
Map<String,Object> data)
Create a new audit event for the current time.
|
AuditEvent(String principal,
String type,
String... data)
Create a new audit event for the current time from data provided as name-value
pairs
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getData()
Returns the event data.
|
String |
getPrincipal()
Returns the user principal responsible for the event or
null . |
Date |
getTimestamp()
Returns the date/time that the even was logged.
|
String |
getType()
Returns the type of event.
|
String |
toString() |
public AuditEvent(String principal, String type, Map<String,Object> data)
principal
- The user principal responsibletype
- the event typedata
- The event datapublic AuditEvent(String principal, String type, String... data)
principal
- The user principal responsibletype
- the event typedata
- The event data in the form 'key=value' or simply 'key'Copyright © 2014. All rights reserved.