Package io.smallrye.graphql.websocket
Class AbstractGraphQLWebsocketHandler
- java.lang.Object
-
- io.smallrye.graphql.websocket.AbstractGraphQLWebsocketHandler
-
- All Implemented Interfaces:
GraphQLWebsocketHandler
- Direct Known Subclasses:
GraphQLTransportWSSubprotocolHandler
,GraphQLWSSubprotocolHandler
public abstract class AbstractGraphQLWebsocketHandler extends Object implements GraphQLWebsocketHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.reactivestreams.Subscriber<graphql.ExecutionResult>>
activeOperations
protected String
connectionAckMessage
protected AtomicBoolean
connectionInitialized
protected ExecutionService
executionService
protected io.smallrye.mutiny.subscription.Cancellable
keepAliveSender
protected org.jboss.logging.Logger
LOG
protected GraphQLWebSocketSession
session
-
Constructor Summary
Constructors Constructor Description AbstractGraphQLWebsocketHandler(GraphQLWebSocketSession session, String dataMessageTypeName, Map<String,Object> context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
closeDueToConnectionNotInitialized()
Map<String,Object>
getContext()
protected abstract String
getPingMessage()
void
onClose()
void
onEnd()
protected abstract void
onMessage(jakarta.json.JsonObject message)
void
onMessage(String text)
Called when a message arrives and needs to be handled.protected void
onOperationRequest(jakarta.json.JsonObject message)
void
onThrowable(Throwable t)
protected void
sendCancelMessage(jakarta.json.JsonObject message)
protected void
sendConnectionAckMessage()
protected abstract void
sendErrorMessage(String operationId, ExecutionResponse executionResponse)
-
-
-
Field Detail
-
LOG
protected final org.jboss.logging.Logger LOG
-
executionService
protected final ExecutionService executionService
-
session
protected final GraphQLWebSocketSession session
-
connectionInitialized
protected final AtomicBoolean connectionInitialized
-
connectionAckMessage
protected final String connectionAckMessage
-
activeOperations
protected final Map<String,org.reactivestreams.Subscriber<graphql.ExecutionResult>> activeOperations
-
keepAliveSender
protected final io.smallrye.mutiny.subscription.Cancellable keepAliveSender
-
-
Constructor Detail
-
AbstractGraphQLWebsocketHandler
public AbstractGraphQLWebsocketHandler(GraphQLWebSocketSession session, String dataMessageTypeName, Map<String,Object> context)
-
-
Method Detail
-
onMessage
public void onMessage(String text)
Description copied from interface:GraphQLWebsocketHandler
Called when a message arrives and needs to be handled. Implementation of this method MUST NOT block the calling thread!- Specified by:
onMessage
in interfaceGraphQLWebsocketHandler
-
onThrowable
public void onThrowable(Throwable t)
- Specified by:
onThrowable
in interfaceGraphQLWebsocketHandler
-
onClose
public void onClose()
- Specified by:
onClose
in interfaceGraphQLWebsocketHandler
-
onEnd
public void onEnd()
- Specified by:
onEnd
in interfaceGraphQLWebsocketHandler
-
sendConnectionAckMessage
protected void sendConnectionAckMessage() throws IOException
- Throws:
IOException
-
onOperationRequest
protected void onOperationRequest(jakarta.json.JsonObject message)
-
sendCancelMessage
protected void sendCancelMessage(jakarta.json.JsonObject message)
-
onMessage
protected abstract void onMessage(jakarta.json.JsonObject message)
-
sendErrorMessage
protected abstract void sendErrorMessage(String operationId, ExecutionResponse executionResponse) throws IOException
- Throws:
IOException
-
closeDueToConnectionNotInitialized
protected abstract void closeDueToConnectionNotInitialized()
-
getPingMessage
protected abstract String getPingMessage()
-
-