Class AxonServerEventStore.Builder
- Enclosing class:
AxonServerEventStore
AxonServerEventStore.
The main goal of this Builder is to instantiate an AxonServer specific EventStorageEngine. The properties
which may be provided through this Builder are thus all used to end up with that EventStorageEngine
implementation. An EventStorageEngine may be provided directly however, although we encourage the usage of the
configuration and axonServerConnectionManager functions to let it be created.
The EventUpcaster is defaulted to a NoOpEventUpcaster. The MessageMonitor is defaulted to
an NoOpMessageMonitor and the EventBusSpanFactory defaults to a
DefaultEventBusSpanFactory backed by a NoOpSpanFactory.
The event and snapshot Serializer, AxonServerConfiguration and
AxonServerConnectionManager are hard requirements if no EventStorageEngine is provided directly.
-
Field Summary
Fields inherited from class org.axonframework.eventsourcing.eventstore.AbstractEventStore.Builder
storageEngine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aAxonServerEventStoreas specified through this Builder.configuration(AxonServerConfiguration configuration) Sets theAxonServerConfigurationdescribing the servers to connect with and how to manage flow control.defaultContext(String defaultContext) Sets the default context for this event store to connect to.eventSerializer(Serializer eventSerializer) Sets theSerializerused to serialize and deserialize the Event Message's payload and Meta Data with.messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor) Sets theMessageMonitorto monitor ingestedEventMessages.platformConnectionManager(AxonServerConnectionManager axonServerConnectionManager) Sets theAxonServerConnectionManagermanaging the connections to the AxonServer platform.snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) Deprecated.snapshotFilter(SnapshotFilter snapshotFilter) Sets theSnapshotFilterused to filter snapshots when returning aggregate events.snapshotSerializer(Serializer snapshotSerializer) Sets theSerializerused to serialize and deserialize snapshots.spanFactory(EventBusSpanFactory spanFactory) Sets theSpanFactoryimplementation to use for providing tracing capabilities.spanFactory(SpanFactory spanFactory) Sets theSpanFactoryimplementation to use for providing tracing capabilities.storageEngine(EventStorageEngine storageEngine) Sets theEventStorageEngineused to store and load events.upcasterChain(EventUpcaster upcasterChain) Sets theEventUpcasterused to deserialize events of older revisions.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
storageEngine
Description copied from class:AbstractEventStore.BuilderSets theEventStorageEngineused to store and load events.- Overrides:
storageEnginein classAbstractEventStore.Builder- Parameters:
storageEngine- theEventStorageEngineused to store and load events- Returns:
- the current Builder instance, for fluent interfacing
-
messageMonitor
public AxonServerEventStore.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor) Description copied from class:AbstractEventBus.Builder- Overrides:
messageMonitorin classAbstractEventStore.Builder- Parameters:
messageMonitor- aMessageMonitorto monitor ingestedEventMessages- Returns:
- the current Builder instance, for fluent interfacing
-
spanFactory
Description copied from class:AbstractEventBus.BuilderSets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aNoOpSpanFactoryby default, which provides no tracing capabilities.- Overrides:
spanFactoryin classAbstractEventBus.Builder- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
spanFactory
Description copied from class:AbstractEventBus.BuilderSets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aDefaultEventBusSpanFactorybacked by aNoOpSpanFactoryby default, which provides no tracing capabilities.- Overrides:
spanFactoryin classAbstractEventBus.Builder- Parameters:
spanFactory- TheEventBusSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
configuration
Sets theAxonServerConfigurationdescribing the servers to connect with and how to manage flow control.This object is used by the AxonServer
EventStorageEngineimplementation which this Builder will create if it is not provided. We suggest to use these, instead of theAbstractEventStore.storageEngine()function to set the EventStorageEngine.- Parameters:
configuration- theAxonServerConfigurationdescribing the servers to connect with and how to manage flow control- Returns:
- the current Builder instance, for fluent interfacing
-
platformConnectionManager
public AxonServerEventStore.Builder platformConnectionManager(AxonServerConnectionManager axonServerConnectionManager) Sets theAxonServerConnectionManagermanaging the connections to the AxonServer platform.This object is used by the AxonServer
EventStorageEngineimplementation which this Builder will create if it is not provided. We suggest to use these, instead of theAbstractEventStore.storageEngine()function to set the EventStorageEngine.- Parameters:
axonServerConnectionManager- theAxonServerConnectionManagermanaging the connections to the AxonServer platform- Returns:
- the current Builder instance, for fluent interfacing
-
snapshotSerializer
Sets theSerializerused to serialize and deserialize snapshots. Defaults to aXStreamSerializer.This object is used by the AxonServer
EventStorageEngineimplementation which this Builder will create if it is not provided. We suggest to use these, instead of theAbstractEventStore.storageEngine()function to set the EventStorageEngine.- Parameters:
snapshotSerializer- aSerializerused to serialize and deserialize snapshots- Returns:
- the current Builder instance, for fluent interfacing
-
eventSerializer
Sets theSerializerused to serialize and deserialize the Event Message's payload and Meta Data with. Defaults to aXStreamSerializer.This object is used by the AxonServer
EventStorageEngineimplementation which this Builder will create if it is not provided. We suggest to use these, instead of theAbstractEventStore.storageEngine()function to set the EventStorageEngine.- Parameters:
eventSerializer- The serializer to serialize the Event Message's payload and Meta Data with- Returns:
- the current Builder instance, for fluent interfacing
-
defaultContext
Sets the default context for this event store to connect to.- Parameters:
defaultContext- for this event store to connect to.- Returns:
- the current Builder instance, for fluent interfacing
-
snapshotFilter
@Deprecated public AxonServerEventStore.Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) Deprecated.in favor ofsnapshotFilter(SnapshotFilter)Sets thePredicateused to filter snapshots when returning aggregate events. When not set all snapshots are used.This object is used by the AxonServer
EventStorageEngineimplementation.- Parameters:
snapshotFilter- The snapshot filter predicate- Returns:
- the current Builder instance, for fluent interfacing
-
snapshotFilter
Sets theSnapshotFilterused to filter snapshots when returning aggregate events. When not set all snapshots are used. Note thatSnapshotFilterinstances can be combined and should returntrueif they handle a snapshot they wish to ignore.This object is used by the AxonServer
EventStorageEngineimplementation.- Parameters:
snapshotFilter- theSnapshotFilterto use- Returns:
- the current Builder instance, for fluent interfacing
-
upcasterChain
Sets theEventUpcasterused to deserialize events of older revisions. Defaults to aNoOpEventUpcaster.This object is used by the AxonServer
EventStorageEngineimplementation which this Builder will create if it is not provided. We suggest to use these, instead of theAbstractEventStore.storageEngine()function to set the EventStorageEngine.- Parameters:
upcasterChain- anEventUpcasterused to deserialize events of older revisions- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aAxonServerEventStoreas specified through this Builder.- Returns:
- a
AxonServerEventStoreas specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Overrides:
validatein classAbstractEventStore.Builder- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-
snapshotFilter(SnapshotFilter)