Package com.vaadin.collaborationengine
Class LocalBackend
- java.lang.Object
-
- com.vaadin.collaborationengine.LocalBackend
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.collaborationengine.Backend
Backend.EventLog
-
-
Constructor Summary
Constructors Constructor Description LocalBackend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Backend.EventLog
getMembershipEventLog()
Get the event log of this backend node membership events.UUID
getNodeId()
Gets the unique identifier of this backend node.CompletableFuture<com.fasterxml.jackson.databind.node.ObjectNode>
loadLatestSnapshot(String name)
Backend.EventLog
openEventLog(String topicId)
Opens an event log with the given id.void
submitSnapshot(String name, com.fasterxml.jackson.databind.node.ObjectNode snapshot)
-
-
-
Method Detail
-
openEventLog
public Backend.EventLog openEventLog(String topicId)
Description copied from interface:Backend
Opens an event log with the given id. The returned object can be used to capture any common state related to this particular event log. An actual underlying connection is not needed untilBackend.EventLog.subscribe(UUID, BiConsumer)
} is invoked, but it is still recommended to make this method fail fast in case it would not be possible to open an actual underlying connection later.- Specified by:
openEventLog
in interfaceBackend
- Parameters:
topicId
- the id of the event log to open, notnull
- Returns:
- an object representing the event log, not
null
-
getMembershipEventLog
public Backend.EventLog getMembershipEventLog()
Description copied from interface:Backend
Get the event log of this backend node membership events. The returned object can be used to subscribe to events dispatched when a node joins or leaves the backend.- Specified by:
getMembershipEventLog
in interfaceBackend
- Returns:
- the object representing the membership event log, not
null
-
getNodeId
public UUID getNodeId()
Description copied from interface:Backend
Gets the unique identifier of this backend node.
-
loadLatestSnapshot
public CompletableFuture<com.fasterxml.jackson.databind.node.ObjectNode> loadLatestSnapshot(String name)
- Specified by:
loadLatestSnapshot
in interfaceBackend
-
submitSnapshot
public void submitSnapshot(String name, com.fasterxml.jackson.databind.node.ObjectNode snapshot)
- Specified by:
submitSnapshot
in interfaceBackend
-
-