public interface AuditService
| Modifier and Type | Method and Description |
|---|---|
void |
attachContext(AuditContext context)
Attaches the provided audit context to the current thread.
|
AuditContext |
createContext()
Creates and attaches an "empty" audit context.
|
AuditContext |
detachContext()
Detaches the current audit context, if any, from the current thread.
|
<T> T |
execute(AuditContext context,
Callable<T> callable)
Executes the callable within the provided audit context.
|
Auditor |
getAuditor(String auditorName,
String componentName,
String serviceName)
Retrieves an auditor configured with the the provided component and service names.
|
AuditContext |
getContext()
Retrieves the current attached audit context, if any.
|
AuditContext createContext()
AuditContext getContext()
void attachContext(AuditContext context)
context - The audit context to attach to the current thread. May be null.AuditContext detachContext()
Auditor getAuditor(String auditorName, String componentName, String serviceName)
auditorName - The name of auditor. Can be used to separate audit events to different destinations. For example security audit, operations audit, etccomponentName - The name of component that will be placed used in every audit event generated by Auditor instanceserviceName - The name of service that will be placed used in every audit event generated by Auditor instance<T> T execute(AuditContext context, Callable<T> callable) throws Exception
T - Type of callablecontext - The context to establish around the invocation of the callable. May not be null.callable - The callable to invoke after establishing the correlation context. May not be null.Exception - Thrown if thrown by the callable's call method.Copyright © 2022 The Apache Software Foundation. All rights reserved.