Interface AuditService

All Known Subinterfaces:
InternalAuditService
All Known Implementing Classes:
AuditServiceImpl, NoOpAuditService

public interface AuditService
The service for interacting with the audit log. It allows to create new audit log entries or query the audit log.
Since:
v2.12
  • Method Details

    • saveAudit

      void saveAudit(AuditLogChangeset changeset)
      Persists an audit log changeset. The timestamp will be set to the current time. Will not do anything when audit log is disabled.
      Parameters:
      changeset - the changeset that will be persisted
    • searchAuditLog

      <T> List<T> searchAuditLog(AuditLogQuery<T> query)
      Queries the audit log. Returns a List of AuditLogChangesets, which match the criteria specified in the query. The results will be sorted by the timestamp, descending.
      Parameters:
      query - the search query
      Returns:
      List of AuditLogEntry matching the query
      Since:
      v3.2
    • isEnabled

      @Deprecated boolean isEnabled()
      Deprecated.
      As of v3.2, replaced by shouldAuditEvent()
      Returns:
      true if the audit log is enabled, false otherwise. A disabled audit log will not persist any new entries.
    • saveConfiguration

      void saveConfiguration(AuditLogConfiguration auditLogConfiguration)
      Sets the new configuration for auditing
      Parameters:
      auditLogConfiguration - new configuration
    • getConfiguration

      AuditLogConfiguration getConfiguration()
      Returns current auditing configuration
      Returns:
      current configuration
    • shouldAuditEvent

      boolean shouldAuditEvent()
      Allows the caller to determine whether it should attempt to generate audit events. Auditing might be disabled globally, or it might be disabled during specific operations or states (for example during synchronizations).
      Returns:
      true if calling saveAudit() will persist the event, false otherwise
      Since:
      v3.2