Enum Class EventPublicationStrategy

java.lang.Object
java.lang.Enum<EventPublicationStrategy>
io.fluxzero.sdk.modeling.EventPublicationStrategy
All Implemented Interfaces:
Serializable, Comparable<EventPublicationStrategy>, Constable

public enum EventPublicationStrategy extends Enum<EventPublicationStrategy>
Strategy for controlling how applied updates (typically from @Apply methods) are handled in terms of event storage, event publication, and aggregate state updates.

This strategy determines whether an update is published to the global event log, stored in the aggregate event store, and whether its apply result should advance the aggregate state in cache, snapshots, relationships, and search indexing. It can be configured at the aggregate level, or overridden per update.

See Also:
  • Enum Constant Details

    • DEFAULT

      public static final EventPublicationStrategy DEFAULT
      Inherit the strategy from the enclosing aggregate or global default.

      If not configured anywhere, the fallback is STORE_AND_PUBLISH.

    • STORE_AND_PUBLISH

      public static final EventPublicationStrategy STORE_AND_PUBLISH
      Store the applied update in the aggregate event store, publish it to the global event log, and update aggregate state.

      This is the default behavior used for event-sourced aggregates.

    • STORE_ONLY

      public static final EventPublicationStrategy STORE_ONLY
      Store the applied update in the aggregate event store and update aggregate 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

      public static final EventPublicationStrategy PUBLISH_ONLY
      Publish the update to the global event log but do not store it in the aggregate event store.

      This disables event sourcing for the update. On event-sourced aggregates, the apply result does not advance aggregate state in cache, snapshots, or search indexing because replay would not be able to reconstruct it. On non-event-sourced, document-backed aggregates, the apply result still updates aggregate/search state.

  • Method Details

    • values

      public static EventPublicationStrategy[] 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

      public static EventPublicationStrategy valueOf(String name)
      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 name
      NullPointerException - if the argument is null