Interface AuditManager


  • public interface AuditManager
    • Field Detail

      • PAYLOAD_SKIP_MSG_FORMAT

        static final String PAYLOAD_SKIP_MSG_FORMAT
        This String is the default message stored instead of the actual audit payload if the audit payload size exceeded the maximum size limit configuration
        See Also:
        Constant Field Values
    • Method Detail

      • doAudit

        <T> void doAudit​(String key,
                         String type,
                         AuditInfo auditInfo,
                         T payload,
                         ConfigSerde<T> configSerde)
        inserts an audit entry in the Audit Table
        Parameters:
        key - of the audit entry
        type - of the audit entry
        auditInfo - of the audit entry
        payload - of the audit entry
        configSerde - of the payload of the audit entry
      • doAudit

        void doAudit​(AuditEntry auditEntry,
                     org.skife.jdbi.v2.Handle handler)
              throws IOException
        inserts an audit Entry in audit table using the handler provided used to do the audit in same transaction as the config changes
        Parameters:
        auditEntry -
        handler -
        Throws:
        IOException
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String key,
                                           String type,
                                           org.joda.time.Interval interval)
        provides audit history for given key, type and interval
        Parameters:
        key -
        type -
        interval -
        Returns:
        list of AuditEntries satisfying the passed parameters
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String type,
                                           org.joda.time.Interval interval)
        provides audit history for given type and interval
        Parameters:
        type - type of auditEntry
        interval - interval for which to fetch auditHistory
        Returns:
        list of AuditEntries 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
        Parameters:
        key -
        type -
        limit -
        Returns:
        list of AuditEntries satisfying the passed parameters
      • fetchAuditHistory

        List<AuditEntry> fetchAuditHistory​(String type,
                                           int limit)
        Provides last N entries of audit history for given type
        Parameters:
        type - type of auditEntry
        limit -
        Returns:
        list of AuditEntries 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