Class WebsocketSessionBean

  • All Implemented Interfaces:
    Serializable

    @SessionScoped
    public class WebsocketSessionBean
    extends Object
    implements Serializable
    The purpose of this bean is to keep track of the active tokens and Session instances in the current session, so it can be possible to decide if the token is valid or not for the current session. If the token is not in application scope and is present in session, it means there was a server restart, so the connection must be updated (added to application scope).
    See Also:
    Serialized Form
    • Constructor Detail

      • WebsocketSessionBean

        public WebsocketSessionBean()
    • Method Detail

      • isTokenValid

        public boolean isTokenValid​(String token)
      • getUserFromChannelToken

        public Serializable getUserFromChannelToken​(String channelToken)
      • isChannelAvailable

        public boolean isChannelAvailable​(String channel)
        Indicate if the channel mentioned is valid for view scope. A channel is valid if there is at least one token that represents a valid connection to this channel.
        Parameters:
        channel -
        Returns:
      • getChannelTokensFor

        public List<String> getChannelTokensFor​(String channel)
      • destroy

        @PreDestroy
        public void destroy()
      • destroyChannelToken

        public void destroyChannelToken​(String channelToken)