Interface AuditTrailService
- All Superinterfaces:
BaseImmutableService<AuditTrail>
,BaseReadOnlyService<AuditTrail>
- All Known Implementing Classes:
AuditTrailServiceImpl
Create and manipulate audit trails.
This service is mainly intended to create audit events manually. Part of the auditing is done automatically using
aspects via AuditAdvice
.
- Author:
- kelsey
-
Method Summary
Modifier and TypeMethodDescriptionaddUpdateEvent
(Auditable auditable, Class<? extends AuditEventType> type, String note) addUpdateEvent
(Auditable auditable, Class<? extends AuditEventType> type, String note, String detail) addUpdateEvent
(Auditable auditable, Class<? extends AuditEventType> type, String note, String detail, Date performedDate) Add an update audit event of a specific type to the passed auditable entity.addUpdateEvent
(Auditable auditable, Class<? extends AuditEventType> type, String note, Throwable throwable) Add an update audit event with an exception.addUpdateEvent
(Auditable auditable, String note) Add an update event defined by the given parameters, to the given auditable.create
(AuditTrail auditTrail) Creates the given entity in the persistent storage.Methods inherited from interface ubic.gemma.persistence.service.BaseImmutableService
create, findOrCreate, remove, remove, remove
Methods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, find, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, streamAll, streamAll
-
Method Details
-
addUpdateEvent
Add an update event defined by the given parameters, to the given auditable. Returns the generated event.- Parameters:
auditable
- the entitynote
- a short note (optional)- Returns:
- the newly created event, which will be somewhere in the auditable's
AuditTrail.getEvents()
collection.
-
addUpdateEvent
@Secured("GROUP_AGENT") AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, String note) - See Also:
-
addUpdateEvent
@Secured("GROUP_AGENT") AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, @Nullable String detail) - See Also:
-
addUpdateEvent
@Secured("GROUP_AGENT") @Transactional(propagation=REQUIRES_NEW) AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, Throwable throwable) Add an update audit event with an exception.Unlike
addUpdateEvent(Auditable, Class, String, String, Date)
, the audit event produced by this method cannot be rolled back, so you may freely raise the exception. This is achieved by usingPropagation.REQUIRES_NEW
.- See Also:
-
addUpdateEvent
@Secured("GROUP_AGENT") AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, @Nullable String detail, Date performedDate) Add an update audit event of a specific type to the passed auditable entity.- Parameters:
auditable
- the entity being auditedtype
- the audit event typenote
- a short note (optional)detail
- full details for that eventperformedDate
- the moment the audit was performed (must not be in the future!)- Returns:
- the newly created event, which will be somewhere in the auditable's
AuditTrail.getEvents()
collection.
-
create
Description copied from interface:BaseImmutableService
Creates the given entity in the persistent storage.- Specified by:
create
in interfaceBaseImmutableService<AuditTrail>
- Parameters:
auditTrail
- the entity to be created.- Returns:
- object referencing the persistent instance of the given entity.
-