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 static final ThreadLocal
<Boolean> 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 String
protected StreamManager
protected long
getTimestampForEntry
(LogEntry entry) void
handleEvent
(Event event) Handle the given event.protected Record
protected Record
protected boolean
registerSynchronization
(jakarta.transaction.Synchronization sync) protected void
-
Field Details
-
isEnlisted
-
entries
-
STREAM_AUDIT_ENABLED_PROP
- See Also:
-
STREAM_NAME
- See Also:
-
writeCounter
-
DEFAULT_LOG_CONFIG
Deprecated.- See Also:
-
-
Constructor Details
-
StreamAuditEventListener
public StreamAuditEventListener()
-
-
Method Details
-
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
-
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
-