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 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 EventMessage s. |
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(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.Builder
EventStorageEngine
used to store and load events.storageEngine
in class AbstractEventStore.Builder
storageEngine
- the EventStorageEngine
used to store and load eventspublic AxonServerEventStore.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor)
AbstractEventBus.Builder
messageMonitor
in class AbstractEventStore.Builder
messageMonitor
- a MessageMonitor
to monitor ingested EventMessage
spublic AxonServerEventStore.Builder spanFactory(@Nonnull SpanFactory spanFactory)
AbstractEventBus.Builder
SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
in class AbstractEventBus.Builder
spanFactory
- The SpanFactory
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.Builder
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.