Package com.neovisionaries.ws.client
Class OpeningHandshakeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.neovisionaries.ws.client.WebSocketException
-
- com.neovisionaries.ws.client.OpeningHandshakeException
-
- All Implemented Interfaces:
java.io.Serializable
public class OpeningHandshakeException extends WebSocketException
An exception raised due to a violation against the WebSocket protocol.- Since:
- 1.19
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
mBody
private java.util.Map<java.lang.String,java.util.List<java.lang.String>>
mHeaders
private StatusLine
mStatusLine
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description OpeningHandshakeException(WebSocketError error, java.lang.String message, StatusLine statusLine, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
OpeningHandshakeException(WebSocketError error, java.lang.String message, StatusLine statusLine, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, byte[] body)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBody()
Get the response body contained in the WebSocket opening handshake response from the server.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaders()
Get the HTTP headers contained in the WebSocket opening handshake response from the server.StatusLine
getStatusLine()
Get the status line contained in the WebSocket opening handshake response from the server.-
Methods inherited from class com.neovisionaries.ws.client.WebSocketException
getError
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
mStatusLine
private final StatusLine mStatusLine
-
mHeaders
private final java.util.Map<java.lang.String,java.util.List<java.lang.String>> mHeaders
-
mBody
private final byte[] mBody
-
-
Constructor Detail
-
OpeningHandshakeException
OpeningHandshakeException(WebSocketError error, java.lang.String message, StatusLine statusLine, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
-
OpeningHandshakeException
OpeningHandshakeException(WebSocketError error, java.lang.String message, StatusLine statusLine, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, byte[] body)
-
-
Method Detail
-
getStatusLine
public StatusLine getStatusLine()
Get the status line contained in the WebSocket opening handshake response from the server.- Returns:
- The status line.
-
getHeaders
public java.util.Map<java.lang.String,java.util.List<java.lang.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
withString.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.
-
-