Class AbstractWebSocketHandshake

    • Constructor Detail

      • AbstractWebSocketHandshake

        public AbstractWebSocketHandshake()
    • Method Detail

      • getRequestedProtocols

        public Set<String> getRequestedProtocols()
        Description copied from interface: WebSocketHandshake
        The sub protocols requested by the client. Will be ordered to match the order sent by the client.
        Specified by:
        getRequestedProtocols in interface WebSocketHandshake
        Returns:
        The set of sub protocols requested by the client or null if the header was empty or never sent by the client.
      • setRequestedProtocols

        public void setRequestedProtocols​(Set<String> requestedProtocols)
      • getSelectedProtocol

        public String getSelectedProtocol()
        Description copied from interface: WebSocketHandshake
        Gets the current selected sub protocol out of the requested sub protocols.
        Specified by:
        getSelectedProtocol in interface WebSocketHandshake
        Returns:
        The selected sub protocol or null if none are selected
      • selectProtocol

        public boolean selectProtocol​(String subprotocol)
        Description copied from interface: WebSocketHandshake
        Selects the first matching supported sub protocol out of the requested sub protocols. Most browsers and WebSocket implementations require a match from the list supplied by the client or the handshake will fail.
        Specified by:
        selectProtocol in interface WebSocketHandshake
        Returns:
        True if selected or false if none matched