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 snapshot Serializer
is defaulted to a XStreamSerializer
, the event Serializer also defaults
to a XStreamSerializer and the EventUpcaster
defaults to a NoOpEventUpcaster
.
The 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 |
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)
Sets the
Predicate used to filter snapshots when returning aggregate events. |
AxonServerEventStore.Builder |
snapshotSerializer(Serializer snapshotSerializer)
Sets the
Serializer used to serialize and deserialize snapshots. |
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(MessageMonitor<? super EventMessage<?>> messageMonitor)
AbstractEventBus.Builder
messageMonitor
in class AbstractEventStore.Builder
messageMonitor
- a MessageMonitor
to monitor ingested EventMessage
spublic 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 snapshotFilter(Predicate<? super DomainEventData<?>> 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 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–2020. All rights reserved.