Interface AuditBackend

All Superinterfaces:
AuditAdmin, AuditBackend<LogEntry>, AuditLogger<LogEntry>, AuditReader<LogEntry>, Logs<LogEntry>
All Known Implementing Classes:
AbstractAuditBackend, MemAuditBackend, MongoDBAuditBackend, OpenSearchAuditBackend, SQLAuditBackend

public interface AuditBackend extends AuditBackend<LogEntry>
Since:
2025.0
  • Method Details

    • addLogEntries

      @Deprecated(since="2025.16", forRemoval=true) void addLogEntries(List<LogEntry> entries)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2025.16, insertion to audit backend became an internal API, use AuditRouter.routeToBackends(List) instead
      Adds given log entries.
      Specified by:
      addLogEntries in interface AuditLogger<LogEntry>
      Parameters:
      entries - the list of log entries.
      API Note:
      This API will generate the log entry ids.
    • insertLogs

      default void insertLogs(Collection<LogEntry> entries)
      Inserts the given log entries into the backend.
      Parameters:
      entries - the list of log entries
      Since:
      2025.16
      API Note:
      This API won't generate the log entry ids, the caller is responsible for setting them.
    • getEventsCount

      Long getEventsCount(String eventId)
      Specified by:
      getEventsCount in interface AuditAdmin
    • getLogEntryByID

      LogEntry getLogEntryByID(long id)
      Returns a given log entry given its id.
      Specified by:
      getLogEntryByID in interface AuditReader<LogEntry>
      Parameters:
      id - the log entry identifier
      Returns:
      a LogEntry instance
    • queryLogs

      LogEntryList queryLogs(QueryBuilder builder)
      Returns the logs given a collection of predicates and a default sort.
      Specified by:
      queryLogs in interface AuditReader<LogEntry>
      Parameters:
      builder - the query builder to fetch log entries
      Returns:
      a list of log entries
      Since:
      9.3
    • getLogEntriesFor

      default List<LogEntry> getLogEntriesFor(String uuid, String repositoryId)
      Returns the logs given a doc uuid and a repository id.
      Specified by:
      getLogEntriesFor in interface AuditReader<LogEntry>
      Parameters:
      uuid - the document uuid
      repositoryId - the repository id
      Returns:
      a list of log entries
      Since:
      8.4
    • getLatestLogId

      default long getLatestLogId(String repositoryId, String... eventIds)
      Returns the latest log id matching events and repository or 0 when no match found.
      Specified by:
      getLatestLogId in interface AuditReader<LogEntry>
      Since:
      9.3
    • hasCapability

      boolean hasCapability(AuditBackend.Capability capability)
      Checks whether the backend has the capability.