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 SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionSockJsFrame(String content) Create a new instance frame with the given frame content.
- 
Method SummaryModifier and TypeMethodDescriptionstatic SockJsFramecloseFrame(int code, @Nullable String reason) static SockJsFramestatic SockJsFramebooleanReturn 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.inthashCode()static SockJsFramestatic SockJsFramemessageFrame(SockJsMessageCodec codec, String... messages) static SockJsFrametoString()
- 
Field Details- 
CHARSETThe charset used by SockJS.
 
- 
- 
Constructor Details- 
SockJsFrameCreate 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- 
getTypeReturn the SockJS frame type.
- 
getContentReturn the SockJS frame content (nevernull).
- 
getContentBytespublic byte[] getContentBytes()Return the SockJS frame content as a byte array.
- 
getFrameDataReturn data contained in a SockJS "message" and "close" frames. Otherwise for SockJS "open" and "close" frames, which do not contain data, returnnull.
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
openFrame
- 
heartbeatFrame
- 
messageFrame
- 
closeFrameGoAway
- 
closeFrameAnotherConnectionOpen
- 
closeFrame
 
-