Enum Class EventPublicationStrategy
- All Implemented Interfaces:
Serializable, Comparable<EventPublicationStrategy>, Constable
@Apply methods)
are handled in terms of event storage, event publication, and model or aggregate state updates.
This strategy determines whether an update is published to the global event log, linked to the target model streams
or legacy aggregate event store, and whether its apply result may advance document-backed state. It can be
configured on a Model, a legacy Aggregate, or an individual update.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionInherit the strategy from the enclosing model, legacy aggregate, or global default.Publish the update to the global event log but do not store it in the target model stream or legacy aggregate event store.Store the applied update in every targeted model stream or the legacy aggregate event store, publish it to the global event log, and advance the resulting state.Store the applied update in every targeted model stream or the legacy aggregate event store and advance state, but do not publish it to the global event log. -
Method Summary
Modifier and TypeMethodDescriptionstatic EventPublicationStrategyReturns the enum constant of this class with the specified name.static EventPublicationStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Inherit the strategy from the enclosing model, legacy aggregate, or global default.If not configured anywhere, the fallback is
STORE_AND_PUBLISH. -
STORE_AND_PUBLISH
Store the applied update in every targeted model stream or the legacy aggregate event store, publish it to the global event log, and advance the resulting state.This is the default behavior used for event-sourced models and aggregates.
-
STORE_ONLY
Store the applied update in every targeted model stream or the legacy aggregate event store and advance state, but do not publish it to the global event log.Useful when updates must be persisted but should not trigger side effects or listeners.
-
PUBLISH_ONLY
Publish the update to the global event log but do not store it in the target model stream or legacy aggregate event store.A state-changing event-sourced Model rejects this strategy before commit because its next reconstruction could not reproduce the state. A publish-only no-op remains valid. Document-backed Models and non-event-sourced legacy aggregates may still advance their directly stored current state.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-