public abstract static class AbstractSnapshotter.Builder extends Object
AbstractSnapshotter
implementations.
The Executor
is defaulted to an DirectExecutor.INSTANCE
, the TransactionManager
defaults
to a NoTransactionManager
, and the SnapshotterSpanFactory
defaults to a
DefaultSnapshotterSpanFactory
with a NoOpSpanFactory
delegate. The
EventStore
is a hard requirement and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AbstractSnapshotter.Builder |
eventStore(EventStore eventStore)
Sets the
EventStore instance which this AbstractSnapshotter implementation will store
snapshots in. |
AbstractSnapshotter.Builder |
executor(Executor executor)
Sets the
Executor which handles the actual snapshot creation process. |
AbstractSnapshotter.Builder |
spanFactory(SnapshotterSpanFactory spanFactory)
Sets the
SnapshotterSpanFactory implementation to use for providing tracing capabilities. |
AbstractSnapshotter.Builder |
spanFactory(SpanFactory spanFactory)
Deprecated.
Use
spanFactory(SnapshotterSpanFactory) instead as it provides more configurability. |
AbstractSnapshotter.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage the transaction around storing the snapshot. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public AbstractSnapshotter.Builder eventStore(EventStore eventStore)
EventStore
instance which this AbstractSnapshotter
implementation will store
snapshots in.eventStore
- the EventStore
instance which this AbstractSnapshotter
implementation will
store snapshots inpublic AbstractSnapshotter.Builder executor(Executor executor)
Executor
which handles the actual snapshot creation process. Defaults to a
DirectExecutor
.executor
- an Executor
which handles the actual snapshot creation process@Deprecated public AbstractSnapshotter.Builder spanFactory(@Nonnull SpanFactory spanFactory)
spanFactory(SnapshotterSpanFactory)
instead as it provides more configurability.SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementation.public AbstractSnapshotter.Builder spanFactory(@Nonnull SnapshotterSpanFactory spanFactory)
SnapshotterSpanFactory
implementation to use for providing tracing capabilities. Defaults to a
DefaultSnapshotterSpanFactory
with a NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementation.public AbstractSnapshotter.Builder transactionManager(TransactionManager transactionManager)
TransactionManager
used to manage the transaction around storing the snapshot. Defaults to a
NoTransactionManager
.transactionManager
- the TransactionManager
used to manage the transaction around storing the
snapshotprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2024. All rights reserved.