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 TypeMethodDescriptionbooleanaddOrUpdateSession(String channelToken, jakarta.websocket.Session session) voidvoidderegisterUser(Serializable user, String channel, String channelToken) getChannelTokensForUser(Serializable user, String channel) ConcurrentLRUCache<String,Collection<Reference<jakarta.websocket.Session>>> voidinit()voidinitSessionMap(ExternalContext context) voidregisterSessionToken(String channelToken) voidregisterUser(Serializable user, String channel, String channelToken) voidremoveChannelToken(String channelToken) Remove the channelToken and close all sessions associated with it.voidremoveSession(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
-