Interface ImmediateEventPublisher
- All Known Implementing Classes:
EventRepository
public interface ImmediateEventPublisher
Interface specifying operations for immediate, atomic event publication.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <E> EventPublishes the given event onto the given subject.default <E> EventPublishes the given event including its meta-data onto the given subject with preconditions.publish(Consumer<EventPublisher> handler) Atomically publishes all events captured from the givenEventPublisherconsumer.publish(Consumer<EventPublisher> handler, List<Precondition> additionalPreconditions) Atomically publishes all events captured from the givenEventPublisherconsumer together with the additional preconditions.publish(List<CapturedEvent> events, List<Precondition> additionalPreconditions) Atomically publishes the given events together with the additional preconditions.
-
Method Details
-
publish
Publishes the given event onto the given subject.- Type Parameters:
E- the generic event type- Parameters:
subject- the absolute subject pathevent- 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 pathevent- the event objectmetaData- the event meta-datapreconditions- the preconditions that must not be violated- Returns:
- the published
Event
-
publish
Atomically publishes all events captured from the givenEventPublisherconsumer.- Parameters:
handler- callback capturing all events to be published atomically- Returns:
- the list of published
Events
-
publish
Atomically publishes all events captured from the givenEventPublisherconsumer together with the additional preconditions.- Parameters:
handler- callback capturing all events to be published atomicallyadditionalPreconditions- additional preconditions that must not be violated- Returns:
- the list of published
Events
-
publish
Atomically publishes the given events together with the additional preconditions.- Parameters:
events- a list of captured events to be published atomicallyadditionalPreconditions- additional preconditions that must not be violated- Returns:
- the list of published
Events
-