Interface AuditEventService

All Known Implementing Classes:
AuditEventServiceImpl

public interface AuditEventService
Author:
paul
  • Method Details

    • getEvents

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) List<AuditEvent> getEvents(Auditable auditable)
    • getEventsWithType

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) List<AuditEvent> getEventsWithType(Auditable auditable)
      Retrieve all events with an event type.
    • getEventsByCursor

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) CursorPage<AuditEvent> getEventsByCursor(Auditable auditable, @Nullable Cursor cursor, int limit)
      Keyset-pagination counterpart to getEvents(Auditable) for the GET /datasets/{dataset}/auditEvents endpoint — see CURSOR_PAGINATION_STEP1_PLAN.md step 1q. Mirrors the AuditEventDao.getEventsByCursor(Auditable, Cursor, int) contract (id-asc keyset, limit+1 probe for hasMore, totalElements null by default). The auditable-trail scope and ACL check is preserved.
    • getCreateEvents

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_COLLECTION_READ"}) <T extends Auditable> Map<T, AuditEvent> getCreateEvents(Collection<T> auditable)
    • getLastEvent

      @Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) AuditEvent getLastEvent(Auditable auditable)
    • getLastEvent

      @Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type)
    • getLastEvent

      @Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type, Collection<Class<? extends AuditEventType>> excludedTypes)
    • getLastEvents

      @Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostFilter("hasPermission(filterObject.key, 'READ') or hasPermission(filterObject.key, 'ADMINISTRATION')") <T extends Auditable> Map<T, AuditEvent> getLastEvents(Class<T> auditableClass, Class<? extends AuditEventType> type)
    • getIdsHavingEvent

      @Secured("IS_AUTHENTICATED_ANONYMOUSLY") <T extends Auditable> Set<Long> 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. 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 @PostFilter the 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.

      See Also:
    • getLastEvents

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_COLLECTION_READ"}) <T extends Auditable> Map<T, AuditEvent> getLastEvents(Collection<T> auditables)
      Obtain 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; getCreateEvents(Collection) is the batched fallback for those.

      See Also:
    • getLastEvents

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_COLLECTION_READ"}) <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.
      Parameters:
      auditables - auditables
      types - 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

      @Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostFilter("hasPermission(filterObject, 'READ') or hasPermission(filterObject, 'ADMINISTRATION')") <T extends Auditable> Collection<T> getNewSinceDate(Class<T> auditableClass, Date date)
    • getUpdatedSinceDate

      @Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostFilter("hasPermission(filterObject, 'READ') or hasPermission(filterObject, 'ADMINISTRATION')") <T extends Auditable> Collection<T> getUpdatedSinceDate(Class<T> auditableClass, Date date)
      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 — see AUDIT_SYSTEM_AUDIT.md Section 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

      @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) boolean hasEvent(Auditable a, Class<? extends AuditEventType> type)
    • retainHavingEvent

      void retainHavingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type)
    • retainLackingEvent

      void retainLackingEvent(Collection<? extends Auditable> a, Class<? extends AuditEventType> type)