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)
AuditingContextexecuteWithoutAuditing in interface AuditingContextoperation - operation which doesn't have to be auditedpublic void onlyAuditFor(String subjectKey, Runnable operation)
AuditingContextonlyAuditFor in interface AuditingContextsubjectKey - Class of event to NOT skip auditing for.operation - operation which doesn't have to be auditedpublic AutoCloseable noAuditing()
AuditingContextAutoCloseable, 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 AuditingContextAutoCloseable, to use in try-with-resource expressionspublic AutoCloseable noAuditing(String summaryKey)
AuditingContextAutoCloseable, 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 AuditingContextsummaryKey - the summary key to NOT skip auditing forAutoCloseable, to use in try-with-resource expressionspublic boolean skipAuditing()
AuditingContexttrue if auditing has to be skipped in current thread, false otherwise.skipAuditing in interface AuditingContexttrue if auditing has to be skipped in current thread, false otherwise.public boolean skipAuditing(@Nullable String summaryKey)
skipAuditing in interface AuditingContextsummaryKey - 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–2022 Atlassian. All rights reserved.