Interface ImmediateEventPublisher

All Known Implementing Classes:
EventRepository

public interface ImmediateEventPublisher
Interface specifying operations for immediate, atomic event publication.
  • Method Details

    • publish

      default <E> Event publish(String subject, E event)
      Publishes the given event onto the given subject.
      Type Parameters:
      E - the generic event type
      Parameters:
      subject - the absolute subject path
      event - the event object
      Returns:
      the published Event
    • publish

      default <E> Event publish(String subject, E event, Map<String,?> metaData, List<Precondition> preconditions)
      Publishes the given event including its meta-data onto the given subject with preconditions.
      Type Parameters:
      E - the generic event type
      Parameters:
      subject - the absolute subject path
      event - the event object
      metaData - the event meta-data
      preconditions - the preconditions that must not be violated
      Returns:
      the published Event
    • publish

      default List<Event> publish(Consumer<EventPublisher> handler)
      Atomically publishes all events captured from the given EventPublisher consumer.
      Parameters:
      handler - callback capturing all events to be published atomically
      Returns:
      the list of published Events
    • publish

      List<Event> publish(Consumer<EventPublisher> handler, List<Precondition> additionalPreconditions)
      Atomically publishes all events captured from the given EventPublisher consumer together with the additional preconditions.
      Parameters:
      handler - callback capturing all events to be published atomically
      additionalPreconditions - additional preconditions that must not be violated
      Returns:
      the list of published Events
    • publish

      List<Event> publish(List<CapturedEvent> events, List<Precondition> additionalPreconditions)
      Atomically publishes the given events together with the additional preconditions.
      Parameters:
      events - a list of captured events to be published atomically
      additionalPreconditions - additional preconditions that must not be violated
      Returns:
      the list of published Events