Interface AuditLogContext

All Known Subinterfaces:
AuditLogContextInternal
All Known Implementing Classes:
AuditLogContextInternalImpl, NoOpAuditLogContext

public interface AuditLogContext
Allows to run code with overridden default properties (such as the audit log author or source)
Since:
3.2.0
  • Method Details

    • withAuditLogAuthor

      <T> T withAuditLogAuthor(AuditLogAuthor author, AuditLogContextCallback<T> callback) throws Exception
      Executes the callback on behalf of the specified author
      Type Parameters:
      T - Type of result of callback
      Parameters:
      author - author of operations
      callback - the actions to perform with the specified author
      Returns:
      result of callback
      Throws:
      Exception - the exception thrown from the callback (if any)
    • withAuditLogSource

      <T> T withAuditLogSource(AuditLogEventSource source, AuditLogContextCallback<T> callback) throws Exception
      Executes the callback using the specified source for the events audited in the callback
      Type Parameters:
      T - Type of result of callback
      Parameters:
      source - the source to use when auditing
      callback - the actions to perform with the specified source
      Returns:
      result of callback
      Throws:
      Exception - the exception thrown from the callback (if any)