Enum Class EventPublication
- All Implemented Interfaces:
Serializable
,Comparable<EventPublication>
,Constable
Controls whether an applied update should result in event publication.
This setting can be defined at the aggregate level (via Aggregate
) and optionally overridden on specific
@Apply
methods.
Event publication occurs when an update is applied to an entity. Depending on this setting and the configured
EventPublicationStrategy
, the update may be published and/or stored.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlways publish and/or store the applied update, even if it does not change the entity.Inherit the publication behavior from the parent context.Only publish or store the update if the entity's state is actually modified by the application.Never publish or store applied updates. -
Method Summary
Modifier and TypeMethodDescriptionstatic EventPublication
Returns the enum constant of this class with the specified name.static EventPublication[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Inherit the publication behavior from the parent context.This may be the enclosing aggregate or the application-level default. If not explicitly configured elsewhere,
ALWAYS
is used as a fallback. -
ALWAYS
Always publish and/or store the applied update, even if it does not change the entity.This is the default behavior if no other setting is specified.
-
NEVER
Never publish or store applied updates.Useful for aggregates where event sourcing is disabled or updates should remain private.
-
IF_MODIFIED
Only publish or store the update if the entity's state is actually modified by the application.This avoids unnecessary event traffic and eliminates the need for
InterceptApply
methods that suppress no-op updates.
-
-
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
-