Interface AuditManager


  • public interface AuditManager
    • Method Detail

      • doAudit

        default void doAudit​(AuditEntry event,
                             org.skife.jdbi.v2.Handle handle)
                      throws IOException
        Inserts an audit entry in audit table using the provided JDBI handle. This method can be used to perform the audit in the same transaction as the audited changes. Only SQL-based implementations need to implement this method, other implementations call doAudit(org.apache.druid.audit.AuditEntry) by default.
        Parameters:
        event - Event to audit
        handle - JDBI Handle representing connection to the database
        Throws:
        IOException
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String key,
                                           String type,
                                           org.joda.time.Interval interval)
        Fetches audit entries made for the given key, type and interval. Implementations that do not maintain an audit history should return an empty list.
        Returns:
        List of recorded audit events satisfying the passed parameters.
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String type,
                                           org.joda.time.Interval interval)
        Fetches audit entries of a type whose audit time lies in the given interval.
        Parameters:
        type - Type of audit entry
        interval - Eligible interval for audit time
        Returns:
        List of recorded audit events satisfying the passed parameters.
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String key,
                                           String type,
                                           int limit)
        Provides last N entries of audit history for given key, type
        Returns:
        list of recorded audit events satisfying the passed parameters
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String type,
                                           int limit)
        Provides last N entries of audit history for given type
        Returns:
        List of recorded audit events satisfying the passed parameters.
      • removeAuditLogsOlderThan

        int removeAuditLogsOlderThan​(long timestamp)
        Remove audit logs created older than the given timestamp.
        Parameters:
        timestamp - timestamp in milliseconds
        Returns:
        Number of audit logs removed