Package org.nuxeo.audit.service
Class AuditComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.audit.service.AuditComponent
- All Implemented Interfaces:
AuditService
,Adaptable
,Component
,Extensible
,TimestampedService
- Since:
- 2025.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected final Map
<String, AuditBackendFactory<?>> protected static final String
static final String
The default audit backendname
.static final String
If passed as true on the event properties, event not loggedprotected static final String
protected final Map
<String, List<ExtendedInfoMapper>> protected final ExpressionEvaluator
protected static final String
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Awaits the audit ingestion.buildEntryFromEvent
(Event event) Returns a log entry representation of an event.protected void
INTERNAL METHOD FOR TESTS, DO NOT USE.protected void
doPutExtendedInfos
(LogEntryBuilder builder, EventContext eventContext, DocumentModel source, Principal principal) <T> T
getAdapter
(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.int
The component notification order forComponent.start(ComponentContext)
.<B extends AuditBackend>
BgetAuditBackend
(String name) getExtendedInfoMappers
(String eventName) protected void
populateExtendedInfo
(LogEntryBuilder builder, DocumentModel source, ExpressionContext context, List<ExtendedInfoMapper> mappers) void
start
(ComponentContext context) Start the component.void
stop
(ComponentContext context) Stop the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
-
Field Details
-
DEFAULT_AUDIT_BACKEND
The default audit backendname
.- See Also:
-
DISABLE_AUDIT_LOGGER
If passed as true on the event properties, event not logged- See Also:
-
FORCE_AUDIT_FACET
- See Also:
-
ADAPTER_EXT_POINT
- See Also:
-
BACKEND_FACTORY_EXT_POINT
- See Also:
-
EVENT_EXT_POINT
- See Also:
-
EXTENDED_INFO_EXT_POINT
- See Also:
-
auditBackendFactories
-
eventExtendedInfoMappers
-
expressionEvaluator
-
-
Constructor Details
-
AuditComponent
public AuditComponent()
-
-
Method Details
-
getAdapter
Description copied from interface:Adaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
if no such object can be found.- Specified by:
getAdapter
in interfaceAdaptable
- Overrides:
getAdapter
in classDefaultComponent
- Parameters:
adapter
- the adapter class to look up- Returns:
- a object castable to the given class, or
null
if this object does not have an adapter for the given class
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:Component
The component notification order forComponent.start(ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
- Throws:
InterruptedException
-
getAuditableEventNames
- Specified by:
getAuditableEventNames
in interfaceAuditService
- Returns:
- the event names to write to the audit
-
getExtendedInfoMappers
- Specified by:
getExtendedInfoMappers
in interfaceAuditService
- Parameters:
eventName
- the event name to write to the audit- Returns:
- the extended info mappers to apply when writing to the audit
-
getAuditBackend
- Specified by:
getAuditBackend
in interfaceAuditService
- Returns:
- the
AuditBackend
with the givenname
-
buildEntryFromEvent
Description copied from interface:AuditService
Returns a log entry representation of an event.- Specified by:
buildEntryFromEvent
in interfaceAuditService
-
doPutExtendedInfos
protected void doPutExtendedInfos(LogEntryBuilder builder, EventContext eventContext, DocumentModel source, Principal principal) -
populateExtendedInfo
protected void populateExtendedInfo(LogEntryBuilder builder, DocumentModel source, ExpressionContext context, List<ExtendedInfoMapper> mappers) -
await
Description copied from interface:AuditService
Awaits the audit ingestion.- Specified by:
await
in interfaceAuditService
- Throws:
InterruptedException
-
clearEntriesFromBackends
protected void clearEntriesFromBackends()INTERNAL METHOD FOR TESTS, DO NOT USE.
-