Package org.axonframework.eventsourcing
Class AbstractSnapshotter.Builder
java.lang.Object
org.axonframework.eventsourcing.AbstractSnapshotter.Builder
- Direct Known Subclasses:
AggregateSnapshotter.Builder
- Enclosing class:
AbstractSnapshotter
Abstract Builder class to instantiate
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioneventStore(EventStore eventStore) Sets theEventStoreinstance which thisAbstractSnapshotterimplementation will store snapshots in.Sets theExecutorwhich handles the actual snapshot creation process.spanFactory(SnapshotterSpanFactory spanFactory) Sets theSnapshotterSpanFactoryimplementation to use for providing tracing capabilities.spanFactory(SpanFactory spanFactory) Deprecated.transactionManager(TransactionManager transactionManager) Sets theTransactionManagerused to manage the transaction around storing the snapshot.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
eventStore
Sets theEventStoreinstance which thisAbstractSnapshotterimplementation will store snapshots in.- Parameters:
eventStore- theEventStoreinstance which thisAbstractSnapshotterimplementation will store snapshots in- Returns:
- the current Builder instance, for fluent interfacing
-
executor
Sets theExecutorwhich handles the actual snapshot creation process. Defaults to aDirectExecutor.- Parameters:
executor- anExecutorwhich handles the actual snapshot creation process- Returns:
- the current Builder instance, for fluent interfacing
-
spanFactory
Deprecated.UsespanFactory(SnapshotterSpanFactory)instead as it provides more configurability.Sets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation.- Returns:
- The current Builder instance, for fluent interfacing.
-
spanFactory
Sets theSnapshotterSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aDefaultSnapshotterSpanFactorywith aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation.- Returns:
- The current Builder instance, for fluent interfacing.
-
transactionManager
Sets theTransactionManagerused to manage the transaction around storing the snapshot. Defaults to aNoTransactionManager.- Parameters:
transactionManager- theTransactionManagerused to manage the transaction around storing the snapshot- Returns:
- the current Builder instance, for fluent interfacing
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-
spanFactory(SnapshotterSpanFactory)instead as it provides more configurability.