类 SockJsFrame
- java.lang.Object
- org.springframework.web.socket.sockjs.frame.SockJsFrame
public class SockJsFrame extends Object
Represents a SockJS frame. Provides factory methods to create SockJS frames.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 SockJsFrame(String content)
Create a new instance frame with the given frame content.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static SockJsFrame
closeFrame(int code, String reason)
static SockJsFrame
closeFrameAnotherConnectionOpen()
static SockJsFrame
closeFrameGoAway()
boolean
equals(Object other)
String
getContent()
Return the SockJS frame content (nevernull
).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()
构造器详细资料
SockJsFrame
public SockJsFrame(String content)
Create a new instance frame with the given frame content.- 参数:
content
- the content (must be a non-empty and represent a valid SockJS frame)
方法详细资料
getType
public SockJsFrameType getType()
Return the SockJS frame type.
getContent
public String getContent()
Return the SockJS frame content (nevernull
).
getContentBytes
public byte[] getContentBytes()
Return the SockJS frame content as a byte array.
getFrameData
public String getFrameData()
Return data contained in a SockJS "message" and "close" frames. Otherwise for SockJS "open" and "close" frames, which do not contain data, returnnull
.
openFrame
public static SockJsFrame openFrame()
heartbeatFrame
public static SockJsFrame heartbeatFrame()
messageFrame
public static SockJsFrame messageFrame(SockJsMessageCodec codec, String... messages)
closeFrameGoAway
public static SockJsFrame closeFrameGoAway()
closeFrameAnotherConnectionOpen
public static SockJsFrame closeFrameAnotherConnectionOpen()
closeFrame
public static SockJsFrame closeFrame(int code, String reason)