|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2017 the original author or authors.
|
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -56,9 +56,9 @@ public class AuditEvent implements Serializable {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new audit event for the current time.
|
|
|
|
|
* @param principal The user principal responsible
|
|
|
|
|
* @param principal the user principal responsible
|
|
|
|
|
* @param type the event type
|
|
|
|
|
* @param data The event data
|
|
|
|
|
* @param data the event data
|
|
|
|
|
*/
|
|
|
|
|
public AuditEvent(String principal, String type, Map<String, Object> data) {
|
|
|
|
|
this(new Date(), principal, type, data);
|
|
|
|
@ -67,9 +67,9 @@ public class AuditEvent implements Serializable {
|
|
|
|
|
/**
|
|
|
|
|
* Create a new audit event for the current time from data provided as name-value
|
|
|
|
|
* pairs.
|
|
|
|
|
* @param principal The user principal responsible
|
|
|
|
|
* @param principal the user principal responsible
|
|
|
|
|
* @param type the event type
|
|
|
|
|
* @param data The event data in the form 'key=value' or simply 'key'
|
|
|
|
|
* @param data the event data in the form 'key=value' or simply 'key'
|
|
|
|
|
*/
|
|
|
|
|
public AuditEvent(String principal, String type, String... data) {
|
|
|
|
|
this(new Date(), principal, type, convert(data));
|
|
|
|
@ -77,17 +77,17 @@ public class AuditEvent implements Serializable {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new audit event.
|
|
|
|
|
* @param timestamp The date/time of the event
|
|
|
|
|
* @param principal The user principal responsible
|
|
|
|
|
* @param timestamp the date/time of the event
|
|
|
|
|
* @param principal the user principal responsible
|
|
|
|
|
* @param type the event type
|
|
|
|
|
* @param data The event data
|
|
|
|
|
* @param data the event data
|
|
|
|
|
*/
|
|
|
|
|
public AuditEvent(Date timestamp, String principal, String type,
|
|
|
|
|
Map<String, Object> data) {
|
|
|
|
|
Assert.notNull(timestamp, "Timestamp must not be null");
|
|
|
|
|
Assert.notNull(type, "Type must not be null");
|
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
|
this.principal = (principal != null ? principal : "");
|
|
|
|
|
this.principal = (principal != null) ? principal : "";
|
|
|
|
|
this.type = type;
|
|
|
|
|
this.data = Collections.unmodifiableMap(data);
|
|
|
|
|
}
|
|
|
|
|