public static class AxonServerEventStoreFactory.Builder extends Object
AxonServerEventStoreFactory
.
The following fields have sensible defaults:
snapshot serializer
defaults to a XStreamSerializer
.event serializer
defaults to a XStreamSerializer
.upcaster chain
defaults to a NoOpEventUpcaster
.message monitor
defaults to a NoOpMessageMonitor
.span factory
defaults to a DefaultEventBusSpanFactory
using a NoOpSpanFactory
.AxonServerConfiguration
, AxonServerConnectionManager
, and SnapshotFilter
are hard
requirements and as such should be provided.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AxonServerEventStoreFactory |
build()
Initializes an
AxonServerEventStoreFactory as specified through this builder. |
AxonServerEventStoreFactory.Builder |
configuration(AxonServerConfiguration configuration)
Sets the
AxonServerConfiguration describing the servers to connect with and how to manage flow
control. |
AxonServerEventStoreFactory.Builder |
connectionManager(AxonServerConnectionManager connectionManager)
Sets the
AxonServerConnectionManager managing the connections to Axon Server. |
AxonServerEventStoreFactory.Builder |
eventSerializer(Serializer eventSerializer)
|
AxonServerEventStoreFactory.Builder |
messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor)
Sets the
MessageMonitor to monitor ingested EventMessages . |
AxonServerEventStoreFactory.Builder |
snapshotFilter(SnapshotFilter snapshotFilter)
Sets the
SnapshotFilter used to filter snapshots when returning aggregate events. |
AxonServerEventStoreFactory.Builder |
snapshotSerializer(Serializer snapshotSerializer)
Sets the
Serializer used to serialize and deserialize snapshots. |
AxonServerEventStoreFactory.Builder |
spanFactory(EventBusSpanFactory spanFactory)
Sets the
EventBusSpanFactory implementation used for providing tracing capabilities. |
AxonServerEventStoreFactory.Builder |
upcasterChain(EventUpcaster upcasterChain)
Sets the
upcaster ch ain used to deserialize events of older revisions. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public AxonServerEventStoreFactory.Builder configuration(@Nonnull AxonServerConfiguration configuration)
AxonServerConfiguration
describing the servers to connect with and how to manage flow
control.
This object is used by the Axon Server event store's
EventStorageEngine
implementation.
configuration
- The AxonServerConfiguration
describing the servers to connect with and how to
manage flow control.public AxonServerEventStoreFactory.Builder connectionManager(@Nonnull AxonServerConnectionManager connectionManager)
AxonServerConnectionManager
managing the connections to Axon Server.
This object is used by the Axon Server event store's
EventStorageEngine
implementation.
connectionManager
- The AxonServerConnectionManager
managing the connections to Axon Server.public AxonServerEventStoreFactory.Builder snapshotSerializer(@Nonnull Serializer snapshotSerializer)
Serializer
used to serialize and deserialize snapshots.
Defaults to a XStreamSerializer
.
This object is used by the Axon Server event store's
EventStorageEngine
implementation.
snapshotSerializer
- The Serializer
used to de-/serialize snapshot events.public AxonServerEventStoreFactory.Builder eventSerializer(@Nonnull Serializer eventSerializer)
Serializer
used to de-/serialize the event payload
and
meta data
with.
Defaults to a XStreamSerializer
.
This object is used by the Axon Server event store's
EventStorageEngine
implementation.
eventSerializer
- The serializer to de-/serialize the event payload
and meta data
with.public AxonServerEventStoreFactory.Builder snapshotFilter(@Nonnull 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 Axon Server event store's
EventStorageEngine
implementation.
snapshotFilter
- The SnapshotFilter
used to filter snapshots when returning aggregate events.public AxonServerEventStoreFactory.Builder upcasterChain(@Nonnull EventUpcaster upcasterChain)
upcaster ch ain
used to deserialize events of older revisions.
Defaults to a NoOpEventUpcaster
.
This object is used by the Axon Server event store's
EventStorageEngine
implementation.
upcasterChain
- An EventUpcaster
used to deserialize events of older revisions.public AxonServerEventStoreFactory.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor)
messageMonitor
- A MessageMonitor
to monitor ingested EventMessages
.public AxonServerEventStoreFactory.Builder spanFactory(@Nonnull EventBusSpanFactory spanFactory)
EventBusSpanFactory
implementation used for providing tracing capabilities.
Defaults to a DefaultEventBusSpanFactory
using a NoOpSpanFactory
, providing no tracing
capabilities.
spanFactory
- The SpanFactory
implementation used for providing tracing capabilities.public AxonServerEventStoreFactory build()
AxonServerEventStoreFactory
as specified through this builder.AxonServerEventStoreFactory
as specified through this builder.protected void validate()
AxonConfigurationException
- If one field is asserted to be incorrect according to the builder's
specifications.Copyright © 2010–2024. All rights reserved.