Class AbstractEventStorageEngine.Builder
java.lang.Object
org.axonframework.eventsourcing.eventstore.AbstractEventStorageEngine.Builder
- Direct Known Subclasses:
BatchingEventStorageEngine.Builder
- Enclosing class:
AbstractEventStorageEngine
Abstract Builder class to instantiate an
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioneventSerializer(Serializer eventSerializer) Sets theSerializerused to serialize and deserialize the Event Message's payload andMetaDatawith.persistenceExceptionResolver(PersistenceExceptionResolver persistenceExceptionResolver) Sets thePersistenceExceptionResolverused to detect concurrency exceptions from the backing database.snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) Deprecated.snapshotFilter(SnapshotFilter snapshotFilter) Sets thesnapshotFilterdeciding whether to take a snapshot into account.snapshotSerializer(Serializer snapshotSerializer) Sets theSerializerused to serialize and deserialize snapshots.upcasterChain(EventUpcaster upcasterChain) Sets theEventUpcasterused to deserialize events of older revisions.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Field Details
-
upcasterChain
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
snapshotSerializer
Sets theSerializerused to serialize and deserialize snapshots.- Parameters:
snapshotSerializer- aSerializerused to serialize and deserialize snapshots- Returns:
- the current Builder instance, for fluent interfacing
-
upcasterChain
Sets theEventUpcasterused to deserialize events of older revisions. Defaults to aNoOpEventUpcaster.- Parameters:
upcasterChain- anEventUpcasterused to deserialize events of older revisions- Returns:
- the current Builder instance, for fluent interfacing
-
persistenceExceptionResolver
public AbstractEventStorageEngine.Builder persistenceExceptionResolver(PersistenceExceptionResolver persistenceExceptionResolver) Sets thePersistenceExceptionResolverused to detect concurrency exceptions from the backing database. If thepersistenceExceptionResolveris not specified, persistence exceptions are not explicitly resolved.- Parameters:
persistenceExceptionResolver- thePersistenceExceptionResolverused to detect concurrency exceptions from the backing database- Returns:
- the current Builder instance, for fluent interfacing
-
eventSerializer
Sets theSerializerused to serialize and deserialize the Event Message's payload andMetaDatawith.- Parameters:
eventSerializer- The serializer to serialize the Event Message's payload andMetaDatawith- Returns:
- the current Builder instance, for fluent interfacing
-
snapshotFilter
@Deprecated public AbstractEventStorageEngine.Builder snapshotFilter(Predicate<? super DomainEventData<?>> snapshotFilter) Deprecated.in favor ofsnapshotFilter(SnapshotFilter)Sets thesnapshotFilterdeciding whether to take a snapshot into account. Can be set to filter out specific snapshot revisions which should not be applied. Defaults to aPredicatewhich returnstrueregardless.- Parameters:
snapshotFilter- aPredicatewhich decides whether to take a snapshot into account- Returns:
- the current Builder instance, for fluent interfacing
-
snapshotFilter
Sets thesnapshotFilterdeciding whether to take a snapshot into account. Can be set to filter out specific snapshot revisions which should not be applied. Defaults toSnapshotFilter.allowAll().Note that
SnapshotFilterinstances can be combined and should returntrueif they handle a snapshot they wish to ignore.- Parameters:
snapshotFilter- aSnapshotFilterwhich decides whether to take a snapshot into account- Returns:
- the current Builder instance, for fluent interfacing
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-
snapshotFilter(SnapshotFilter)