Package org.simpleframework.http.socket
Enum CloseCode
- All Implemented Interfaces:
Serializable
,Comparable<CloseCode>
,java.lang.constant.Constable
The
CloseCode
enumerates the closure codes specified in
RFC 6455. When closing an established connection an endpoint may
indicate a reason for closure. The interpretation of this reason by
an endpoint, and the action an endpoint should take given this reason,
are left undefined by RFC 6455. The specification defines a set of
status codes and specifies which ranges may be used by extensions,
frameworks, and end applications. The status code and any associated
textual message are optional components of a Close frame.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates an abnormal closure and should not be used.Indicates that the server is going down or the client browsed away.Indicates an unexpected error within the server.Indicates that a payload was not consistent with the message type.Indicates that the server did not negotiate an extension properly.Indicates that no status code was present and should not be used.Indicates the purpose for the connection has been fulfilled.Indicates an endpoint received a message that violates its policy.Indicates the connection is terminating due to a protocol error.According to RFC 6455 this has been reserved for future use.Indicates a validation failure for TLS and should not be used.Indicates that a payload is too big to be processed.Indicates the connection received a data type it cannot accept. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
This is the data that represents the closure code.static CloseCode
resolveCode
(int high, int low) static CloseCode
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.
-
Enum Constant Details
-
NORMAL_CLOSURE
Indicates the purpose for the connection has been fulfilled. -
GOING_AWAY
Indicates that the server is going down or the client browsed away. -
PROTOCOL_ERROR
Indicates the connection is terminating due to a protocol error. -
UNSUPPORTED_DATA
Indicates the connection received a data type it cannot accept. -
RESERVED
According to RFC 6455 this has been reserved for future use. -
NO_STATUS_CODE
Indicates that no status code was present and should not be used. -
ABNORMAL_CLOSURE
Indicates an abnormal closure and should not be used. -
INVALID_FRAME_DATA
Indicates that a payload was not consistent with the message type. -
POLICY_VIOLATION
Indicates an endpoint received a message that violates its policy. -
TOO_BIG
Indicates that a payload is too big to be processed. -
NO_EXTENSION
Indicates that the server did not negotiate an extension properly. -
INTERNAL_SERVER_ERROR
Indicates an unexpected error within the server. -
TLS_HANDSHAKE_FAILURE
Indicates a validation failure for TLS and should not be used.
-
-
Field Details
-
code
public final int codeThis is the actual integer value representing the code. -
high
public final int highThis is the high order byte for the closure code. -
low
public final int lowThis is the low order byte for the closure code.
-
-
Constructor Details
-
CloseCode
private CloseCode(int code) Constructor for theCloseCode
object. This is used to create a closure code using one of the pre-defined values within RFC 6455.- Parameters:
code
- this is the code that is to be used
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getData
public byte[] getData()This is the data that represents the closure code. The array contains the high order byte and the low order byte as taken from the pre-defined closure code.- Returns:
- a byte array representing the closure code
-
resolveCode
-