Class LocalBackend

  • All Implemented Interfaces:
    Backend

    public class LocalBackend
    extends Object
    implements Backend
    A simple backend implementation that only distributes events locally and assumes that there is no previous history for event logs.
    Author:
    Vaadin Ltd
    • Constructor Detail

      • LocalBackend

        public LocalBackend()
    • 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 until Backend.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 interface Backend
        Parameters:
        topicId - the id of the event log to open, not null
        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 interface Backend
        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.
        Specified by:
        getNodeId in interface Backend
        Returns:
        the node id, not null
      • submitSnapshot

        public void submitSnapshot​(String name,
                                   com.fasterxml.jackson.databind.node.ObjectNode snapshot)
        Specified by:
        submitSnapshot in interface Backend