Interface EventSourcedEntityModule.OptionalPhase<ID,E>
- Type Parameters:
ID- The type of identifier used to identify the event-sourced entity.E- The type of the event-sourced entity being built.
- All Superinterfaces:
ModuleBuilder<EventSourcedEntityModule<ID,E>>
- Enclosing interface:
EventSourcedEntityModule<ID,E>
public static interface EventSourcedEntityModule.OptionalPhase<ID,E>
extends ModuleBuilder<EventSourcedEntityModule<ID,E>>
Phase of the module's building process in which optional parameters can be provided.
-
Method Summary
Modifier and TypeMethodDescriptionentityIdResolver(ComponentBuilder<EntityIdResolver<ID>> entityIdResolver) Registers an optionalComponentBuilderof anEntityIdResolveras the resolver for the event-sourced entity being built.snapshotPolicy(ComponentBuilder<SnapshotPolicy> snapshotPolicy) Registers an optionalComponentBuilderof aSnapshotPolicyfor the event-sourced entity being built.Methods inherited from interface org.axonframework.common.configuration.ModuleBuilder
build
-
Method Details
-
entityIdResolver
EventSourcedEntityModule.OptionalPhase<ID,E> entityIdResolver(ComponentBuilder<EntityIdResolver<ID>> entityIdResolver) Registers an optionalComponentBuilderof anEntityIdResolveras the resolver for the event-sourced entity being built. This resolver is responsible for resolving the identifier of the event-sourced entity being built.If no
EntityIdResolveris provided, no command handling component will be registered, but the entity will still be registered to theStateManagerso it can be loaded in stateful command handlers.- Parameters:
entityIdResolver- AComponentBuilderconstructing theEntityIdResolverfor the event-sourced entity.- Returns:
- The
EventSourcedEntityModule.OptionalPhasephase of this builder, for a fluent API.
-
snapshotPolicy
EventSourcedEntityModule.OptionalPhase<ID,E> snapshotPolicy(ComponentBuilder<SnapshotPolicy> snapshotPolicy) Registers an optionalComponentBuilderof aSnapshotPolicyfor the event-sourced entity being built. The snapshot policy determines under which conditions the entity state should be snapshotted during sourcing.- Parameters:
snapshotPolicy- AComponentBuilderconstructing theSnapshotPolicyfor the event-sourced entity.- Returns:
- The
EventSourcedEntityModule.OptionalPhasephase of this builder, for a fluent API.
-