Class BufferedBatchPublisher
java.lang.Object
org.forgerock.audit.events.handlers.buffering.BufferedBatchPublisher
- All Implemented Interfaces:
BatchPublisher
Buffers audit events to a bounded queue, periodically flushing the queue to a provided
BatchConsumer.
If the bounded queue becomes full, further events are dropped until the queue is next flushed.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder used to construct a newBufferedBatchPublisher. -
Method Summary
Modifier and TypeMethodDescriptionnewBuilder(BatchConsumer batchConsumer) Provides a new builder.booleanInserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returningtrueupon success andfalseif this queue is full.voidshutdown()Stops sending batch data, and awaits termination of pending queue tasks whenautoFlushis enabled.voidstartup()Starts periodically sending batch data.
-
Method Details
-
startup
public void startup()Starts periodically sending batch data.- Specified by:
startupin interfaceBatchPublisher
-
shutdown
public void shutdown()Stops sending batch data, and awaits termination of pending queue tasks whenautoFlushis enabled.- Specified by:
shutdownin interfaceBatchPublisher
-
offer
Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returningtrueupon success andfalseif this queue is full.- Specified by:
offerin interfaceBatchPublisher- Parameters:
topic- Event topicevent- Event payload to index, where_idfield is the identifier- Returns:
trueif the element was added to this queue, elsefalse
-
newBuilder
Provides a new builder.- Parameters:
batchConsumer- a non-null batch consumer- Returns:
- a new builder
-