Package org.forgerock.audit.handlers.jms
Class BatchPublisherConfiguration
java.lang.Object
org.forgerock.audit.handlers.jms.BatchPublisherConfiguration
This class holds the configuration properties that are used by the {#link BatchPublisher} to control the batch queue
and worker threads that process the items in the queue.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the maximum capacity of the publishing queue.long
Returns the timeout in seconds the duration that the queue should block while attempting to offer a new item for the queue.int
Returns the maximum count of events that will be expected to be delivered in a single publish call.long
Returns the timeout in seconds for the worker threads to wait for a new item to be available in the queue before exiting.long
Returnds the timeout in seconds for the publisher to wait for all worker threads to terminate at shutdown.int
Returns the count of worker threads to have processing the queue.boolean
Returns true if handling of audit events should be done in batches.void
setBatchEnabled
(boolean batchEnabled) sets if handling of audit events should be done in batches.void
setCapacity
(int capacity) Sets the maximum capacity of the publishing queue.void
setInsertTimeoutSec
(long insertTimeoutSec) Sets the timeout in seconds the duration that the queue should block while attempting to offer a new item for the queue.void
setMaxBatchedEvents
(int maxBatchedEvents) Sets the maximum count of events that will be expected to be delivered in a single publish call.void
setPollTimeoutSec
(long pollTimeoutSec) Sets the timeout in seconds for the worker threads to wait for a new item to be available in the queue before exiting.void
setShutdownTimeoutSec
(long shutdownTimeoutSec) Sets the timeout in seconds for the publisher to wait for all worker threads to terminate at shutdown.void
setThreadCount
(int threadCount) Sets the count of worker threads to have processing the queue.
-
Constructor Details
-
BatchPublisherConfiguration
public BatchPublisherConfiguration()
-
-
Method Details
-
getCapacity
Returns the maximum capacity of the publishing queue. Execution will block if the queue size is at capacity.- Returns:
- the maximum capacity of the publishing queue
-
setCapacity
Sets the maximum capacity of the publishing queue.- Parameters:
capacity
- the maximum capacity of the publishing queue
-
getThreadCount
Returns the count of worker threads to have processing the queue.- Returns:
- the count of worker threads to have processing the queue.
-
setThreadCount
Sets the count of worker threads to have processing the queue.- Parameters:
threadCount
- the count of worker threads to have processing the queue.
-
getMaxBatchedEvents
Returns the maximum count of events that will be expected to be delivered in a single publish call.- Returns:
- the maximum count of events that will be expected to be delivered in a single publish call.
-
setMaxBatchedEvents
Sets the maximum count of events that will be expected to be delivered in a single publish call.- Parameters:
maxBatchedEvents
- the maximum count of events
-
getInsertTimeoutSec
Returns the timeout in seconds the duration that the queue should block while attempting to offer a new item for the queue.- Returns:
- timeout in seconds
-
setInsertTimeoutSec
Sets the timeout in seconds the duration that the queue should block while attempting to offer a new item for the queue.- Parameters:
insertTimeoutSec
- timeout in seconds
-
getPollTimeoutSec
Returns the timeout in seconds for the worker threads to wait for a new item to be available in the queue before exiting.- Returns:
- timeout in seconds
-
setPollTimeoutSec
Sets the timeout in seconds for the worker threads to wait for a new item to be available in the queue before exiting.- Parameters:
pollTimeoutSec
- timeout in seconds
-
getShutdownTimeoutSec
Returnds the timeout in seconds for the publisher to wait for all worker threads to terminate at shutdown.- Returns:
- timeout in seconds
-
setShutdownTimeoutSec
Sets the timeout in seconds for the publisher to wait for all worker threads to terminate at shutdown.- Parameters:
shutdownTimeoutSec
- timeout in seconds
-
isBatchEnabled
Returns true if handling of audit events should be done in batches.- Returns:
- true if handling of audit events should be done in batches.
-
setBatchEnabled
sets if handling of audit events should be done in batches.- Parameters:
batchEnabled
- true if handling of audit events should be done in batches.
-