Class ModifiableAggregateRoot<T>
java.lang.Object
io.fluxcapacitor.javaclient.modeling.DelegatingEntity<T>
io.fluxcapacitor.javaclient.modeling.ModifiableAggregateRoot<T>
- All Implemented Interfaces:
AggregateRoot<T>,Entity<T>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.fluxcapacitor.javaclient.modeling.Entity
Entity.Validator<T,E extends Exception> -
Field Summary
Fields inherited from class io.fluxcapacitor.javaclient.modeling.DelegatingEntity
delegateFields inherited from interface io.fluxcapacitor.javaclient.modeling.Entity
AGGREGATE_ID_METADATA_KEY, AGGREGATE_SN_METADATA_KEY, AGGREGATE_TYPE_METADATA_KEY, loading -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModifiableAggregateRoot(Entity<T> delegate, boolean commitInBatch, EventPublication eventPublication, EntityHelper entityHelper, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) -
Method Summary
Modifier and TypeMethodDescriptionassertAndApply(Object payloadOrMessage) assertLegal(Object command) protected voidcommit()Collection<? extends Entity<?>>entities()getActiveAggregatesFor(@NonNull Object entityId) static <T> Optional<ModifiableAggregateRoot<T>>getIfActive(Object aggregateId) protected voidhandleUpdate(UnaryOperator<Entity<T>> update) static <T> Entity<T>load(Object aggregateId, Supplier<Entity<T>> loader, boolean commitInBatch, EventPublication eventPublication, EntityHelper entityHelper, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) previous()update(UnaryOperator<T> function) protected voidwhenHandlerCompletes(Throwable error) Methods inherited from class io.fluxcapacitor.javaclient.modeling.DelegatingEntity
aliases, get, id, idProperty, lastEventId, lastEventIndex, parent, sequenceNumber, timestamp, type, withEventIndex, withSequenceNumber, withTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxcapacitor.javaclient.modeling.AggregateRoot
lastEventId, lastEventIndex, parent, sequenceNumber, timestamp, withEventIndex, withSequenceNumberMethods inherited from interface io.fluxcapacitor.javaclient.modeling.Entity
aliases, allEntities, ancestorValue, apply, apply, apply, apply, apply, assertAndApply, assertAndApply, assertAndApply, assertThat, associations, dissociations, ensure, get, getEntity, highestEventIndex, id, idProperty, ifPresent, isEmpty, isPresent, isRoot, mapIfPresent, playBackToCondition, playBackToEvent, possibleTargets, relationships, root, rootAnnotation, type, withType
-
Constructor Details
-
ModifiableAggregateRoot
protected ModifiableAggregateRoot(Entity<T> delegate, boolean commitInBatch, EventPublication eventPublication, EntityHelper entityHelper, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler)
-
-
Method Details
-
getIfActive
-
getActiveAggregatesFor
-
load
public static <T> Entity<T> load(Object aggregateId, Supplier<Entity<T>> loader, boolean commitInBatch, EventPublication eventPublication, EntityHelper entityHelper, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) -
assertLegal
- Specified by:
assertLegalin interfaceEntity<T>- Throws:
E extends Exception
-
assertAndApply
- Specified by:
assertAndApplyin interfaceEntity<T>
-
apply
-
apply
-
update
-
entities
-
previous
- Specified by:
previousin interfaceAggregateRoot<T>- Specified by:
previousin interfaceEntity<T>- Overrides:
previousin classDelegatingEntity<T>
-
handleUpdate
-
whenHandlerCompletes
-
commit
protected void commit()
-