public static class AxonServerEventStore.Builder
extends org.axonframework.eventsourcing.eventstore.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.
| 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(org.axonframework.serialization.Serializer eventSerializer)
Sets the
Serializer used to serialize and deserialize the Event Message's payload and Meta Data with. |
AxonServerEventStore.Builder |
messageMonitor(org.axonframework.monitoring.MessageMonitor<? super org.axonframework.eventhandling.EventMessage<?>> messageMonitor) |
AxonServerEventStore.Builder |
platformConnectionManager(AxonServerConnectionManager axonServerConnectionManager)
Sets the
AxonServerConnectionManager managing the connections to the AxonServer platform. |
AxonServerEventStore.Builder |
snapshotFilter(Predicate<? super org.axonframework.eventhandling.DomainEventData<?>> snapshotFilter)
Deprecated.
in favor of
snapshotFilter(SnapshotFilter) |
AxonServerEventStore.Builder |
snapshotFilter(org.axonframework.eventsourcing.snapshotting.SnapshotFilter snapshotFilter)
Sets the
SnapshotFilter used to filter snapshots when returning aggregate events. |
AxonServerEventStore.Builder |
snapshotSerializer(org.axonframework.serialization.Serializer snapshotSerializer)
Sets the
Serializer used to serialize and deserialize snapshots. |
AxonServerEventStore.Builder |
storageEngine(org.axonframework.eventsourcing.eventstore.EventStorageEngine storageEngine) |
AxonServerEventStore.Builder |
upcasterChain(org.axonframework.serialization.upcasting.event.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(org.axonframework.eventsourcing.eventstore.EventStorageEngine storageEngine)
storageEngine in class org.axonframework.eventsourcing.eventstore.AbstractEventStore.Builderpublic AxonServerEventStore.Builder messageMonitor(org.axonframework.monitoring.MessageMonitor<? super org.axonframework.eventhandling.EventMessage<?>> messageMonitor)
messageMonitor in class org.axonframework.eventsourcing.eventstore.AbstractEventStore.Builderpublic 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(org.axonframework.serialization.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(org.axonframework.serialization.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 with@Deprecated public AxonServerEventStore.Builder snapshotFilter(Predicate<? super org.axonframework.eventhandling.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(org.axonframework.eventsourcing.snapshotting.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(org.axonframework.serialization.upcasting.event.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 org.axonframework.common.AxonConfigurationException
validate in class org.axonframework.eventsourcing.eventstore.AbstractEventStore.Builderorg.axonframework.common.AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2021. All rights reserved.