Package org.springframework.web.socket
Class PingMessage
- java.lang.Object
- org.springframework.web.socket.AbstractWebSocketMessage<ByteBuffer>
- org.springframework.web.socket.PingMessage
- All Implemented Interfaces:
WebSocketMessage<ByteBuffer>
public final class PingMessage extends AbstractWebSocketMessage<ByteBuffer>
A WebSocket ping message.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description PingMessage()Create a new ping message with an empty payload.PingMessage(ByteBuffer payload)Create a new ping message with the given ByteBuffer payload.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPayloadLength()Return the number of bytes contained in the message.protected StringtoStringPayload()Methods inherited from class org.springframework.web.socket.AbstractWebSocketMessage
equals, getPayload, hashCode, isLast, toString
Constructor Detail
PingMessage
public PingMessage()
Create a new ping message with an empty payload.
PingMessage
public PingMessage(ByteBuffer payload)
Create a new ping message with the given ByteBuffer payload.- Parameters:
payload- the non-null payload
Method Detail
getPayloadLength
public int getPayloadLength()
Description copied from interface:WebSocketMessageReturn the number of bytes contained in the message.
toStringPayload
protected String toStringPayload()
- Specified by:
toStringPayloadin classAbstractWebSocketMessage<ByteBuffer>