Class DefaultAuditingContext

java.lang.Object
com.atlassian.confluence.impl.audit.DefaultAuditingContext
All Implemented Interfaces:
AuditingContext

public class DefaultAuditingContext extends Object implements AuditingContext
Since:
7.8.0
  • Constructor Details

    • DefaultAuditingContext

      public DefaultAuditingContext()
  • Method Details

    • executeWithoutAuditing

      public void executeWithoutAuditing(Runnable operation)
      Description copied from interface: AuditingContext
      Executed operation with auditing being turned off for current thread
      Specified by:
      executeWithoutAuditing in interface AuditingContext
      Parameters:
      operation - operation which doesn't have to be audited
    • onlyAuditFor

      public void onlyAuditFor(String subjectKey, Runnable operation)
      Description copied from interface: AuditingContext
      Execute operation without auditing except for an event with given subjectKey
      Specified by:
      onlyAuditFor in interface AuditingContext
      Parameters:
      subjectKey - Class of event to NOT skip auditing for.
      operation - operation which doesn't have to be audited
    • noAuditing

      public AutoCloseable noAuditing()
      Description copied from interface: AuditingContext
      This method provides convenient AutoCloseable, to use in try-with-resource expressions. For example try (AutoCloseable c = noAuditing()) { // operation, for which auditing has to be silenced copyPermissions(from, to); }
      Specified by:
      noAuditing in interface AuditingContext
      Returns:
      convenient AutoCloseable, to use in try-with-resource expressions
    • noAuditing

      public AutoCloseable noAuditing(String summaryKey)
      Description copied from interface: AuditingContext
      This method provides convenient AutoCloseable, to use in try-with-resource expressions. For example try (AutoCloseable c = noAuditing(event)) { // operation, for which auditing has to be silenced copyPermissions(from, to); }
      Specified by:
      noAuditing in interface AuditingContext
      Parameters:
      summaryKey - the summary key to NOT skip auditing for
      Returns:
      convenient AutoCloseable, to use in try-with-resource expressions
    • skipAuditing

      public boolean skipAuditing()
      Description copied from interface: AuditingContext
      Returns true if auditing has to be skipped in current thread, false otherwise.
      Specified by:
      skipAuditing in interface AuditingContext
      Returns:
      true if auditing has to be skipped in current thread, false otherwise.
    • skipAuditing

      public boolean skipAuditing(@Nullable String summaryKey)
      Specified by:
      skipAuditing in interface AuditingContext
      Parameters:
      summaryKey - if skipAuditing is true, but the this key matches the summary key, auditing will not be skipped. Returns true if auditing has to be skipped in current thread, false otherwise.
      Returns:
      true if auditing has to be skipped in current thread, false otherwise.