Top Description Fields Constructors Methods
com.sun.faces.push

public Class WebsocketUserManager

extends Object
Class Inheritance
Annotations
@ApplicationScoped
Static Imports
com.sun.faces.cdi.CdiUtils.getBeanInstance, java.util.Collections.emptySet, .Collections.synchronizedSet

This web socket user manager holds all web socket users registered by <f:websocket>.

Author
Bauke Scholtz
Since
2.3
See Also
Push

Field Summary

Modifier and TypeField and Description
private final ConcurrentMap<Serializable, Set<String>>
private static final int
private static final int
private static final int
private static final int
private final ConcurrentMap<String, ConcurrentMap<String, Set<String>>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addChannelId(String
The session based user ID.
userId
,
String
The channel name.
channel
,
String
The channel identifier.
channelId
)

Add user channel ID associated with given session based user ID and channel name.

protected void
deregister(Serializable
The user.
user
,
String
The session based user ID.
userId
)

Deregister application user associated with given user and session based user ID.

private Set<String>
protected Set<String>

Returns:

The user-specific channel IDs associated with given user and channel name.
getChannelIds
(Serializable
The user.
user
,
String
The channel name.
channel
)

Resolve the user-specific channel IDs associated with given user and channel name.

protected Serializable

Returns:

The user associated with given channel name and ID.
getUser
(String
The channel name.
channel
,
String
The channel identifier.
channelId
)

Resolve the user associated with given channel name and ID.

pack-priv static ConcurrentMap<String, ConcurrentMap<String, Set<String>>>
getUserChannels()

For internal usage only.

protected void
register(Serializable
The user.
user
,
String
The session based user ID.
userId
)

Register application user based on given user and session based user ID.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationUsersback to summary
private final ConcurrentMap<Serializable, Set<String>> applicationUsers
ESTIMATED_CHANNELS_IDS_PER_USERback to summary
private static final int ESTIMATED_CHANNELS_IDS_PER_USER
ESTIMATED_SESSIONS_PER_USERback to summary
private static final int ESTIMATED_SESSIONS_PER_USER
ESTIMATED_USER_CHANNELS_PER_APPLICATIONback to summary
private static final int ESTIMATED_USER_CHANNELS_PER_APPLICATION
ESTIMATED_USER_CHANNELS_PER_SESSIONback to summary
private static final int ESTIMATED_USER_CHANNELS_PER_SESSION
userChannelsback to summary
private final ConcurrentMap<String, ConcurrentMap<String, Set<String>>> userChannels

Constructor Detail

WebsocketUserManagerback to summary
public WebsocketUserManager()

Method Detail

addChannelIdback to summary
protected void addChannelId(String userId, String channel, String channelId)

Add user channel ID associated with given session based user ID and channel name.

Parameters
userId:String

The session based user ID.

channel:String

The channel name.

channelId:String

The channel identifier.

deregisterback to summary
protected void deregister(Serializable user, String userId)

Deregister application user associated with given user and session based user ID.

Parameters
user:Serializable

The user.

userId:String

The session based user ID.

getApplicationUserChannelIdsback to summary
private Set<String> getApplicationUserChannelIds(String userId, String channel)
getChannelIdsback to summary
protected Set<String> getChannelIds(Serializable user, String channel)

Resolve the user-specific channel IDs associated with given user and channel name.

Parameters
user:Serializable

The user.

channel:String

The channel name.

Returns:Set<String>

The user-specific channel IDs associated with given user and channel name.

getUserback to summary
protected Serializable getUser(String channel, String channelId)

Resolve the user associated with given channel name and ID.

Parameters
channel:String

The channel name.

channelId:String

The channel identifier.

Returns:Serializable

The user associated with given channel name and ID.

getUserChannelsback to summary
pack-priv static ConcurrentMap<String, ConcurrentMap<String, Set<String>>> getUserChannels()

For internal usage only. This makes it possible to save and restore user specific channels during server restart/failover in WebsocketChannelManager.

registerback to summary
protected void register(Serializable user, String userId)

Register application user based on given user and session based user ID.

Parameters
user:Serializable

The user.

userId:String

The session based user ID.