|Constructor and Description|
|Modifier and Type||Method and Description|
Resolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DefaultConflictResolver(EventStore eventStore, String aggregateIdentifier, long expectedVersion, long actualVersion)
DefaultConflictResolverusing the given
eventStoreto load unseen events since given
eventStore- the event store to load unseen events
aggregateIdentifier- the identifier of the event sourced aggregate that is being modified
expectedVersion- the last seen version (sequence number) of the aggregate
actualVersion- the actual version (sequence number) of the aggregate
public <T extends Exception> void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ContextAwareConflictExceptionSupplier<T> exceptionSupplier) throws T extends Exception
Conflicts are detected using the given
predicate. If the
true a conflict is registered. If a conflict is registered an instance of
ConflictingModificationException (or subtype) is thrown immediately. The cause of the exception is supplied
by the given
causeSupplier (supplying a
null cause is allowed).
predicate- test for conflicting unseen changes. Returns
trueif there is a conflict.
exceptionSupplier- exception to throw when a conflict is detected
T- The type of exception to throw when conflicts are detected
T extends Exception
public void ensureConflictsResolved()
detectConflicts(java.util.function.Predicate<java.util.List<org.axonframework.eventhandling.DomainEventMessage<?>>>, org.axonframework.eventsourcing.conflictresolution.ContextAwareConflictExceptionSupplier<T>)). If not, an instance of
ConflictingModificationException(or subtype) should be thrown if there have been any unseen changes.
Copyright © 2010–2021. All rights reserved.