Package com.atlassian.jira.auditing
Class DefaultBufferingAuditService
java.lang.Object
com.atlassian.jira.auditing.DefaultBufferingAuditService
- All Implemented Interfaces:
BufferingAuditService
@ParametersAreNonnullByDefault
public class DefaultBufferingAuditService
extends Object
implements BufferingAuditService
A wrapper for
AuditService
that provides buffering capabilities during Jira start-up.
The implementation of this class allows to process audit events from the components that AuditService
implementation depends on.
It allows to avoid circular dependencies and to audit events very early in the Jira start-up cycle by buffering incoming events until
it receives ComponentManagerStartedEvent
notification.
After that notification is received, the accumulated queue of events will be flushed and all subsequent events will be audited directly.
Please be aware that the timestamps of the events that were deferred will not match the actual time they occurred.- Since:
- v8.9
-
Constructor Summary
ConstructorDescriptionDefaultBufferingAuditService
(com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
auditOrPutToQueue
(Supplier<com.atlassian.audit.entity.AuditEvent> eventSupplier) Will buffer event suppliers without calling them untilComponentManagerStartedEvent
is received, signalling that Jira has finished its start-up.void
-
Constructor Details
-
DefaultBufferingAuditService
public DefaultBufferingAuditService(com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
onComponentManagerStartedEvent
-
auditOrPutToQueue
Will buffer event suppliers without calling them untilComponentManagerStartedEvent
is received, signalling that Jira has finished its start-up. After that notification is received, it will always forward calls toAuditService
directly. If the capacity of the queue is exceeded, the exception will be logged but not thrown.- Specified by:
auditOrPutToQueue
in interfaceBufferingAuditService
- Parameters:
eventSupplier
- - event supplier that will not be called untilComponentManagerStartedEvent
is received
-