public static class AxonServerEventStore.Builder extends AbstractEventStore.Builder
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.
storageEngine| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AxonServerEventStore |
build()
Initializes a
AxonServerEventStore as specified through this Builder. |
AxonServerEventStore.Builder |
configuration(AxonServerConfiguration configuration)
Sets the
AxonServerConfiguration describing the servers to connect with and how to manage flow
control. |
AxonServerEventStore.Builder |
defaultContext(String defaultContext)
Sets the default context for this event store to connect to.
|
AxonServerEventStore.Builder |
eventSerializer(Serializer eventSerializer)
Sets the
Serializer used to serialize and deserialize the Event Message's payload and Meta Data with. |
AxonServerEventStore.Builder |
messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor)
Sets the
MessageMonitor to monitor ingested EventMessages. |
AxonServerEventStore.Builder |
platformConnectionManager(AxonServerConnectionManager axonServerConnectionManager)
Sets the
AxonServerConnectionManager managing the connections to the AxonServer platform. |
AxonServerEventStore.Builder |
snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter)
Deprecated.
in favor of
snapshotFilter(SnapshotFilter) |
AxonServerEventStore.Builder |
snapshotFilter(SnapshotFilter snapshotFilter)
Sets the
SnapshotFilter used to filter snapshots when returning aggregate events. |
AxonServerEventStore.Builder |
snapshotSerializer(Serializer snapshotSerializer)
Sets the
Serializer used to serialize and deserialize snapshots. |
AxonServerEventStore.Builder |
spanFactory(EventBusSpanFactory spanFactory)
Sets the
SpanFactory implementation to use for providing tracing capabilities. |
AxonServerEventStore.Builder |
spanFactory(SpanFactory spanFactory)
Sets the
SpanFactory implementation to use for providing tracing capabilities. |
AxonServerEventStore.Builder |
storageEngine(EventStorageEngine storageEngine)
Sets the
EventStorageEngine used to store and load events. |
AxonServerEventStore.Builder |
upcasterChain(EventUpcaster upcasterChain)
Sets the
EventUpcaster used to deserialize events of older revisions. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public AxonServerEventStore.Builder storageEngine(EventStorageEngine storageEngine)
AbstractEventStore.BuilderEventStorageEngine used to store and load events.storageEngine in class AbstractEventStore.BuilderstorageEngine - the EventStorageEngine used to store and load eventspublic AxonServerEventStore.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor)
AbstractEventBus.BuildermessageMonitor in class AbstractEventStore.BuildermessageMonitor - a MessageMonitor to monitor ingested EventMessagespublic AxonServerEventStore.Builder spanFactory(@Nonnull SpanFactory spanFactory)
AbstractEventBus.BuilderSpanFactory implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory by default, which provides no tracing capabilities.spanFactory in class AbstractEventBus.BuilderspanFactory - The SpanFactory implementationpublic AxonServerEventStore.Builder spanFactory(@Nonnull EventBusSpanFactory spanFactory)
AbstractEventBus.BuilderSpanFactory implementation to use for providing tracing capabilities. Defaults to a
DefaultEventBusSpanFactory backed by a NoOpSpanFactory by default, which provides no tracing capabilities.spanFactory in class AbstractEventBus.BuilderspanFactory - The EventBusSpanFactory implementationpublic AxonServerEventStore.Builder configuration(AxonServerConfiguration configuration)
AxonServerConfiguration describing the servers to connect with and how to manage flow
control.
This object is used by the AxonServer EventStorageEngine implementation which this Builder will
create if it is not provided. We suggest to use these, instead of the AbstractEventStore.storageEngine()
function to set the EventStorageEngine.
configuration - the AxonServerConfiguration describing the servers to connect with and how to
manage flow controlpublic AxonServerEventStore.Builder platformConnectionManager(AxonServerConnectionManager axonServerConnectionManager)
AxonServerConnectionManager managing the connections to the AxonServer platform.
This object is used by the AxonServer EventStorageEngine implementation which this Builder will
create if it is not provided. We suggest to use these, instead of the AbstractEventStore.storageEngine()
function to set the EventStorageEngine.
axonServerConnectionManager - the AxonServerConnectionManager managing the connections to the
AxonServer platformpublic AxonServerEventStore.Builder snapshotSerializer(Serializer snapshotSerializer)
Serializer used to serialize and deserialize snapshots. Defaults to a XStreamSerializer.
This object is used by the AxonServer EventStorageEngine implementation which this Builder will
create if it is not provided. We suggest to use these, instead of the AbstractEventStore.storageEngine()
function to set the EventStorageEngine.
snapshotSerializer - a Serializer used to serialize and deserialize snapshotspublic AxonServerEventStore.Builder eventSerializer(Serializer eventSerializer)
Serializer used to serialize and deserialize the Event Message's payload and Meta Data with.
Defaults to a XStreamSerializer.
This object is used by the AxonServer EventStorageEngine implementation which this Builder will
create if it is not provided. We suggest to use these, instead of the AbstractEventStore.storageEngine()
function to set the EventStorageEngine.
eventSerializer - The serializer to serialize the Event Message's payload and Meta Data withpublic AxonServerEventStore.Builder defaultContext(String defaultContext)
defaultContext - for this event store to connect to.@Deprecated public AxonServerEventStore.Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter)
snapshotFilter(SnapshotFilter)Predicate used to filter snapshots when returning aggregate events. When not set all
snapshots are used.
This object is used by the AxonServer EventStorageEngine implementation.
snapshotFilter - The snapshot filter predicatepublic AxonServerEventStore.Builder snapshotFilter(SnapshotFilter snapshotFilter)
SnapshotFilter used to filter snapshots when returning aggregate events. When not set all
snapshots are used. Note that SnapshotFilter instances can be combined and should return true
if they handle a snapshot they wish to ignore.
This object is used by the AxonServer EventStorageEngine implementation.
snapshotFilter - the SnapshotFilter to usepublic AxonServerEventStore.Builder upcasterChain(EventUpcaster upcasterChain)
EventUpcaster used to deserialize events of older revisions. Defaults to a NoOpEventUpcaster.
This object is used by the AxonServer EventStorageEngine implementation which this Builder will
create if it is not provided. We suggest to use these, instead of the AbstractEventStore.storageEngine()
function to set the EventStorageEngine.
upcasterChain - an EventUpcaster used to deserialize events of older revisionspublic AxonServerEventStore build()
AxonServerEventStore as specified through this Builder.AxonServerEventStore as specified through this Builderprotected void validate()
throws AxonConfigurationException
validate in class AbstractEventStore.BuilderAxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2025. All rights reserved.