Package io.vertx.reactivex.core.http
Class WebSocketFrame
- java.lang.Object
-
- io.vertx.reactivex.core.http.WebSocketFrame
-
public class WebSocketFrame extends Object
A WebSocket frame that represents either text or binary data.A WebSocket message is composed of one or more WebSocket frames.
If there is a just a single frame in the message then a single text or binary frame should be created with final = true.
If there are more than one frames in the message, then the first frame should be a text or binary frame with final = false, followed by one or more continuation frames. The last continuation frame should have final = true.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<WebSocketFrame>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description WebSocketFrame(WebSocketFrame delegate)
WebSocketFrame(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffer
binaryData()
static WebSocketFrame
binaryFrame(Buffer data, boolean isFinal)
Create a binary WebSocket frame.String
closeReason()
short
closeStatusCode()
static WebSocketFrame
continuationFrame(Buffer data, boolean isFinal)
Create a continuation frameboolean
equals(Object o)
WebSocketFrame
getDelegate()
int
hashCode()
boolean
isBinary()
boolean
isClose()
boolean
isContinuation()
boolean
isFinal()
boolean
isPing()
boolean
isText()
static WebSocketFrame
newInstance(WebSocketFrame arg)
static WebSocketFrame
pingFrame(Buffer data)
Create a ping WebSocket frame.static WebSocketFrame
pongFrame(Buffer data)
Create a pong WebSocket frame.String
textData()
static WebSocketFrame
textFrame(String str, boolean isFinal)
Create a text WebSocket frame.String
toString()
WebSocketFrameType
type()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<WebSocketFrame> __TYPE_ARG
-
-
Constructor Detail
-
WebSocketFrame
public WebSocketFrame(WebSocketFrame delegate)
-
WebSocketFrame
public WebSocketFrame(Object delegate)
-
-
Method Detail
-
getDelegate
public WebSocketFrame getDelegate()
-
binaryFrame
public static WebSocketFrame binaryFrame(Buffer data, boolean isFinal)
Create a binary WebSocket frame.- Parameters:
data
- the data for the frameisFinal
- true if it's the final frame in the WebSocket message- Returns:
- the frame
-
textFrame
public static WebSocketFrame textFrame(String str, boolean isFinal)
Create a text WebSocket frame.- Parameters:
str
- the string for the frameisFinal
- true if it's the final frame in the WebSocket message- Returns:
- the frame
-
pingFrame
public static WebSocketFrame pingFrame(Buffer data)
Create a ping WebSocket frame. Will be a final frame. There is no option for non final ping frames.- Parameters:
data
- the bytes for the frame, may be at most 125 bytes- Returns:
- the frame
-
pongFrame
public static WebSocketFrame pongFrame(Buffer data)
Create a pong WebSocket frame. Will be a final frame. There is no option for non final pong frames.- Parameters:
data
- the bytes for the frame, may be at most 125 bytes- Returns:
- the frame
-
continuationFrame
public static WebSocketFrame continuationFrame(Buffer data, boolean isFinal)
Create a continuation frame- Parameters:
data
- the data for the frameisFinal
- true if it's the final frame in the WebSocket message- Returns:
- the frame
-
type
public WebSocketFrameType type()
- Returns:
- the frame type
-
isText
public boolean isText()
- Returns:
- whether the frame is a frame
-
isBinary
public boolean isBinary()
- Returns:
- whether the frame is a frame
-
isContinuation
public boolean isContinuation()
- Returns:
- whether the frame is a frame
-
isClose
public boolean isClose()
- Returns:
- whether the frame is a frame
-
isPing
public boolean isPing()
- Returns:
- whether the frame is a frame
-
textData
public String textData()
- Returns:
- the content of this frame as a UTF-8 string and returns the converted string. Only use this for text frames.
-
binaryData
public Buffer binaryData()
- Returns:
- the data of the frame
-
isFinal
public boolean isFinal()
- Returns:
- true if this is the final frame.
-
closeStatusCode
public short closeStatusCode()
- Returns:
- status code of close frame. Only use this for close frames
-
closeReason
public String closeReason()
- Returns:
- string explaining close reason. Only use this for close frames
-
newInstance
public static WebSocketFrame newInstance(WebSocketFrame arg)
-
-