public enum CloseReasons extends java.lang.Enum<CloseReasons>
| Enum Constant and Description | 
|---|
| CANNOT_ACCEPT1003 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). | 
| CLOSED_ABNORMALLY1006 is a reserved value and MUST NOT be set as a status code in a
 Close control frame by an endpoint. | 
| GOING_AWAY1001 indicates that an endpoint is "going away", such as a server
 going down or a browser having navigated away from a page. | 
| NO_EXTENSION1010 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. | 
| NO_STATUS_CODE1005 is a reserved value and MUST NOT be set as a status code in a
 Close control frame by an endpoint. | 
| NORMAL_CLOSURE1000 indicates a normal closure, meaning that the purpose for
 which the connection was established has been fulfilled. | 
| NOT_CONSISTENT1007 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
 data within a text message). | 
| PROTOCOL_ERROR1002 indicates that an endpoint is terminating the connection due
 to a protocol error. | 
| RESERVEDReserved. | 
| SERVICE_RESTART1012 indicates that the service will be restarted. | 
| TLS_HANDSHAKE_FAILURE1015 is a reserved value and MUST NOT be set as a status code in a
 Close control frame by an endpoint. | 
| TOO_BIG1009 indicates that an endpoint is terminating the connection
 because it has received a message that is too big for it to
 process. | 
| TRY_AGAIN_LATER1013 indicates that the service is experiencing overload | 
| UNEXPECTED_CONDITION1011 indicates that a server is terminating the connection because
 it encountered an unexpected condition that prevented it from
 fulfilling the request. | 
| VIOLATED_POLICY1008 indicates that an endpoint is terminating the connection
 because it has received a message that violates its policy. | 
| Modifier and Type | Method and Description | 
|---|---|
| static CloseReason | create(CloseReason.CloseCode closeCode,
      java.lang.String reasonPhrase) | 
| CloseReason | getCloseReason()Get close reason. | 
| static CloseReasons | valueOf(java.lang.String name)Returns the enum constant of this type with the specified name. | 
| static CloseReasons[] | values()Returns an array containing the constants of this enum type, in
the order they are declared. | 
public static final CloseReasons NORMAL_CLOSURE
public static final CloseReasons GOING_AWAY
public static final CloseReasons PROTOCOL_ERROR
public static final CloseReasons CANNOT_ACCEPT
public static final CloseReasons RESERVED
public static final CloseReasons NO_STATUS_CODE
public static final CloseReasons CLOSED_ABNORMALLY
public static final CloseReasons NOT_CONSISTENT
public static final CloseReasons VIOLATED_POLICY
public static final CloseReasons TOO_BIG
public static final CloseReasons NO_EXTENSION
public static final CloseReasons UNEXPECTED_CONDITION
public static final CloseReasons SERVICE_RESTART
public static final CloseReasons TRY_AGAIN_LATER
public static final CloseReasons TLS_HANDSHAKE_FAILURE
public static CloseReasons[] values()
for (CloseReasons c : CloseReasons.values()) System.out.println(c);
public static CloseReasons valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic CloseReason getCloseReason()
public static CloseReason create(CloseReason.CloseCode closeCode, java.lang.String reasonPhrase)
Copyright © 2012–2020 Oracle Corporation. All rights reserved.