Package org.apache.druid.audit
Interface AuditManager
-
public interface AuditManager
-
-
Field Summary
Fields Modifier and Type Field Description static StringX_DRUID_AUTHORstatic StringX_DRUID_COMMENT
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddoAudit(AuditEntry event)default voiddoAudit(AuditEntry event, org.skife.jdbi.v2.Handle handle)Inserts an audit entry in audit table using the provided JDBI handle.List<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)Fetches audit entries made for the given key, type and interval.List<AuditEntry>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 Detail
-
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
void doAudit(AuditEntry event)
-
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 calldoAudit(org.apache.druid.audit.AuditEntry)by default.- Parameters:
event- Event to audithandle- 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 entryinterval- 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
-
-