Class SockJsFrame
java.lang.Object
org.springframework.web.socket.sockjs.frame.SockJsFrame
Represents a SockJS frame. Provides factory methods to create SockJS frames.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSockJsFrame
(String content) Create a new instance frame with the given frame content. -
Method Summary
Modifier and TypeMethodDescriptionstatic SockJsFrame
closeFrame
(int code, String reason) static SockJsFrame
static SockJsFrame
boolean
Return the SockJS frame content (nevernull
).byte[]
Return the SockJS frame content as a byte array.Return data contained in a SockJS "message" and "close" frames.getType()
Return the SockJS frame type.int
hashCode()
static SockJsFrame
static SockJsFrame
messageFrame
(SockJsMessageCodec codec, String... messages) static SockJsFrame
toString()
-
Field Details
-
CHARSET
The charset used by SockJS.
-
-
Constructor Details
-
SockJsFrame
Create a new instance frame with the given frame content.- Parameters:
content
- the content (must be a non-empty and represent a valid SockJS frame)
-
-
Method Details
-
getType
Return the SockJS frame type. -
getContent
Return the SockJS frame content (nevernull
). -
getContentBytes
public byte[] getContentBytes()Return the SockJS frame content as a byte array. -
getFrameData
Return data contained in a SockJS "message" and "close" frames. Otherwise for SockJS "open" and "close" frames, which do not contain data, returnnull
. -
equals
-
hashCode
public int hashCode() -
toString
-
openFrame
-
heartbeatFrame
-
messageFrame
-
closeFrameGoAway
-
closeFrameAnotherConnectionOpen
-
closeFrame
-