Class StreamAuditWriter.AuditLogWriterComputation
- java.lang.Object
-
- org.nuxeo.lib.stream.computation.AbstractComputation
-
- org.nuxeo.lib.stream.computation.AbstractBatchComputation
-
- org.nuxeo.ecm.platform.audit.impl.StreamAuditWriter.AuditLogWriterComputation
-
- All Implemented Interfaces:
Computation
- Enclosing class:
- StreamAuditWriter
public static class StreamAuditWriter.AuditLogWriterComputation extends AbstractBatchComputation
-
-
Field Summary
-
Fields inherited from class org.nuxeo.lib.stream.computation.AbstractBatchComputation
batchRecords, currentInputStream, newBatch, removeLastRecordOnRetry, thresholdMillis, TIMER_BATCH
-
Fields inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
INPUT_1, INPUT_2, INPUT_3, INPUT_NULL, metadata, OUTPUT_1, OUTPUT_2, OUTPUT_3, OUTPUT_4
-
-
Constructor Summary
Constructors Constructor Description AuditLogWriterComputation(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
batchFailure(ComputationContext context, String inputStreamName, List<Record> records)
Called when the retry policy has failed.void
batchProcess(ComputationContext context, String inputStreamName, List<Record> records)
Called when: the batch capacity is reached the time threshold is reached the inputStreamName has changed If this method raises an exception the retry policy is applied.protected LogEntry
getLogEntryFromJson(byte[] data)
protected void
writeEntriesToAudit(List<LogEntry> logEntries)
-
Methods inherited from class org.nuxeo.lib.stream.computation.AbstractBatchComputation
checkpointBatch, init, processFailure, processRecord, processRetry, processTimer
-
Methods inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
metadata
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.lib.stream.computation.Computation
destroy, signalStop
-
-
-
-
Constructor Detail
-
AuditLogWriterComputation
public AuditLogWriterComputation(String name)
-
-
Method Detail
-
batchProcess
public void batchProcess(ComputationContext context, String inputStreamName, List<Record> records)
Description copied from class:AbstractBatchComputation
Called when:- the batch capacity is reached
- the time threshold is reached
- the inputStreamName has changed
- Specified by:
batchProcess
in classAbstractBatchComputation
- Parameters:
context
- used to send records to output streams, note that the checkpoint is managed automatically.inputStreamName
- the input streams where the records are coming fromrecords
- the batch of records
-
batchFailure
public void batchFailure(ComputationContext context, String inputStreamName, List<Record> records)
Description copied from class:AbstractBatchComputation
Called when the retry policy has failed.- Specified by:
batchFailure
in classAbstractBatchComputation
-
getLogEntryFromJson
protected LogEntry getLogEntryFromJson(byte[] data)
-
-