Class ModifiableAggregateRoot<T>
java.lang.Object
io.fluxcapacitor.javaclient.modeling.DelegatingAggregateRoot<T,ImmutableAggregateRoot<T>>
io.fluxcapacitor.javaclient.modeling.ModifiableAggregateRoot<T>
- All Implemented Interfaces:
AggregateRoot<T>,Entity<AggregateRoot<T>,T>
public class ModifiableAggregateRoot<T>
extends DelegatingAggregateRoot<T,ImmutableAggregateRoot<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.DelegatingAggregateRoot
delegateFields inherited from interface io.fluxcapacitor.javaclient.modeling.AggregateRoot
AGGREGATE_ID_METADATA_KEY, AGGREGATE_TYPE_METADATA_KEY, loading -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModifiableAggregateRoot(ImmutableAggregateRoot<T> delegate, boolean commitInBatch, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcommit()Collection<? extends Entity<?,?>> entities()static <T> Optional<ModifiableAggregateRoot<T>>getIfActive(String aggregateId) protected voidhandleUpdate(UnaryOperator<ImmutableAggregateRoot<T>> update) static <T> ModifiableAggregateRoot<T>load(String aggregateId, Supplier<ImmutableAggregateRoot<T>> loader, boolean commitInBatch, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) update(UnaryOperator<T> function) protected voidwhenHandlerCompletes(Throwable error) Methods inherited from class io.fluxcapacitor.javaclient.modeling.DelegatingAggregateRoot
get, id, idProperty, lastEventId, lastEventIndex, previous, sequenceNumber, timestamp, typeMethods 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
associations, dissociations, makeReadOnly, parent, playBackToCondition, playBackToEvent, relationshipsMethods inherited from interface io.fluxcapacitor.javaclient.modeling.Entity
allEntities, apply, apply, apply, apply, assertAndApply, assertAndApply, assertLegal, assertThat, ensure, getEntity, possibleTargets, root
-
Constructor Details
-
ModifiableAggregateRoot
protected ModifiableAggregateRoot(ImmutableAggregateRoot<T> delegate, boolean commitInBatch, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler)
-
-
Method Details
-
getIfActive
-
load
public static <T> ModifiableAggregateRoot<T> load(String aggregateId, Supplier<ImmutableAggregateRoot<T>> loader, boolean commitInBatch, Serializer serializer, DispatchInterceptor dispatchInterceptor, ModifiableAggregateRoot.CommitHandler commitHandler) -
apply
-
update
-
entities
- Specified by:
entitiesin interfaceEntity<AggregateRoot<T>,T> - Overrides:
entitiesin classDelegatingAggregateRoot<T,ImmutableAggregateRoot<T>>
-
handleUpdate
-
whenHandlerCompletes
-
commit
protected void commit()
-