Class WebsocketSessionManager


  • @ApplicationScoped
    public class WebsocketSessionManager
    extends Object
    • Constructor Detail

      • WebsocketSessionManager

        public WebsocketSessionManager()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • getUserMap

        public ConcurrentMap<org.apache.myfaces.push.cdi.WebsocketSessionManager.UserChannelKey,​Set<String>> getUserMap()
      • registerSessionToken

        public void registerSessionToken​(String channelToken)
      • clearSessions

        public void clearSessions()
      • addOrUpdateSession

        public boolean addOrUpdateSession​(String channelToken,
                                          jakarta.websocket.Session session)
      • removeSession

        public 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 -
      • removeChannelToken

        public 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 -
      • synchronizeSessionInstances

        public void synchronizeSessionInstances()
      • getRestoredQueue

        public Queue<String> getRestoredQueue()