Package org.apache.druid.audit
Interface AuditManager
public interface AuditManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAudit(AuditEntry event) default voiddoAudit(AuditEntry event, org.skife.jdbi.v2.Handle handle) Inserts an audit entry in audit table using the provided JDBI handle.fetchAuditHistory(String type, int limit) Provides last N entries of audit history for given typefetchAuditHistory(String key, String type, int limit) Provides last N entries of audit history for given key, typefetchAuditHistory(String key, String type, org.joda.time.Interval interval) Fetches audit entries made for the given key, type and interval.fetchAuditHistory(String type, org.joda.time.Interval interval) Fetches audit entries of a type whose audit time lies in the given interval.intremoveAuditLogsOlderThan(long timestamp) Remove audit logs created older than the given timestamp.
-
Field Details
-
X_DRUID_AUTHOR
- See Also:
-
X_DRUID_COMMENT
- See Also:
-
-
Method Details
-
doAudit
-
doAudit
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 calldoAudit(org.apache.druid.audit.AuditEntry)by default.- Parameters:
event- Event to audithandle- JDBI Handle representing connection to the database- Throws:
IOException
-
fetchAuditHistory
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
Fetches audit entries of a type whose audit time lies in the given interval.- Parameters:
type- Type of audit entryinterval- Eligible interval for audit time- Returns:
- List of recorded audit events satisfying the passed parameters.
-
fetchAuditHistory
Provides last N entries of audit history for given key, type- Returns:
- list of recorded audit events satisfying the passed parameters
-
fetchAuditHistory
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
-