-
- All Implemented Interfaces:
-
com.tds.common.websocket.framing.Framedata
public class CloseFrame extends ControlFrame
Class to represent a close frame
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
NORMAL
public final static int
GOING_AWAY
public final static int
PROTOCOL_ERROR
public final static int
REFUSE
public final static int
NOCODE
public final static int
ABNORMAL_CLOSE
public final static int
NO_UTF8
public final static int
POLICY_VALIDATION
public final static int
TOOBIG
public final static int
EXTENSION
public final static int
UNEXPECTED_CONDITION
public final static int
SERVICE_RESTART
public final static int
TRY_AGAIN_LATER
public final static int
BAD_GATEWAY
public final static int
TLS_ERROR
public final static int
NEVER_CONNECTED
public final static int
BUGGYCLOSE
public final static int
FLASHPOLICY
private int
code
private String
reason
-
Constructor Summary
Constructors Constructor Description CloseFrame()
Constructor for a close frameUsing opcode closing and fin = true
-
Method Summary
Modifier and Type Method Description void
setCode(int code)
Set the close code for this close frame void
setReason(String reason)
Set the close reason for this close frame int
getCloseCode()
Get the used close code String
getMessage()
Get the message that closeframe is containing String
toString()
void
isValid()
Check if the frame is valid due to specification void
setPayload(ByteBuffer payload)
Set the payload of this frame to the provided payload ByteBuffer
getPayloadData()
The "Payload data" which was sent in this frame boolean
equals(Object o)
int
hashCode()
-
Methods inherited from class com.tds.common.websocket.framing.FramedataImpl1
append, get, getOpcode, getTransfereMasked, isFin, isRSV1, isRSV2, isRSV3, setFin, setRSV1, setRSV2, setRSV3, setTransferemasked
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setCode
void setCode(int code)
Set the close code for this close frame
- Parameters:
code
- the close code
-
setReason
void setReason(String reason)
Set the close reason for this close frame
- Parameters:
reason
- the reason code
-
getCloseCode
int getCloseCode()
Get the used close code
-
getMessage
String getMessage()
Get the message that closeframe is containing
-
isValid
void isValid()
Check if the frame is valid due to specification
-
setPayload
void setPayload(ByteBuffer payload)
Set the payload of this frame to the provided payload
- Parameters:
payload
- the payload which is to set
-
getPayloadData
ByteBuffer getPayloadData()
The "Payload data" which was sent in this frame
-
hashCode
int hashCode()
-
-
-
-