Interface AuditProfile


public interface AuditProfile
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Convenience object - if you're building audit records from some DB query, this will create them for you.
    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
    default boolean
    Called when the profile's name has been changed.
    default void
    Called when the profile resource has been deleted.
    query(@Nullable String actorFilter, @Nullable String actionFilter, @Nullable String actionTargetFilter, @Nullable String actionValueFilter, @Nullable Date startTime, @Nullable Date endTime, @Nullable String systemFilter, @Nullable Integer contextFilter)
    Queries the audit log for any records that match the given filter elements.
    default 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.
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
  • 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
    • audit

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

      List<AuditRecord> query(@Nullable String actorFilter, @Nullable String actionFilter, @Nullable String actionTargetFilter, @Nullable String actionValueFilter, @Nullable Date startTime, @Nullable Date endTime, @Nullable String systemFilter, @Nullable Integer contextFilter) throws Exception
      Queries the audit log for any records that match the given filter elements. All filter arguments 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)
      Parameters:
      contextFilter - A bitmask for ApplicationScope
      Throws:
      Exception
    • query

      default 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.

      The default implementation does not support streaming and will load all records into memory before passing them to the handler. AuditProfile implementations should override this method to provide true streaming behavior.

      Profiles that override this method to provide true streaming behavior should also override supportsStreaming() to return true.

      Parameters:
      request - the query request.
      handler - handler for processing each audit record.
      Throws:
      Exception - if an error occurs during the query
      See Also:
    • supportsStreaming

      @Deprecated(since="8.3.5", forRemoval=true) default boolean supportsStreaming()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Indicates whether this AuditProfile implementation supports true streaming of audit records by overriding query(QueryRequest, QueryStreamHandler).
      Returns:
      true if streaming is supported, false otherwise
    • 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