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