Interface ImmediateEventPublisher
- All Known Implementing Classes:
EventRepository
public interface ImmediateEventPublisher
Interface specifying operations for immediate, atomic event publication.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <E> Event
Publishes the given event onto the given subject.default <E> Event
Publishes the given event including its meta-data onto the given subject with preconditions.publish
(Consumer<EventPublisher> handler) Atomically publishes all events captured from the givenEventPublisher
consumer.publish
(Consumer<EventPublisher> handler, List<Precondition> additionalPreconditions) Atomically publishes all events captured from the givenEventPublisher
consumer 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 givenEventPublisher
consumer.- Parameters:
handler
- callback capturing all events to be published atomically- Returns:
- the list of published
Event
s
-
publish
Atomically publishes all events captured from the givenEventPublisher
consumer 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
Event
s
-
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
Event
s
-