Package de.xima.fc.user.presence
Interface PresenceViewRegistry
-
public interface PresenceViewRegistryRoutes 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 theCHANNEL_NAMEpush 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 StringCHANNEL_NAMEThe name of the push channel used for concurrent user events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsubscribe(@NotNull TrackingId trackingId, @NotNull ResourceKey resourceKey)Registers a browser view to receive concurrent-edit events for the given resource key.voidunsubscribe(@NotNull TrackingId trackingId)Unregisters a browser view from receiving concurrent-edit 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
-
-