Package org.nuxeo.audit.listener
Class StreamAuditEventListener
java.lang.Object
org.nuxeo.audit.listener.StreamAuditEventListener
- All Implemented Interfaces:
jakarta.transaction.Synchronization
,EventListener
public class StreamAuditEventListener
extends Object
implements EventListener, jakarta.transaction.Synchronization
An events collector that write log entries as json record into a stream.
- Since:
- 9.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.protected static final ThreadLocal
<List<LogEntry>> protected Boolean
protected static final ThreadLocal
<Boolean> static final String
static final String
static final String
static final String
protected static final AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(int status) protected String
void
protected Collection
<? extends LogEntry> extractVirtualEvents
(Object[] args) protected String
protected StreamManager
protected long
getTimestampForEntry
(LogEntry entry) void
handleEvent
(Event event) Handle the given event.protected boolean
protected Record
protected Record
protected boolean
registerSynchronization
(jakarta.transaction.Synchronization sync) protected void
-
Field Details
-
isEnlisted
-
entries
-
STREAM_AUDIT_ENABLED_PROP
- See Also:
-
STREAM_AUDIT_VIRTUAL_EVENTS_ENABLED_PROP
- See Also:
-
VIRTUAL_EVENT
- See Also:
-
STREAM_NAME
- See Also:
-
writeCounter
-
handleVirtualEvents
-
DEFAULT_LOG_CONFIG
Deprecated.- See Also:
-
-
Constructor Details
-
StreamAuditEventListener
public StreamAuditEventListener()
-
-
Method Details
-
handleVirtualEvents
protected boolean handleVirtualEvents() -
handleEvent
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
extractVirtualEvents
-
beforeCompletion
public void beforeCompletion()- Specified by:
beforeCompletion
in interfacejakarta.transaction.Synchronization
-
afterCompletion
public void afterCompletion(int status) - Specified by:
afterCompletion
in interfacejakarta.transaction.Synchronization
-
writeEntries
protected void writeEntries() -
getPartitionKey
-
recordOf
-
recordOf
-
getTimestampForEntry
-
asJson
-
registerSynchronization
protected boolean registerSynchronization(jakarta.transaction.Synchronization sync) -
getStreamManager
-