Interface AuditProfile
- All Known Implementing Classes:
AbstractAuditProfile
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRequest object for querying audit records.static interfaceHandler interface for stream processing audit records as they are returned. -
Method Summary
Modifier and TypeMethodDescriptionvoidaudit(AuditRecord record) Logs the given record to the audit logdefault ProfileStatusReturns this profile's current runtime health, as surfaced on the Security → Audit Profiles config page.default booleanhandleNameChange(String newName) Called when the profile's name has been changed.default voidCalled when the profile resource has been deleted.default List<AuditRecord> query(AuditProfile.QueryRequest request) Queries the audit log based on the given request object, collecting every matching record into a list.voidquery(AuditProfile.QueryRequest request, AuditProfile.QueryStreamHandler handler) Queries the audit log based on the given request object, processing each record with the given handler as they are read.default voidshutdown()Override to implement specific shutdown behavior.default voidstartup()Override to implement specific startup behavior.
-
Method Details
-
startup
-
shutdown
default void shutdown()Override to implement specific shutdown behavior. Defaults to no-op.- Since:
- 8.0.5
-
getStatus
Returns this profile's current runtime health, as surfaced on the Security → Audit Profiles config page. The sameProfileStatuscontract that tag providers, tag history, and alarm-notification profiles report.The default reports
ProfileStatus.RUNNING. Implementations that track their own health should extendAbstractAuditProfile(which makes the status settable viasetStatus) or override this method to compute it on demand.- Returns:
- the profile's current status; never
null. - Since:
- 2027.2
-
audit
Logs the given record to the audit log -
query
void query(AuditProfile.QueryRequest request, AuditProfile.QueryStreamHandler handler) throws Exception Queries the audit log based on the given request object, processing each record with the given handler as they are read.Filters carried by the
AuditProfile.QueryRequestcan be null, which means to not filter by that field. String-based filters can include a wildcard character of '%' which means any characters (zero or more). Implementations are responsible for honoringAuditProfile.QueryRequest.limit(); anulllimit means stream every matching record with no limit. This overload applies no default limit, so streaming callers can opt out of one. Callers that buffer the full result set in memory should usequery(QueryRequest), which applies a default record limit.Note: profiles that delegate to a remote gateway (e.g. a remote audit profile) are an exception. They do not propagate the requested limit over the wire, and the remote gateway buffers and caps the result set with its own default, so streaming callers cannot opt out of a limit for those profiles.
- Parameters:
request- the query request.handler- handler for processing each audit record.- Throws:
Exception- if an error occurs during the query
-
query
Queries the audit log based on the given request object, collecting every matching record into a list. This is a convenience wrapper aroundquery(QueryRequest, QueryStreamHandler)for callers that want the full result set rather than streaming behavior.Because this overload buffers every matching record in memory, it applies a default record limit as an OOM guard when the request carries no explicit
AuditProfile.QueryRequest.limit(): theSystemProps.AUDIT_PROFILE_MAX_RECORDS_PER_REQUESTvalue. A configured default of less than 1 means "unlimited" (legacy behavior). Callers that need to stream an unbounded result set should usequery(QueryRequest, QueryStreamHandler)directly instead.- Parameters:
request- the query request.- Returns:
- the matching audit records.
- Throws:
Exception- if an error occurs during the query
-
handleNameChange
Called when the profile's name has been changed. Implementations that use store-and-forward should notify theStoreAndForwardManagerof the rename.The default implementation returns
false, indicating that the profile does not support hot-reloading of name changes and requires a full restart.- Parameters:
newName- the new profile name- Returns:
trueif the name change was handled successfully without requiring a restart,falseif a restart is required- Since:
- 8.3.4
-
handleResourceDeleted
default void handleResourceDeleted()Called when the profile resource has been deleted. Implementations that use store-and-forward should notify theStoreAndForwardManagerof the deletion to clean up cached data.This method is called before
shutdown()when the resource is being deleted, but not during normal shutdown or restart operations.- Since:
- 8.3.5
-