Package org.apache.myfaces.push.cdi
Class WebsocketSessionManager
java.lang.Object
org.apache.myfaces.push.cdi.WebsocketSessionManager
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addOrUpdateSession
(String channelToken, jakarta.websocket.Session session) void
void
deregisterUser
(Serializable user, String channel, String channelToken) getChannelTokensForUser
(Serializable user, String channel) ConcurrentLRUCache<String,
Collection<Reference<jakarta.websocket.Session>>> void
init()
void
initSessionMap
(ExternalContext context) void
registerSessionToken
(String channelToken) void
registerUser
(Serializable user, String channel, String channelToken) void
removeChannelToken
(String channelToken) Remove the channelToken and close all sessions associated with it.void
removeSession
(String channelToken, jakarta.websocket.Session session) Remove the Session associated to the channelToken.void
-
Constructor Details
-
WebsocketSessionManager
public WebsocketSessionManager()
-
-
Method Details
-
init
@PostConstruct public void init() -
getSessionMap
-
getUserMap
-
registerSessionToken
-
registerUser
-
deregisterUser
-
getChannelTokensForUser
-
initSessionMap
-
clearSessions
public void clearSessions() -
addOrUpdateSession
-
removeSession
Remove the Session associated to the channelToken. This happens when the websocket connection is closed. Please note the connection can be closed/reopened, so this method should not block another connection using the same channelToken. To destroy the channel token, WebsocketViewBean is used to destroy the channel token at view expiration time.- Parameters:
channelToken
-session
-
-
removeChannelToken
Remove the channelToken and close all sessions associated with it. Happens, when session scope or view scope is destroyed.- Parameters:
channelToken
-
-
send
-
synchronizeSessionInstances
public void synchronizeSessionInstances() -
getRestoredQueue
-