java.lang.Object
org.omnifaces.cdi.push.SocketUserManager
This web socket user manager holds all web socket users registered by <o:socket>.
- Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChannelId(String userId, String channel, String channelId) Add user channel ID associated with given session based user ID and channel name.protected voidderegister(Serializable user, String userId) Deregister application user associated with given user and session based user ID.getChannelIds(Serializable user, String channel) Resolve the user-specific channel IDs associated with given user and channel name.protected SerializableResolve the user associated with given channel name and ID.protected ConcurrentHashMap<String,ConcurrentHashMap<String, Set<String>>> For internal usage only.protected voidregister(Serializable user, String userId) Register application user based on given user and session based user ID.
-
Constructor Details
-
SocketUserManager
public SocketUserManager()
-
-
Method Details
-
register
Register application user based on given user and session based user ID.- Parameters:
user- The user.userId- The session based user ID.
-
addChannelId
Add user channel ID associated with given session based user ID and channel name.- Parameters:
userId- The session based user ID.channel- The channel name.channelId- The channel identifier.
-
getUser
Resolve the user associated with given channel name and ID.- Parameters:
channel- The channel name.channelId- The channel identifier.- Returns:
- The user associated with given channel name and ID.
-
getChannelIds
Resolve the user-specific channel IDs associated with given user and channel name.- Parameters:
user- The user.channel- The channel name.- Returns:
- The user-specific channel IDs associated with given user and channel name.
-
deregister
Deregister application user associated with given user and session based user ID.- Parameters:
user- The user.userId- The session based user ID.
-
getUserChannels
For internal usage only. This makes it possible to save and restore user specific channels during server restart/failover inSocketChannelManager. This should actually be package private, but package private methods in CDI beans are subject to memory leaks.- Returns:
- User specific channels.
-