Package de.xima.fc.user.presence
Interface SessionMap
-
public interface SessionMapA registry of tracked views, supporting cluster-wide state synchronization.- Since:
- 8.6.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static SessionMapgetInstance()Returns the singleton instance of this service.Set<PresenceEntry>getSnapshot()Returns a detached snapshot of all registrations for cluster-wide state synchronization.booleanheartbeat(@NotNull TrackingId trackingId)Refreshes the registration identified by its unique tracking ID, regardless of its resource.voidregister(@NotNull TrackingId trackingId, @NotNull ResourceKey resourceKey, @NotNull UserInfo entry)Registers or refreshes one browser instance's presence for a resource.voidsyncFromRemote()Replaces the local registrations with a snapshot from the master on a frontend server.UserInfounregister(@NotNull TrackingId trackingId)Removes the registration identified by its unique tracking ID, regardless of its resource.UserInfounregister(@NotNull TrackingId trackingId, @NotNull ResourceKey resourceKey)Removes the registration identified by its unique tracking ID and resource key.
-
-
-
Method Detail
-
getInstance
static SessionMap getInstance()
Returns the singleton instance of this service.- Returns:
- The singleton instance of this service.
- Since:
- 8.6.0
-
register
void register(@NotNull @NotNull TrackingId trackingId, @NotNull @NotNull ResourceKey resourceKey, @NotNull @NotNull UserInfo entry)Registers or refreshes one browser instance's presence for a resource.- Parameters:
trackingId- Identifies this specific browser instance (tab/iframe).resourceKey- The resource being edited, e.g.form_record:42.entry- The registration to store for this instance.- Since:
- 8.6.0
-
unregister
UserInfo unregister(@NotNull @NotNull TrackingId trackingId)
Removes the registration identified by its unique tracking ID, regardless of its resource.- Parameters:
trackingId- the browser instance whose registration is removed- Returns:
- the removed user, or
nullif no registration exists - Since:
- 8.6.0
-
unregister
UserInfo unregister(@NotNull @NotNull TrackingId trackingId, @NotNull @NotNull ResourceKey resourceKey)
Removes the registration identified by its unique tracking ID and resource key. If the resource key does not match the registration, no action is taken.- Parameters:
trackingId- the browser instance whose registration is removedresourceKey- the resource being edited- Returns:
- the removed user, or
nullif no registration exists - Since:
- 8.6.0
-
heartbeat
boolean heartbeat(@NotNull @NotNull TrackingId trackingId)Refreshes the registration identified by its unique tracking ID, regardless of its resource. This method returnsfalseif the registration does not exist. A stale registration can still be refreshed until it has been removed by the expiration sweep.- Parameters:
trackingId- the browser instance sending the heartbeat- Returns:
trueif the heartbeat was successful,falseotherwise.- Since:
- 8.6.0
-
getSnapshot
Set<PresenceEntry> getSnapshot()
Returns a detached snapshot of all registrations for cluster-wide state synchronization.- Returns:
- a set containing one entry per tracked view
- Since:
- 8.6.0
-
syncFromRemote
void syncFromRemote()
Replaces the local registrations with a snapshot from the master on a frontend server. Local changes made while the snapshot is being fetched may be overwritten. Does nothing on a master server.- Since:
- 8.6.0
-
-