Package org.apache.druid.audit
Interface AuditManager
-
public interface AuditManager
-
-
Field Summary
Fields Modifier and Type Field Description static 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 configurationstatic String
X_DRUID_AUTHOR
static String
X_DRUID_COMMENT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> void
doAudit(String key, String type, AuditInfo auditInfo, T payload, ConfigSerde<T> configSerde)
inserts an audit entry in the Audit Tablevoid
doAudit(AuditEntry auditEntry, org.skife.jdbi.v2.Handle handler)
inserts an audit Entry in audit table using the handler provided used to do the audit in same transaction as the config changesList<AuditEntry>
fetchAuditHistory(String type, int limit)
Provides last N entries of audit history for given typeList<AuditEntry>
fetchAuditHistory(String key, String type, int limit)
Provides last N entries of audit history for given key, typeList<AuditEntry>
fetchAuditHistory(String key, String type, org.joda.time.Interval interval)
provides audit history for given key, type and intervalList<AuditEntry>
fetchAuditHistory(String type, org.joda.time.Interval interval)
provides audit history for given type and intervalint
removeAuditLogsOlderThan(long timestamp)
Remove audit logs created older than the given timestamp.
-
-
-
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
-
X_DRUID_AUTHOR
static final String X_DRUID_AUTHOR
- See Also:
- Constant Field Values
-
X_DRUID_COMMENT
static final String X_DRUID_COMMENT
- 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 entrytype
- of the audit entryauditInfo
- of the audit entrypayload
- of the audit entryconfigSerde
- 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 auditEntryinterval
- 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 auditEntrylimit
-- 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
-
-