com.vaadin.collaborationengine.
Interface Backend.EventLog
-
Enclosing interface:
public static interface Backend.EventLog
A strictly ordered log of submitted events.
-
-
Method Summary
All Methods Modifier and Type Method and Description void
submitEvent(UUID trackingId, com.fasterxml.jackson.databind.node.ObjectNode eventPayload)
Submits an event through the backend to all subscribers.
Registration
subscribe(BiConsumer<UUID,com.fasterxml.jackson.databind.node.ObjectNode> eventConsumer)
Adds a subscriber to receive all past and future events for this event log.
-
-
-
Method Detail
-
submitEvent
void submitEvent(UUID trackingId, com.fasterxml.jackson.databind.node.ObjectNode eventPayload)
Submits an event through the backend to all subscribers. The tracking id needs to be delivered to active subscribers but it is not necessary to preserve it for replaying old events to new subscribers.
Parameters:
trackingId
- the tracking id of this event, notnull
eventPayload
- the JSON object representing the event, notnull
-
subscribe
Registration subscribe(BiConsumer<UUID,com.fasterxml.jackson.databind.node.ObjectNode> eventConsumer)
Adds a subscriber to receive all past and future events for this event log. A newly added subscriber should initially receive all previous events in the log based on their original order so that it can catch up with the latest state. New events should be delivered (in order) only after all previous events have been delivered. It is not allowed to invoke the consumer again until the previous invocation has returned.
Parameters:
eventConsumer
- a consumer that should receive all events, notnull
Returns:
a registration to remove the event consumer, not
null
-
-