public enum CloseCode extends java.lang.Enum<CloseCode>
WebSocketClient
close codes
with association to an explaining message.
Enum Constant and Description |
---|
ALREADY_AUTHENTICATED |
AUTHENTICATION_FAILED |
CLOUD_FLARE_LOAD |
DECODE_ERROR |
GRACEFUL_CLOSE |
INTERNAL_SERVER_ERROR |
INVALID_SEQ |
INVALID_SHARD |
NOT_AUTHENTICATED |
RATE_LIMITED |
SESSION_TIMEOUT |
SHARDING_REQUIRED |
UNKNOWN_ERROR |
UNKNOWN_OPCODE |
Modifier and Type | Method and Description |
---|---|
static CloseCode |
from(int code)
Retrieves the CloseCode representation
for the specified integer close code
|
int |
getCode()
The integer code in the form of
4xxx /1xxx |
java.lang.String |
getMeaning()
The message which further explains the reason
for this close code's occurrence
|
boolean |
isReconnect()
Whether the
WebSocketClient
will attempt to reconnect when this close code appears |
java.lang.String |
toString() |
static CloseCode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CloseCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CloseCode GRACEFUL_CLOSE
public static final CloseCode CLOUD_FLARE_LOAD
public static final CloseCode INTERNAL_SERVER_ERROR
public static final CloseCode UNKNOWN_ERROR
public static final CloseCode UNKNOWN_OPCODE
public static final CloseCode DECODE_ERROR
public static final CloseCode NOT_AUTHENTICATED
public static final CloseCode AUTHENTICATION_FAILED
public static final CloseCode ALREADY_AUTHENTICATED
public static final CloseCode INVALID_SEQ
public static final CloseCode RATE_LIMITED
public static final CloseCode SESSION_TIMEOUT
public static final CloseCode INVALID_SHARD
public static final CloseCode SHARDING_REQUIRED
public static CloseCode[] values()
for (CloseCode c : CloseCode.values()) System.out.println(c);
public static CloseCode 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 int getCode()
4xxx
/1xxx
public java.lang.String getMeaning()
public boolean isReconnect()
WebSocketClient
will attempt to reconnect when this close code appearspublic java.lang.String toString()
toString
in class java.lang.Enum<CloseCode>
public static CloseCode from(int code)
code
- The close code to matchnull
if no match was found