Interface AuditService
- All Known Subinterfaces:
InternalAuditService
- All Known Implementing Classes:
AuditServiceImpl
,NoOpAuditService
public interface AuditService
The service for interacting with the audit log. It allows to create new audit log entries or query the audit log.
- Since:
- v2.12
-
Method Summary
Modifier and TypeMethodDescriptionReturns current auditing configurationboolean
Deprecated.void
saveAudit
(AuditLogChangeset changeset) Persists an audit log changeset.void
saveConfiguration
(AuditLogConfiguration auditLogConfiguration) Sets the new configuration for auditing<T> List<T>
searchAuditLog
(AuditLogQuery<T> query) Queries the audit log.boolean
Allows the caller to determine whether it should attempt to generate audit events.
-
Method Details
-
saveAudit
Persists an audit log changeset. The timestamp will be set to the current time. Will not do anything when audit log is disabled.- Parameters:
changeset
- the changeset that will be persisted
-
searchAuditLog
Queries the audit log. Returns aList
ofAuditLogChangeset
s, which match the criteria specified in the query. The results will be sorted by the timestamp, descending.- Parameters:
query
- the search query- Returns:
- List of AuditLogEntry matching the query
- Since:
- v3.2
-
isEnabled
Deprecated.As of v3.2, replaced byshouldAuditEvent()
- Returns:
- true if the audit log is enabled, false otherwise. A disabled audit log will not persist any new entries.
-
saveConfiguration
Sets the new configuration for auditing- Parameters:
auditLogConfiguration
- new configuration
-
getConfiguration
AuditLogConfiguration getConfiguration()Returns current auditing configuration- Returns:
- current configuration
-
shouldAuditEvent
boolean shouldAuditEvent()Allows the caller to determine whether it should attempt to generate audit events. Auditing might be disabled globally, or it might be disabled during specific operations or states (for example during synchronizations).- Returns:
- true if calling saveAudit() will persist the event, false otherwise
- Since:
- v3.2
-
shouldAuditEvent()