Class OpeningHandshakeException

All Implemented Interfaces:
Serializable

public class OpeningHandshakeException extends WebSocketException
An exception raised due to a violation against the WebSocket protocol.
Since:
1.19
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getStatusLine

      public StatusLine getStatusLine()
      Get the status line contained in the WebSocket opening handshake response from the server.
      Returns:
      The status line.
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Get the HTTP headers contained in the WebSocket opening handshake response from the server.
      Returns:
      The HTTP headers. The returned map is an instance of TreeMap with String.CASE_INSENSITIVE_ORDER comparator.
    • getBody

      public byte[] getBody()
      Get the response body contained in the WebSocket opening handshake response from the server.

      This method returns a non-null value only when (1) the status code is not 101 (Switching Protocols), (2) the response from the server has a response body, (3) the response has "Content-Length" header, and (4) no error occurred during reading the response body. In other cases, this method returns null.

      Returns:
      The response body.