public abstract static class AbstractEventStorageEngine.Builder extends Object
AbstractEventStorageEngine.
The EventUpcaster defaults to a NoOpEventUpcaster and the snapshotFilter defaults to a
SnapshotFilter.allowAll() instance.
The event and snapshot Serializer are hard requirements and as such should be provided.
| Modifier and Type | Field and Description |
|---|---|
protected EventUpcaster |
upcasterChain |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AbstractEventStorageEngine.Builder |
eventSerializer(Serializer eventSerializer)
Sets the
Serializer used to serialize and deserialize the Event Message's payload and MetaData with. |
AbstractEventStorageEngine.Builder |
persistenceExceptionResolver(PersistenceExceptionResolver persistenceExceptionResolver)
Sets the
PersistenceExceptionResolver used to detect concurrency exceptions from the backing
database. |
AbstractEventStorageEngine.Builder |
snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter)
Deprecated.
in favor of
snapshotFilter(SnapshotFilter) |
AbstractEventStorageEngine.Builder |
snapshotFilter(SnapshotFilter snapshotFilter)
Sets the
snapshotFilter deciding whether to take a snapshot into account. |
AbstractEventStorageEngine.Builder |
snapshotSerializer(Serializer snapshotSerializer)
Sets the
Serializer used to serialize and deserialize snapshots. |
AbstractEventStorageEngine.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.
|
protected EventUpcaster upcasterChain
public AbstractEventStorageEngine.Builder snapshotSerializer(Serializer snapshotSerializer)
Serializer used to serialize and deserialize snapshots.snapshotSerializer - a Serializer used to serialize and deserialize snapshotspublic AbstractEventStorageEngine.Builder upcasterChain(EventUpcaster upcasterChain)
EventUpcaster used to deserialize events of older revisions. Defaults to a NoOpEventUpcaster.upcasterChain - an EventUpcaster used to deserialize events of older revisionspublic AbstractEventStorageEngine.Builder persistenceExceptionResolver(PersistenceExceptionResolver persistenceExceptionResolver)
PersistenceExceptionResolver used to detect concurrency exceptions from the backing
database. If the persistenceExceptionResolver is not specified, persistence exceptions are not
explicitly resolved.persistenceExceptionResolver - the PersistenceExceptionResolver used to detect concurrency
exceptions from the backing databasepublic AbstractEventStorageEngine.Builder eventSerializer(Serializer eventSerializer)
Serializer used to serialize and deserialize the Event Message's payload and MetaData with.eventSerializer - The serializer to serialize the Event Message's payload and MetaData with@Deprecated public AbstractEventStorageEngine.Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter)
snapshotFilter(SnapshotFilter)snapshotFilter deciding whether to take a snapshot into account. Can be set to filter out
specific snapshot revisions which should not be applied. Defaults to a Predicate which returns true regardless.snapshotFilter - a Predicate which decides whether to take a snapshot into accountpublic AbstractEventStorageEngine.Builder snapshotFilter(SnapshotFilter snapshotFilter)
snapshotFilter deciding whether to take a snapshot into account. Can be set to filter out
specific snapshot revisions which should not be applied. Defaults to SnapshotFilter.allowAll().
Note that SnapshotFilter instances can be combined and should return true if they handle a
snapshot they wish to ignore.
snapshotFilter - a SnapshotFilter which decides whether to take a snapshot into accountprotected void validate()
throws AxonConfigurationException
AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.