Class AuditEventServiceImpl
java.lang.Object
ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventServiceImpl
- All Implemented Interfaces:
AuditEventService
@Service("auditEventService")
public class AuditEventServiceImpl
extends Object
implements AuditEventService
- Author:
- pavlidis
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Auditable>
Map<T, AuditEvent> getCreateEvents(Collection<T> auditables) getEventsByCursor(Auditable auditable, Cursor cursor, int limit) Keyset-pagination counterpart toAuditEventService.getEvents(Auditable)for theGET /datasets/{dataset}/auditEventsendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1q.getEventsWithType(Auditable auditable) Retrieve all events with an event type.getIdsHavingEvent(Class<T> auditableClass, Collection<Class<? extends AuditEventType>> types) Obtain the ids of every auditable of a class whose trail carries at least one event of any of the given types.getLastEvent(Auditable auditable) getLastEvent(Auditable auditable, Class<? extends AuditEventType> type) getLastEvent(Auditable auditable, Class<? extends AuditEventType> type, Collection<Class<? extends AuditEventType>> excludedTypes) <T extends Auditable>
Map<T, AuditEvent> getLastEvents(Class<T> auditableClass, Class<? extends AuditEventType> type) <T extends Auditable>
Map<T, AuditEvent> getLastEvents(Collection<T> auditables) Obtain the latest typed event for each of the given auditables, whatever its type.<T extends Auditable>
Map<Class<? extends AuditEventType>, Map<T, AuditEvent>> getLastEvents(Collection<T> auditables, Collection<Class<? extends AuditEventType>> types) Fast method to retrieve auditEventTypes of multiple classes.<T extends Auditable>
Collection<T> getNewSinceDate(Class<T> auditableClass, Date date) <T extends Auditable>
Collection<T> getUpdatedSinceDate(Class<T> auditableClass, Date date) booleanhasEvent(Auditable a, Class<? extends AuditEventType> type) voidretainHavingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type) voidretainLackingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type)
-
Constructor Details
-
AuditEventServiceImpl
-
-
Method Details
-
getEvents
- Specified by:
getEventsin interfaceAuditEventService
-
getEventsWithType
Description copied from interface:AuditEventServiceRetrieve all events with an event type.- Specified by:
getEventsWithTypein interfaceAuditEventService
-
getEventsByCursor
@Transactional(readOnly=true) public CursorPage<AuditEvent> getEventsByCursor(Auditable auditable, @Nullable Cursor cursor, int limit) Description copied from interface:AuditEventServiceKeyset-pagination counterpart toAuditEventService.getEvents(Auditable)for theGET /datasets/{dataset}/auditEventsendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1q. Mirrors theAuditEventDao.getEventsByCursor(Auditable, Cursor, int)contract (id-asc keyset,limit+1probe forhasMore,totalElementsnull by default). The auditable-trail scope and ACL check is preserved.- Specified by:
getEventsByCursorin interfaceAuditEventService
-
getCreateEvents
@Transactional(readOnly=true) public <T extends Auditable> Map<T, AuditEvent> getCreateEvents(Collection<T> auditables) - Specified by:
getCreateEventsin interfaceAuditEventService
-
getLastEvent
- Specified by:
getLastEventin interfaceAuditEventService
-
getLastEvent
@Transactional(readOnly=true) public AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type) - Specified by:
getLastEventin interfaceAuditEventService
-
getLastEvent
@Transactional(readOnly=true) public AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type, Collection<Class<? extends AuditEventType>> excludedTypes) - Specified by:
getLastEventin interfaceAuditEventService
-
getLastEvents
@Transactional(readOnly=true) public <T extends Auditable> Map<T, AuditEvent> getLastEvents(Class<T> auditableClass, Class<? extends AuditEventType> type) - Specified by:
getLastEventsin interfaceAuditEventService
-
getIdsHavingEvent
@Transactional(readOnly=true) public <T extends Auditable> Set<Long> getIdsHavingEvent(Class<T> auditableClass, Collection<Class<? extends AuditEventType>> types) Description copied from interface:AuditEventServiceObtain the ids of every auditable of a class whose trail carries at least one event of any of the given types. One query, whatever the number of types.🛑 Bare ids, so there is no securable object to hang an ACL check on and none is applied — the
@PostFilterthe sibling above uses has nothing to filter here. Treat the result as a narrowing step and intersect it with an ACL-filtered load (e.g.ExpressionExperimentService.load(Filters, Sort), whose ACL clause is in-query) before any of these ids reaches a caller.- Specified by:
getIdsHavingEventin interfaceAuditEventService- See Also:
-
getLastEvents
@Transactional(readOnly=true) public <T extends Auditable> Map<T, AuditEvent> getLastEvents(Collection<T> auditables) Description copied from interface:AuditEventServiceObtain the latest typed event for each of the given auditables, whatever its type.One query for the whole collection. Auditables whose trail carries no typed event at all are absent from the map rather than mapped to
null;AuditEventService.getCreateEvents(Collection)is the batched fallback for those.- Specified by:
getLastEventsin interfaceAuditEventService- See Also:
-
getLastEvents
@Transactional(readOnly=true) public <T extends Auditable> Map<Class<? extends AuditEventType>, Map<T, AuditEvent>> getLastEvents(Collection<T> auditables, Collection<Class<? extends AuditEventType>> types) Description copied from interface:AuditEventServiceFast method to retrieve auditEventTypes of multiple classes.- Specified by:
getLastEventsin interfaceAuditEventService- Parameters:
auditables- auditablestypes- types- Returns:
- map of AuditEventType to a Map of Auditable to the AuditEvent matching that type. Note: cannot secure this very easily since map key is a Class.
-
getNewSinceDate
@Transactional(readOnly=true) public <T extends Auditable> Collection<T> getNewSinceDate(Class<T> auditableClass, Date date) - Specified by:
getNewSinceDatein interfaceAuditEventService
-
getUpdatedSinceDate
@Transactional(readOnly=true) public <T extends Auditable> Collection<T> getUpdatedSinceDate(Class<T> auditableClass, Date date) - Specified by:
getUpdatedSinceDatein interfaceAuditEventService- Parameters:
date- date- Returns:
- a collection of Auditable objects that received at least one typed
AuditEvent(i.e.eventType IS NOT NULL) since the date entered. Generic auto-UPDATE rows (action='U',eventType=null) are NOT counted — seeAUDIT_SYSTEM_AUDIT.mdSection 5, risk #1. Note that this security setting works even though auditables aren't necessarily securable; non-securable auditables will be returned. See AclEntryAfterInvocationCollectionFilteringProvider and applicationContext-security.xml
-
hasEvent
@Transactional(readOnly=true) public boolean hasEvent(Auditable a, Class<? extends AuditEventType> type) - Specified by:
hasEventin interfaceAuditEventService
-
retainHavingEvent
@Transactional(readOnly=true) public void retainHavingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type) - Specified by:
retainHavingEventin interfaceAuditEventService
-
retainLackingEvent
@Transactional(readOnly=true) public void retainLackingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type) - Specified by:
retainLackingEventin interfaceAuditEventService
-