public class WebSocketCloseStatus extends Object
Modifier and Type | Field and Description |
---|---|
static WebSocketCloseStatus |
BAD_DATA
1007 indicates that an endpoint is terminating the connection because it has
received data within a message that was not consistent with the type of the message
(e.g., non-UTF-8 [RFC3629] data within a text message).
|
static int |
BAD_DATA_CODE
1007 indicates that an endpoint is terminating the connection because it has
received data within a message that was not consistent with the type of the message
(e.g., non-UTF-8 [RFC3629] data within a text message).
|
static WebSocketCloseStatus |
GOING_AWAY
1001 indicates that an endpoint is "going away", such as a server going down or a
browser having navigated away from a page.
|
static int |
GOING_AWAY_CODE
1001 indicates that an endpoint is "going away", such as a server going down or a
browser having navigated away from a page.
|
static WebSocketCloseStatus |
HARSH_DISCONNECT
1006 indicates that an endpoint is terminating the connection.
|
static int |
HARSH_DISCONNECT_CODE
1006 indicates that an endpoint is terminating the connection.
|
static WebSocketCloseStatus |
NORMAL
1000 indicates a normal closure, meaning that the purpose for which the connection
was established has been fulfilled.
|
static int |
NORMAL_CODE
1000 indicates a normal closure, meaning that the purpose for which the connection
was established has been fulfilled.
|
static WebSocketCloseStatus |
NOT_ACCEPTABLE
1003 indicates that an endpoint is terminating the connection because it has
received a type of data it cannot accept (e.g., an endpoint that understands only
text data MAY send this if it receives a binary message).
|
static int |
NOT_ACCEPTABLE_CODE
1003 indicates that an endpoint is terminating the connection because it has
received a type of data it cannot accept (e.g., an endpoint that understands only
text data MAY send this if it receives a binary message).
|
static WebSocketCloseStatus |
POLICY_VIOLATION
1008 indicates that an endpoint is terminating the connection because it has
received a message that violates its policy.
|
static int |
POLICY_VIOLATION_CODE
1008 indicates that an endpoint is terminating the connection because it has
received a message that violates its policy.
|
static WebSocketCloseStatus |
PROTOCOL_ERROR
1002 indicates that an endpoint is terminating the connection due to a protocol
error.
|
static int |
PROTOCOL_ERROR_CODE
1002 indicates that an endpoint is terminating the connection due to a protocol error.
|
static WebSocketCloseStatus |
REQUIRED_EXTENSION
1010 indicates that an endpoint (client) is terminating the connection because it
has expected the server to negotiate one or more extension, but the server didn't
return them in the response message of the WebSocket handshake.
|
static int |
REQUIRED_EXTENSION_CODE
1010 indicates that an endpoint (client) is terminating the connection because it
has expected the server to negotiate one or more extension, but the server didn't
return them in the response message of the WebSocket handshake.
|
static WebSocketCloseStatus |
SERVER_ERROR
1011 indicates that a server is terminating the connection because it encountered
an unexpected condition that prevented it from fulfilling the request.
|
static int |
SERVER_ERROR_CODE
1011 indicates that a server is terminating the connection because it encountered
an unexpected condition that prevented it from fulfilling the request.
|
static WebSocketCloseStatus |
SERVICE_OVERLOAD
1013 indicates that the service is experiencing overload.
|
static int |
SERVICE_OVERLOAD_CODE
1013 indicates that the service is experiencing overload.
|
static WebSocketCloseStatus |
SERVICE_RESTARTED
1012 indicates that the service is restarted.
|
static int |
SERVICE_RESTARTED_CODE
1012 indicates that the service is restarted.
|
static WebSocketCloseStatus |
TOO_BIG_TO_PROCESS
1009 indicates that an endpoint is terminating the connection because it has
received a message that is too big for it to process.
|
static int |
TOO_BIG_TO_PROCESS_CODE
1009 indicates that an endpoint is terminating the connection because it has
received a message that is too big for it to process.
|
Constructor and Description |
---|
WebSocketCloseStatus(int code,
String reason)
Creates a new websocket close status.
|
Modifier and Type | Method and Description |
---|---|
int |
getCode()
Status code.
|
String |
getReason()
Reason or
null . |
String |
toString() |
static Optional<WebSocketCloseStatus> |
valueOf(int code)
Map the status code to one of the existing web socket status.
|
public static final int NORMAL_CODE
public static final int GOING_AWAY_CODE
public static final int PROTOCOL_ERROR_CODE
public static final int NOT_ACCEPTABLE_CODE
public static final int HARSH_DISCONNECT_CODE
public static final int BAD_DATA_CODE
public static final int POLICY_VIOLATION_CODE
public static final int TOO_BIG_TO_PROCESS_CODE
public static final int REQUIRED_EXTENSION_CODE
public static final int SERVER_ERROR_CODE
public static final int SERVICE_RESTARTED_CODE
public static final int SERVICE_OVERLOAD_CODE
public static final WebSocketCloseStatus NORMAL
public static final WebSocketCloseStatus GOING_AWAY
public static final WebSocketCloseStatus PROTOCOL_ERROR
public static final WebSocketCloseStatus NOT_ACCEPTABLE
public static final WebSocketCloseStatus HARSH_DISCONNECT
public static final WebSocketCloseStatus BAD_DATA
public static final WebSocketCloseStatus POLICY_VIOLATION
public static final WebSocketCloseStatus TOO_BIG_TO_PROCESS
public static final WebSocketCloseStatus REQUIRED_EXTENSION
public static final WebSocketCloseStatus SERVER_ERROR
public static final WebSocketCloseStatus SERVICE_RESTARTED
public static final WebSocketCloseStatus SERVICE_OVERLOAD
public int getCode()
public static Optional<WebSocketCloseStatus> valueOf(int code)
code
- Status code.Copyright © 2020. All rights reserved.