Package org.apache.myfaces.push.cdi
Class WebsocketSessionManager
- java.lang.Object
- 
- org.apache.myfaces.push.cdi.WebsocketSessionManager
 
- 
 @ApplicationScoped public class WebsocketSessionManager extends Object 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classWebsocketSessionManager.UserChannelKey
 - 
Constructor SummaryConstructors Constructor Description WebsocketSessionManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddOrUpdateSession(String channelToken, jakarta.websocket.Session session)voidclearSessions()voidderegisterUser(Serializable user, String channel, String channelToken)Set<String>getChannelTokensForUser(Serializable user, String channel)Queue<String>getRestoredQueue()ConcurrentLRUCache<String,Collection<Reference<jakarta.websocket.Session>>>getSessionMap()ConcurrentMap<WebsocketSessionManager.UserChannelKey,Set<String>>getUserMap()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.protected Set<Future<Void>>send(String channelToken, Object message)voidsynchronizeSessionInstances()
 
- 
- 
- 
Method Detail- 
init@PostConstruct public void init() 
 - 
getSessionMappublic ConcurrentLRUCache<String,Collection<Reference<jakarta.websocket.Session>>> getSessionMap() 
 - 
getUserMappublic ConcurrentMap<WebsocketSessionManager.UserChannelKey,Set<String>> getUserMap() 
 - 
registerSessionTokenpublic void registerSessionToken(String channelToken) 
 - 
registerUserpublic void registerUser(Serializable user, String channel, String channelToken) 
 - 
deregisterUserpublic void deregisterUser(Serializable user, String channel, String channelToken) 
 - 
getChannelTokensForUserpublic Set<String> getChannelTokensForUser(Serializable user, String channel) 
 - 
initSessionMappublic void initSessionMap(ExternalContext context) 
 - 
clearSessionspublic void clearSessions() 
 - 
addOrUpdateSessionpublic boolean addOrUpdateSession(String channelToken, jakarta.websocket.Session session) 
 - 
removeSessionpublic void removeSession(String channelToken, jakarta.websocket.Session session) 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-
 
 - 
removeChannelTokenpublic void removeChannelToken(String channelToken) Remove the channelToken and close all sessions associated with it. Happens, when session scope or view scope is destroyed.- Parameters:
- channelToken-
 
 - 
synchronizeSessionInstancespublic void synchronizeSessionInstances() 
 
- 
 
-