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 Summary
Constructors Constructor Description DefaultAuditingContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteWithoutAuditing(Runnable operation)Executed operation with auditing being turned off for current threadAutoCloseablenoAuditing()This method provides convenientAutoCloseable, to use in try-with-resource expressions.AutoCloseablenoAuditing(String summaryKey)This method provides convenientAutoCloseable, to use in try-with-resource expressions.voidonlyAuditFor(String subjectKey, Runnable operation)Execute operation without auditing except for an event with given subjectKeybooleanskipAuditing()Returnstrueif auditing has to be skipped in current thread,falseotherwise.booleanskipAuditing(@Nullable String summaryKey)
-
-
-
Method Detail
-
executeWithoutAuditing
public void executeWithoutAuditing(Runnable operation)
Description copied from interface:AuditingContextExecuted operation with auditing being turned off for current thread- Specified by:
executeWithoutAuditingin interfaceAuditingContext- Parameters:
operation- operation which doesn't have to be audited
-
onlyAuditFor
public void onlyAuditFor(String subjectKey, Runnable operation)
Description copied from interface:AuditingContextExecute operation without auditing except for an event with given subjectKey- Specified by:
onlyAuditForin interfaceAuditingContext- 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:AuditingContextThis method provides convenientAutoCloseable, to use in try-with-resource expressions. For exampletry (AutoCloseable c = noAuditing()) { // operation, for which auditing has to be silenced copyPermissions(from, to); }- Specified by:
noAuditingin interfaceAuditingContext- Returns:
- convenient
AutoCloseable, to use in try-with-resource expressions
-
noAuditing
public AutoCloseable noAuditing(String summaryKey)
Description copied from interface:AuditingContextThis method provides convenientAutoCloseable, to use in try-with-resource expressions. For exampletry (AutoCloseable c = noAuditing(event)) { // operation, for which auditing has to be silenced copyPermissions(from, to); }- Specified by:
noAuditingin interfaceAuditingContext- 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:AuditingContextReturnstrueif auditing has to be skipped in current thread,falseotherwise.- Specified by:
skipAuditingin interfaceAuditingContext- Returns:
trueif auditing has to be skipped in current thread,falseotherwise.
-
skipAuditing
public boolean skipAuditing(@Nullable String summaryKey)
- Specified by:
skipAuditingin interfaceAuditingContext- Parameters:
summaryKey- if skipAuditing is true, but the this key matches the summary key, auditing will not be skipped. Returnstrueif auditing has to be skipped in current thread,falseotherwise.- Returns:
trueif auditing has to be skipped in current thread,falseotherwise.
-
-