public interface ConflictResolver
ConflictingModificationException
(or subtype) is thrown.Modifier and Type | Method and Description |
---|---|
default void |
detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate)
Resolve conflicts between changes to be applied to the aggregate and unseen changes made to the aggregate.
|
default <T extends Exception> |
detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate,
ConflictExceptionSupplier<T> exceptionSupplier)
Resolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.
|
<T extends Exception> |
detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate,
ContextAwareConflictExceptionSupplier<T> exceptionSupplier)
Resolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.
|
default <T extends Exception> void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ConflictExceptionSupplier<T> exceptionSupplier) throws T extends Exception
Conflicts are detected using the given predicate
. If the Predicate.test(Object)
method
returns 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 true
if there is a conflict.exceptionSupplier
- exception to throw when a conflict is detectedT
- The type of exception to throw when conflicts are detectedT extends Exception
default void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate)
Conflicts are detected using the given predicate
. If the Predicate.test(Object)
method
returns true
a conflict is registered. If a conflict is registered an instance of ConflictingModificationException
(or subtype) without cause is thrown immediately.
predicate
- test for conflicting unseen changes. Returns true
if there is a conflict.<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 Predicate.test(Object)
method
returns 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 true
if there is a conflict.exceptionSupplier
- exception to throw when a conflict is detectedT
- The type of exception to throw when conflicts are detectedT extends Exception
Copyright © 2010–2024. All rights reserved.