Interface AuditService

All Known Implementing Classes:
AuditServiceImpl

public interface AuditService
The public API by which applications can query the audit logs and enable or disable auditing.
Author:
Derek Hulley
  • Method Details

    • isAuditEnabled

      boolean isAuditEnabled()
      Returns:
      Returns true if auditing is globally enabled
      Since:
      3.4
    • setAuditEnabled

      void setAuditEnabled(boolean enable)
      Enable or disable the global auditing state
      Parameters:
      enable - true to enable auditing globally or false to disable
      Since:
      3.4
    • getAuditApplications

      Map<String,AuditService.AuditApplication> getAuditApplications()
      Get all registered audit applications
      Returns:
      Returns a map of audit applications keyed by their name
      Since:
      3.4
    • isAuditEnabled

      boolean isAuditEnabled(String applicationName, String path)
      Parameters:
      applicationName - the name of the application to check
      path - the path to check
      Returns:
      Returns true if auditing is enabled for the given path
      Since:
      3.2
    • enableAudit

      void enableAudit(String applicationName, String path)
      Enable auditing for an application path
      Parameters:
      applicationName - the name of the application to check
      path - the path to enable
      Since:
      3.2
    • disableAudit

      void disableAudit(String applicationName, String path)
      Disable auditing for an application path
      Parameters:
      applicationName - the name of the application to check
      path - the path to disable
      Since:
      3.2
    • clearAudit

      int clearAudit(String applicationName)
      Remove all audit entries for the given application
      Parameters:
      applicationName - the name of the application for which to remove entries
      Returns:
      Returns the number of audit entries deleted
      Since:
      3.2
    • clearAudit

      int clearAudit(String applicationName, Long fromTime, Long toTime)
      Remove audit entries for the given application between the time ranges. If no start time is given then entries are deleted as far back as they exist. If no end time is given then entries are deleted up until the current time.
      Parameters:
      applicationName - the name of the application for which to remove entries
      fromTime - the start time of entries to remove (inclusive and optional)
      toTime - the end time of entries to remove (exclusive and optional)
      Returns:
      Returns the number of audit entries deleted
      Since:
      3.4
    • clearAuditByIdRange

      int clearAuditByIdRange(String applicationName, Long fromId, Long toId)
      Remove audit entries for the given application between the audit entry ids.
      Parameters:
      applicationName - the name of the application for which to remove entries
      fromId - the start time of entries to remove (inclusive and optional)
      toId - the end time of entries to remove (exclusive and optional)
      Returns:
      Returns the number of audit entries deleted
      Since:
      5.2.2
    • clearAudit

      int clearAudit(List<Long> auditEntryIds)
      Delete a discrete list of audit entries.

      This method should not be called while processing query results.

      Parameters:
      auditEntryIds - the IDs of all audit entries to delete
      Returns:
      Returns the number of audit entries deleted
      Since:
      3.4
    • auditQuery

      void auditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
      Issue an audit query using the given parameters and consuming results in the callback. Results are returned in entry order, corresponding to time order.
      Parameters:
      callback - the callback that will handle results
      parameters - the parameters for the query (may not be null)
      maxResults - the maximum number of results to retrieve (must be greater than 0)
      Throws:
      IllegalArgumentException - if maxResults less or equal to zero
      Since:
      3.3
    • getAuditMinMaxByApp

      HashMap<String,Long> getAuditMinMaxByApp(String applicationName, List<String> extremes)
      Issue an audit query to retrieve min / max audit record id for a given application.
      Parameters:
      applicationName - the name of the application
      extremes - a list containing min/max or both
      Returns:
      a map containing min/max and the associated value
    • getAuditEntriesCountByApp

      default int getAuditEntriesCountByApp(String applicationName)
      Issue an audit query to retrieve min / max audit record id for a given application.
      Parameters:
      applicationName - the name of the application
      Returns:
      a map containing min/max and the associated value
    • getAuditEntriesCountByAppAndProperties

      default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
      Issue an audit query to retrieve min / max audit record id for a given application and properties
      Parameters:
      applicationName - the name of the application
      parameters - audit parameters provided by the where clause on the ReST API
      Returns:
      a map containing min/max and the associated value