public final class AuditingContext extends Object
Modifier and Type | Method and Description |
---|---|
static void |
executeWithoutAuditing(Runnable operation)
Executed operation with auditing being turned off for current thread
|
static AutoCloseable |
noAuditing()
This method provides convenient
AutoCloseable , to use in try-with-resource expressions. |
static AutoCloseable |
noAuditing(String summaryKey)
This method provides convenient
AutoCloseable , to use in try-with-resource expressions. |
static void |
onlyAuditFor(String subjectKey,
Runnable operation)
Execute operation without auditing except for an event with given subjectKey
|
static boolean |
skipAuditing()
Returns
true if auditing has to be skipped in current thread, false otherwise. |
static boolean |
skipAuditing(@Nullable String summaryKey) |
public static void executeWithoutAuditing(Runnable operation)
operation
- operation which doesn't have to be auditedpublic static void onlyAuditFor(String subjectKey, Runnable operation)
subjectKey
- Class of event to NOT skip auditing for.operation
- operation which doesn't have to be auditedpublic static AutoCloseable noAuditing()
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);
}
AutoCloseable
, to use in try-with-resource expressionspublic static AutoCloseable noAuditing(String summaryKey)
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);
}
summaryKey
- the summary key to NOT skip auditing forAutoCloseable
, to use in try-with-resource expressionspublic static boolean skipAuditing()
true
if auditing has to be skipped in current thread, false
otherwise.true
if auditing has to be skipped in current thread, false
otherwise.public static boolean skipAuditing(@Nullable String summaryKey)
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.true
if auditing has to be skipped in current thread, false
otherwise.Copyright © 2003–2020 Atlassian. All rights reserved.
View cookie preferences