Class WebSocketServerHandshakeCompletionEvent

    • Constructor Detail

      • WebSocketServerHandshakeCompletionEvent

        public WebSocketServerHandshakeCompletionEvent​(WebSocketVersion version,
                                                       String requestUri,
                                                       HttpHeaders requestHeaders,
                                                       String selectedSubprotocol)
        Create a new event that indicate a successful websocket handshake.
        Parameters:
        version - the WebSocketVersion that was used.
        requestUri - the URI of the request.
        requestHeaders - the headers of the upgrade request.
        selectedSubprotocol - the selected sub-protocol, if any.
      • WebSocketServerHandshakeCompletionEvent

        public WebSocketServerHandshakeCompletionEvent​(Throwable cause)
        Create a new event that indicate a failed websocket handshake.
        Parameters:
        cause - the cause of the failure.
    • Method Detail

      • requestUri

        public String requestUri()
        Return the request uri of the handshake if ProtocolEvent.isSuccess() returns true, null otherwise.
        Returns:
        the uri.
      • selectedSubprotocol

        public String selectedSubprotocol()
        Return the selected sub-protocol of the handshake if ProtocolEvent.isSuccess() returns true and one was selected, null otherwise.
        Returns:
        the sub-protocol.