@ApplicationScoped public class SocketUserManager extends Object
This web socket user manager holds all web socket users registered by <o:socket>
.
Socket
Constructor and Description |
---|
SocketUserManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addChannelId(String userId,
String channel,
String channelId)
Add user channel ID associated with given session based user ID and channel name.
|
protected void |
deregister(Serializable user,
String userId)
Deregister application user associated with given user and session based user ID.
|
protected Set<String> |
getChannelIds(Serializable user,
String channel)
Resolve the user-specific channel IDs associated with given user and channel name.
|
protected Serializable |
getUser(String channel,
String channelId)
Resolve the user associated with given channel name and ID.
|
protected ConcurrentHashMap<String,ConcurrentHashMap<String,Set<String>>> |
getUserChannels()
For internal usage only.
|
protected void |
register(Serializable user,
String userId)
Register application user based on given user and session based user ID.
|
protected void register(Serializable user, String userId)
user
- The user.userId
- The session based user ID.protected void addChannelId(String userId, String channel, String channelId)
userId
- The session based user ID.channel
- The channel name.channelId
- The channel identifier.protected Serializable getUser(String channel, String channelId)
channel
- The channel name.channelId
- The channel identifier.protected Set<String> getChannelIds(Serializable user, String channel)
user
- The user.channel
- The channel name.protected void deregister(Serializable user, String userId)
user
- The user.userId
- The session based user ID.protected ConcurrentHashMap<String,ConcurrentHashMap<String,Set<String>>> getUserChannels()
SocketChannelManager
.
This should actually be package private, but package private methods in CDI beans are subject to memory leaks.Copyright © 2012–2020 OmniFaces. All rights reserved.