Interface AuditProfile

All Known Implementing Classes:
AbstractAuditProfile

public interface AuditProfile
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Request object for querying audit records.
    static interface 
    Handler interface for stream processing audit records as they are returned.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Logs the given record to the audit log
    Returns this profile's current runtime health, as surfaced on the Security → Audit Profiles config page.
    default boolean
    Called when the profile's name has been changed.
    default void
    Called when the profile resource has been deleted.
    default List<AuditRecord>
    Queries the audit log based on the given request object, collecting every matching record into a list.
    void
    Queries the audit log based on the given request object, processing each record with the given handler as they are read.
    default void
    Override to implement specific shutdown behavior.
    default void
    Override to implement specific startup behavior.
  • Method Details

    • startup

      default void startup() throws Exception
      Override to implement specific startup behavior. Defaults to no-op.
      Throws:
      Exception
      Since:
      8.0.5
    • shutdown

      default void shutdown()
      Override to implement specific shutdown behavior. Defaults to no-op.
      Since:
      8.0.5
    • getStatus

      default ProfileStatus getStatus()
      Returns this profile's current runtime health, as surfaced on the Security → Audit Profiles config page. The same ProfileStatus contract that tag providers, tag history, and alarm-notification profiles report.

      The default reports ProfileStatus.RUNNING. Implementations that track their own health should extend AbstractAuditProfile (which makes the status settable via setStatus) or override this method to compute it on demand.

      Returns:
      the profile's current status; never null.
      Since:
      2027.2
    • audit

      void audit(AuditRecord record)
      Logs the given record to the audit log
    • query

      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.QueryRequest can 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 honoring AuditProfile.QueryRequest.limit(); a null limit 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 use query(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

      default List<AuditRecord> query(AuditProfile.QueryRequest request) throws Exception
      Queries the audit log based on the given request object, collecting every matching record into a list. This is a convenience wrapper around query(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(): the SystemProps.AUDIT_PROFILE_MAX_RECORDS_PER_REQUEST value. A configured default of less than 1 means "unlimited" (legacy behavior). Callers that need to stream an unbounded result set should use query(QueryRequest, QueryStreamHandler) directly instead.

      Parameters:
      request - the query request.
      Returns:
      the matching audit records.
      Throws:
      Exception - if an error occurs during the query
    • handleNameChange

      default boolean handleNameChange(String newName)
      Called when the profile's name has been changed. Implementations that use store-and-forward should notify the StoreAndForwardManager of 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:
      true if the name change was handled successfully without requiring a restart, false if 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 the StoreAndForwardManager of 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