Class ControlFrame
- java.lang.Object
-
- org.eclipse.jetty.websocket.common.WebSocketFrame
-
- org.eclipse.jetty.websocket.common.frames.ControlFrame
-
- All Implemented Interfaces:
Frame
- Direct Known Subclasses:
CloseFrame
,PingFrame
,PongFrame
public abstract class ControlFrame extends WebSocketFrame
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.api.extensions.Frame
Frame.Type
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_CONTROL_PAYLOAD
Maximum size of Control frame, per RFC 6455-
Fields inherited from class org.eclipse.jetty.websocket.common.WebSocketFrame
data, finRsvOp, mask, masked
-
-
Constructor Summary
Constructors Constructor Description ControlFrame(byte opcode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertValid()
boolean
equals(java.lang.Object obj)
java.nio.ByteBuffer
getPayload()
Get the payload ByteBuffer.boolean
isControlFrame()
boolean
isDataFrame()
WebSocketFrame
setPayload(java.nio.ByteBuffer buf)
Set the data payload.-
Methods inherited from class org.eclipse.jetty.websocket.common.WebSocketFrame
copy, copyHeaders, copyHeaders, getMask, getOpCode, getPayloadAsUTF8, getPayloadLength, getType, hashCode, hasPayload, isFin, isLast, isMasked, isRsv1, isRsv2, isRsv3, reset, setFin, setMask, setMasked, setOpCode, setRsv1, setRsv2, setRsv3, toString
-
-
-
-
Field Detail
-
MAX_CONTROL_PAYLOAD
public static final int MAX_CONTROL_PAYLOAD
Maximum size of Control frame, per RFC 6455- See Also:
- Constant Field Values
-
-
Method Detail
-
assertValid
public void assertValid()
- Specified by:
assertValid
in classWebSocketFrame
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classWebSocketFrame
-
isControlFrame
public boolean isControlFrame()
- Specified by:
isControlFrame
in classWebSocketFrame
-
isDataFrame
public boolean isDataFrame()
- Specified by:
isDataFrame
in classWebSocketFrame
-
setPayload
public WebSocketFrame setPayload(java.nio.ByteBuffer buf)
Description copied from class:WebSocketFrame
Set the data payload.The provided buffer will be used as is, no copying of bytes performed.
The provided buffer should be flipped and ready to READ from.
- Overrides:
setPayload
in classWebSocketFrame
- Parameters:
buf
- the bytebuffer to set- Returns:
- the frame itself
-
getPayload
public java.nio.ByteBuffer getPayload()
Description copied from class:WebSocketFrame
Get the payload ByteBuffer. possible null.- Specified by:
getPayload
in interfaceFrame
- Overrides:
getPayload
in classWebSocketFrame
-
-