Interface PresenceViewRegistry


  • public interface PresenceViewRegistry
    Routes local presence events to browser views subscribed to the affected resource. Retains up to the configured maximum number of subscriptions, evicting the oldest registration first. To handle presence events, you can subscribe to the CHANNEL_NAME push channel using OmniFaces' <o:socket> component and listen for 'refresh' events. No further payload is sent with the event, so you will need to fetch the current state of the resource from the server after receiving the event.
    Since:
    8.6.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String CHANNEL_NAME
      The name of the push channel used for concurrent user events.
    • Field Detail

      • CHANNEL_NAME

        static final String CHANNEL_NAME
        The name of the push channel used for concurrent user events.
        Since:
        8.6.0
        See Also:
        Constant Field Values
    • Method Detail

      • subscribe

        void subscribe​(@NotNull
                       @NotNull TrackingId trackingId,
                       @NotNull
                       @NotNull ResourceKey resourceKey)
        Registers a browser view to receive concurrent-edit events for the given resource key. If the view is already registered for another resource, it will be unregistered from that resource first.
        Parameters:
        trackingId - The unique tracking ID of the browser view.
        resourceKey - The resource key to subscribe to.
        Since:
        8.6.0
      • unsubscribe

        void unsubscribe​(@NotNull
                         @NotNull TrackingId trackingId)
        Unregisters a browser view from receiving concurrent-edit events.
        Parameters:
        trackingId - The unique tracking ID of the browser view.
        Since:
        8.6.0