Class AuditTrailServiceImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractService<AuditTrail>
-
- ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailServiceImpl
-
- All Implemented Interfaces:
BaseImmutableService<AuditTrail>
,BaseReadOnlyService<AuditTrail>
,BaseService<AuditTrail>
,AuditTrailService
@Service public class AuditTrailServiceImpl extends AbstractService<AuditTrail> implements AuditTrailService
- Author:
- pavlidis
- See Also:
AuditTrailService
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractService
log
-
-
Constructor Summary
Constructors Constructor Description AuditTrailServiceImpl(AuditTrailDao auditTrailDao, GenericCuratableDao curatableDao, UserManager userManager, SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditEvent
addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, String note)
AuditEvent
addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, String note, String detail)
AuditEvent
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.AuditEvent
addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, String note, Throwable throwable)
This is using thePropagation.REQUIRES_NEW
so that if the throwable is raised, it will not roll back the audit trail event.AuditEvent
addUpdateEvent(Auditable auditable, String note)
Add an update event defined by the given parameters, to the given auditable.-
Methods inherited from class ubic.gemma.persistence.service.AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, remove, save, save, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService
create
-
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
-
-
-
-
Constructor Detail
-
AuditTrailServiceImpl
@Autowired public AuditTrailServiceImpl(AuditTrailDao auditTrailDao, GenericCuratableDao curatableDao, UserManager userManager, SessionFactory sessionFactory)
-
-
Method Detail
-
addUpdateEvent
@Transactional public AuditEvent addUpdateEvent(Auditable auditable, String note)
Description copied from interface:AuditTrailService
Add an update event defined by the given parameters, to the given auditable. Returns the generated event.- Specified by:
addUpdateEvent
in interfaceAuditTrailService
- 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
@Transactional public AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note)
- Specified by:
addUpdateEvent
in interfaceAuditTrailService
- See Also:
AuditTrailService.addUpdateEvent(Auditable, Class, String, String, Date)
-
addUpdateEvent
@Transactional public AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, String detail)
- Specified by:
addUpdateEvent
in interfaceAuditTrailService
- See Also:
AuditTrailService.addUpdateEvent(Auditable, Class, String, String, Date)
-
addUpdateEvent
@Transactional(propagation=REQUIRES_NEW) public AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, Throwable throwable)
This is using thePropagation.REQUIRES_NEW
so that if the throwable is raised, it will not roll back the audit trail event.- Specified by:
addUpdateEvent
in interfaceAuditTrailService
- See Also:
AuditTrailService.addUpdateEvent(Auditable, Class, String, String, Date)
-
addUpdateEvent
@Transactional public AuditEvent addUpdateEvent(Auditable auditable, Class<? extends AuditEventType> type, @Nullable String note, @Nullable String detail, Date performedDate)
Description copied from interface:AuditTrailService
Add an update audit event of a specific type to the passed auditable entity.- Specified by:
addUpdateEvent
in interfaceAuditTrailService
- 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.
-
-