Package org.nuxeo.audit.service
Class AuditComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.audit.service.AuditComponent
- All Implemented Interfaces:
AuditRouter,AuditService,Adaptable,Component,Extensible,TimestampedService
- Since:
- 2025.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected 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 StringDeprecated, for removal: This API element is subject to removal in a future version.protected Map<String, List<ExtendedInfoMapper>> protected final ExpressionEvaluatorprotected static final Stringstatic final Stringprotected Booleanprotected static final Stringprotected static final Stringstatic final Stringprotected static 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.computeLogEntries(Event event) Computes the log entries from the given event based on contributed audit routes.protected voiddoPutExtendedInfos(LogEntryBuilder builder, EventContext eventContext, DocumentModel source, Principal principal) extractVirtualEvents(Object[] args) <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) Returns the audit router introspection to get information about the registered routes and backends.protected booleanprotected voidpopulateExtendedInfo(LogEntryBuilder builder, DocumentModel source, ExpressionContext context, List<ExtendedInfoMapper> mappers) voidregisterContribution(Object contribution, String xp, ComponentInstance component) Deprecated, for removal: This API element is subject to removal in a future version.voidrouteToBackends(List<LogEntry> logEntries) Routes the given log entries to the appropriate backends based on contributed live audit routes.voidrouteToBackends(List<LogEntry> logEntries, List<Route> routes) Routes the given log entries to the appropriate backends based on given audit routes.voidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.voidunregisterContribution(Object contribution, String xp, ComponentInstance component) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, unregister, 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:
-
STREAM_AUDIT_VIRTUAL_EVENTS_ENABLED_PROP
- Since:
- 2025.16
- See Also:
-
SEQUENCE_NAME
- See Also:
-
VIRTUAL_EVENT
- See Also:
-
ADAPTER_EXT_POINT
- See Also:
-
BACKEND_FACTORY_EXT_POINT
- See Also:
-
EVENT_EXT_POINT
Deprecated, for removal: This API element is subject to removal in a future version.since 2025.16, useROUTES_EXT_POINTinstead- See Also:
-
EXTENDED_INFO_EXT_POINT
- See Also:
-
ROUTES_EXT_POINT
- Since:
- 2025.16
- See Also:
-
expressionEvaluator
-
auditBackendFactories
-
eventExtendedInfoMappers
-
routes
- Since:
- 2025.16
-
handleVirtualEvents
-
-
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
-
registerContribution
@Deprecated(since="2025.16", forRemoval=true) public void registerContribution(Object contribution, String xp, ComponentInstance component) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
@Deprecated(since="2025.16", forRemoval=true) public void unregisterContribution(Object contribution, String xp, ComponentInstance component) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
unregisterContributionin classDefaultComponent
-
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
-
computeLogEntries
Description copied from interface:AuditRouterComputes the log entries from the given event based on contributed audit routes.- Specified by:
computeLogEntriesin interfaceAuditRouter- Parameters:
event- the event to compute log entries from- Returns:
- the log entries to route, it could be an empty list if the event doesn't match any route
- Since:
- 2025.16
-
handleVirtualEvents
protected boolean handleVirtualEvents() -
extractVirtualEvents
-
routeToBackends
Description copied from interface:AuditRouterRoutes the given log entries to the appropriate backends based on contributed live audit routes.- Specified by:
routeToBackendsin interfaceAuditRouter- Parameters:
logEntries- the log entries to route
-
routeToBackends
Description copied from interface:AuditRouterRoutes the given log entries to the appropriate backends based on given audit routes.Each given route will be evaluated and log entry routed if it matches.
- Specified by:
routeToBackendsin interfaceAuditRouter- Parameters:
logEntries- the log entries to routeroutes- the routes to evaluate on log entries
-
getIntrospection
Description copied from interface:AuditRouterReturns the audit router introspection to get information about the registered routes and backends.- Specified by:
getIntrospectionin interfaceAuditRouter- Returns:
- the audit router introspection
-
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.
-
ROUTES_EXT_POINTinstead