@ParametersAreNonnullByDefault public class DefaultBufferingAuditService extends Object implements BufferingAuditService
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.Constructor and Description |
---|
DefaultBufferingAuditService(com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
void |
auditOrPutToQueue(java.util.function.Supplier<com.atlassian.audit.entity.AuditEvent> eventSupplier)
Will buffer event suppliers without calling them until
ComponentManagerStartedEvent is received, signalling
that Jira has finished its start-up. |
void |
onComponentManagerStartedEvent(ComponentManagerStartedEvent ignore) |
public DefaultBufferingAuditService(com.atlassian.event.api.EventPublisher eventPublisher)
@EventListener public void onComponentManagerStartedEvent(ComponentManagerStartedEvent ignore)
public void auditOrPutToQueue(java.util.function.Supplier<com.atlassian.audit.entity.AuditEvent> eventSupplier)
ComponentManagerStartedEvent
is received, signalling
that Jira has finished its start-up.
After that notification is received, it will always forward calls to AuditService
directly.
If the capacity of the queue is exceeded, the exception will be logged but not thrown.auditOrPutToQueue
in interface BufferingAuditService
eventSupplier
- - event supplier that will not be called until ComponentManagerStartedEvent
is receivedCopyright © 2002-2023 Atlassian. All Rights Reserved.