public class GraphQlWebSocketHandler extends TextWebSocketHandler implements SubProtocolCapable
spring-websocket
.Constructor and Description |
---|
GraphQlWebSocketHandler(WebGraphQlHandler graphQlHandler,
HttpMessageConverter<?> converter,
Duration connectionInitTimeout)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConnectionClosed(WebSocketSession session,
CloseStatus closeStatus) |
void |
afterConnectionEstablished(WebSocketSession session) |
List<String> |
getSubProtocols() |
protected void |
handleTextMessage(WebSocketSession session,
TextMessage message) |
void |
handleTransportError(WebSocketSession session,
Throwable exception) |
boolean |
supportsPartialMessages() |
handleBinaryMessage
handleMessage, handlePongMessage
public GraphQlWebSocketHandler(WebGraphQlHandler graphQlHandler, HttpMessageConverter<?> converter, Duration connectionInitTimeout)
graphQlHandler
- common handler for GraphQL over HTTP requestsconverter
- for JSON encoding and decodingconnectionInitTimeout
- the time within which the CONNECTION_INIT
type
message must be received.public List<String> getSubProtocols()
getSubProtocols
in interface SubProtocolCapable
public void afterConnectionEstablished(WebSocketSession session)
afterConnectionEstablished
in interface WebSocketHandler
afterConnectionEstablished
in class AbstractWebSocketHandler
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception
handleTextMessage
in class AbstractWebSocketHandler
Exception
public void handleTransportError(WebSocketSession session, Throwable exception)
handleTransportError
in interface WebSocketHandler
handleTransportError
in class AbstractWebSocketHandler
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus)
afterConnectionClosed
in interface WebSocketHandler
afterConnectionClosed
in class AbstractWebSocketHandler
public boolean supportsPartialMessages()
supportsPartialMessages
in interface WebSocketHandler
supportsPartialMessages
in class AbstractWebSocketHandler