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 Stringprotected final Map<String, AuditBackendFactory<?>> protected static final Stringstatic final StringThe default audit backendname.static final StringIf passed as true on the event properties, event not loggedprotected static final Stringprotected final Map<String, List<ExtendedInfoMapper>> protected final ExpressionEvaluatorprotected static final Stringstatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAwaits the audit ingestion.buildEntryFromEvent(Event event) Returns a log entry representation of an event.protected voidINTERNAL METHOD FOR TESTS, DO NOT USE.protected voiddoPutExtendedInfos(LogEntryBuilder builder, EventContext eventContext, DocumentModel source, Principal principal) <T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.intThe component notification order forComponent.start(ComponentContext).<B extends AuditBackend>
BgetAuditBackend(String name) getExtendedInfoMappers(String eventName) protected voidpopulateExtendedInfo(LogEntryBuilder builder, DocumentModel source, ExpressionContext context, List<ExtendedInfoMapper> mappers) voidstart(ComponentContext context) Start the component.voidstop(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:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Overrides:
getAdapterin classDefaultComponent- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:ComponentThe 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:
getApplicationStartedOrderin interfaceComponent- Returns:
- the order, 1000 by default
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent- Throws:
InterruptedException
-
getAuditableEventNames
- Specified by:
getAuditableEventNamesin interfaceAuditService- Returns:
- the event names to write to the audit
-
getExtendedInfoMappers
- Specified by:
getExtendedInfoMappersin 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:
getAuditBackendin interfaceAuditService- Returns:
- the
AuditBackendwith the givenname
-
buildEntryFromEvent
Description copied from interface:AuditServiceReturns a log entry representation of an event.- Specified by:
buildEntryFromEventin 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:AuditServiceAwaits the audit ingestion.- Specified by:
awaitin interfaceAuditService- Throws:
InterruptedException
-
clearEntriesFromBackends
protected void clearEntriesFromBackends()INTERNAL METHOD FOR TESTS, DO NOT USE.
-