Class GraphQlWebSocketMessage
java.lang.Object
org.springframework.graphql.server.support.GraphQlWebSocketMessage
Represents a GraphQL over WebSocket protocol message.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic GraphQlWebSocketMessageCreate a"complete"server message.static GraphQlWebSocketMessageconnectionAck(Object payload) Create a"connection_ack"server message.static GraphQlWebSocketMessageconnectionInit(Object payload) Create a"connection_init"client message.booleanstatic GraphQlWebSocketMessageCreate an"error"server message.getId()Return the request id that is applicable to messages associated with a request, ornullfor connection level messages.<P> PReturn the payload.getType()Return the message type value as it should appear on the wire.inthashCode()static GraphQlWebSocketMessageCreate a"next"server message.static GraphQlWebSocketMessageCreate a"ping"client or server message.static GraphQlWebSocketMessageCreate a"pong"client or server message.Return the message type as an enum.voidvoidsetPayload(Object payload) voidstatic GraphQlWebSocketMessagesubscribe(String id, GraphQlRequest request) Create a"subscribe"client message.toString()
- 
Method Details- 
getId
- 
getTypeReturn the message type value as it should appear on the wire.
- 
resolvedTypeReturn the message type as an enum.
- 
getPayloadpublic <P> P getPayload()Return the payload. For a deserialized message, this is typically aMaporListfor an"error"message.- Type Parameters:
- P- teh payload type
 
- 
setId
- 
setType
- 
setPayload
- 
equals
- 
hashCode
- 
toString
- 
connectionInitCreate a"connection_init"client message.- Parameters:
- payload- an optional payload
 
- 
connectionAckCreate a"connection_ack"server message.- Parameters:
- payload- an optional payload
 
- 
subscribeCreate a"subscribe"client message.- Parameters:
- id- unique request id
- request- the request to add as the message payload
 
- 
nextCreate a"next"server message.- Parameters:
- id- unique request id
- responseMap- the response map
 
- 
errorCreate an"error"server message.- Parameters:
- id- unique request id
- errors- the error to add as the message payload
 
- 
completeCreate a"complete"server message.- Parameters:
- id- unique request id
 
- 
pingCreate a"ping"client or server message.- Parameters:
- payload- an optional payload
 
- 
pongCreate a"pong"client or server message.- Parameters:
- payload- an optional payload
 
 
-