-
- 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 intNORMALpublic final static intGOING_AWAYpublic final static intPROTOCOL_ERRORpublic final static intREFUSEpublic final static intNOCODEpublic final static intABNORMAL_CLOSEpublic final static intNO_UTF8public final static intPOLICY_VALIDATIONpublic final static intTOOBIGpublic final static intEXTENSIONpublic final static intUNEXPECTED_CONDITIONpublic final static intSERVICE_RESTARTpublic final static intTRY_AGAIN_LATERpublic final static intBAD_GATEWAYpublic final static intTLS_ERRORpublic final static intNEVER_CONNECTEDpublic final static intBUGGYCLOSEpublic final static intFLASHPOLICYprivate intcodeprivate Stringreason
-
Constructor Summary
Constructors Constructor Description CloseFrame()Constructor for a close frameUsing opcode closing and fin = true
-
Method Summary
Modifier and Type Method Description voidsetCode(int code)Set the close code for this close frame voidsetReason(String reason)Set the close reason for this close frame intgetCloseCode()Get the used close code StringgetMessage()Get the message that closeframe is containing StringtoString()voidisValid()Check if the frame is valid due to specification voidsetPayload(ByteBuffer payload)Set the payload of this frame to the provided payload ByteBuffergetPayloadData()The "Payload data" which was sent in this frame booleanequals(Object o)inthashCode()-
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()
-
-
-
-