Class GraphQLBrokerSubProtocolHandler
- java.lang.Object
-
- org.activiti.cloud.services.notifications.graphql.ws.transport.GraphQLBrokerSubProtocolHandler
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.web.socket.messaging.SubProtocolHandler
public class GraphQLBrokerSubProtocolHandler extends Object implements org.springframework.web.socket.messaging.SubProtocolHandler, org.springframework.context.ApplicationEventPublisherAware
-
-
Field Summary
Fields Modifier and Type Field Description static StringGRAPHQL_WSstatic intMINIMUM_WEBSOCKET_MESSAGE_SIZE
-
Constructor Summary
Constructors Constructor Description GraphQLBrokerSubProtocolHandler(String destination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterSessionEnded(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus, org.springframework.messaging.MessageChannel outputChannel)voidafterSessionStarted(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.MessageChannel outputChannel)longgetLoggingPeriod()Return the configured logging period frequency in milliseconds.List<String>getSupportedProtocols()voidhandleMessageFromClient(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> message, org.springframework.messaging.MessageChannel outputChannel)voidhandleMessageToClient(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.Message<?> message)StringresolveSessionId(org.springframework.messaging.Message<?> message)protected voidsendErrorMessage(org.springframework.web.socket.WebSocketSession session, Throwable error, GraphQLMessage message)Invoked to send an ERROR frame to the client.voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)voidsetLoggingPeriod(long period)Set the frequency for logging information at INFO level in milliseconds.
-
-
-
Field Detail
-
GRAPHQL_WS
public static final String GRAPHQL_WS
- See Also:
- Constant Field Values
-
MINIMUM_WEBSOCKET_MESSAGE_SIZE
public static final int MINIMUM_WEBSOCKET_MESSAGE_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphQLBrokerSubProtocolHandler
public GraphQLBrokerSubProtocolHandler(String destination)
-
-
Method Detail
-
getSupportedProtocols
public List<String> getSupportedProtocols()
- Specified by:
getSupportedProtocolsin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler
-
handleMessageFromClient
public void handleMessageFromClient(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> message, org.springframework.messaging.MessageChannel outputChannel) throws Exception- Specified by:
handleMessageFromClientin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler- Throws:
Exception
-
handleMessageToClient
public void handleMessageToClient(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.Message<?> message)- Specified by:
handleMessageToClientin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler
-
resolveSessionId
public String resolveSessionId(org.springframework.messaging.Message<?> message)
- Specified by:
resolveSessionIdin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler
-
afterSessionStarted
public void afterSessionStarted(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.MessageChannel outputChannel) throws Exception- Specified by:
afterSessionStartedin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler- Throws:
Exception
-
afterSessionEnded
public void afterSessionEnded(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus, org.springframework.messaging.MessageChannel outputChannel) throws Exception- Specified by:
afterSessionEndedin interfaceorg.springframework.web.socket.messaging.SubProtocolHandler- Throws:
Exception
-
sendErrorMessage
protected void sendErrorMessage(org.springframework.web.socket.WebSocketSession session, Throwable error, GraphQLMessage message)Invoked to send an ERROR frame to the client.
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
setLoggingPeriod
public void setLoggingPeriod(long period)
Set the frequency for logging information at INFO level in milliseconds. If set 0 or less than 0, the logging task is cancelled.By default this property is set to 5 minutes (5 * 60 * 1000).
-
getLoggingPeriod
public long getLoggingPeriod()
Return the configured logging period frequency in milliseconds.
-
-