public class SockJsFrame extends Object
Modifier and Type | Field and Description |
---|---|
static Charset |
CHARSET
The charset used by SockJS.
|
Constructor and Description |
---|
SockJsFrame(String content)
Create a new instance frame with the given frame content.
|
Modifier and Type | Method and Description |
---|---|
static SockJsFrame |
closeFrame(int code,
String reason) |
static SockJsFrame |
closeFrameAnotherConnectionOpen() |
static SockJsFrame |
closeFrameGoAway() |
boolean |
equals(Object other) |
String |
getContent()
Return the SockJS frame content (never
null ). |
byte[] |
getContentBytes()
Return the SockJS frame content as a byte array.
|
String |
getFrameData()
Return data contained in a SockJS "message" and "close" frames.
|
SockJsFrameType |
getType()
Return the SockJS frame type.
|
int |
hashCode() |
static SockJsFrame |
heartbeatFrame() |
static SockJsFrame |
messageFrame(SockJsMessageCodec codec,
String... messages) |
static SockJsFrame |
openFrame() |
String |
toString() |
public static final Charset CHARSET
public SockJsFrame(String content)
content
- the content (must be a non-empty and represent a valid SockJS frame)public SockJsFrameType getType()
public String getContent()
null
).public byte[] getContentBytes()
@Nullable public String getFrameData()
null
.public static SockJsFrame openFrame()
public static SockJsFrame heartbeatFrame()
public static SockJsFrame messageFrame(SockJsMessageCodec codec, String... messages)
public static SockJsFrame closeFrameGoAway()
public static SockJsFrame closeFrameAnotherConnectionOpen()
public static SockJsFrame closeFrame(int code, @Nullable String reason)