Class GraphQLBrokerSubProtocolHandler

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.web.socket.messaging.SubProtocolHandler

    public class GraphQLBrokerSubProtocolHandler
    extends java.lang.Object
    implements org.springframework.web.socket.messaging.SubProtocolHandler, org.springframework.context.ApplicationEventPublisherAware
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterSessionEnded​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus, org.springframework.messaging.MessageChannel outputChannel)  
      void afterSessionStarted​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.MessageChannel outputChannel)  
      long getLoggingPeriod()
      Return the configured logging period frequency in milliseconds.
      java.util.List<java.lang.String> getSupportedProtocols()  
      void handleMessageFromClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> message, org.springframework.messaging.MessageChannel outputChannel)  
      void handleMessageToClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.Message<?> message)  
      java.lang.String resolveSessionId​(org.springframework.messaging.Message<?> message)  
      protected void sendErrorMessage​(org.springframework.web.socket.WebSocketSession session, java.lang.Throwable error, org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage message)
      Invoked to send an ERROR frame to the client.
      void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)  
      void setLoggingPeriod​(long period)
      Set the frequency for logging information at INFO level in milliseconds.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MINIMUM_WEBSOCKET_MESSAGE_SIZE

        public static final int MINIMUM_WEBSOCKET_MESSAGE_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • GraphQLBrokerSubProtocolHandler

        public GraphQLBrokerSubProtocolHandler​(java.lang.String destination)
    • Method Detail

      • getSupportedProtocols

        public java.util.List<java.lang.String> getSupportedProtocols()
        Specified by:
        getSupportedProtocols in interface org.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 java.lang.Exception
        Specified by:
        handleMessageFromClient in interface org.springframework.web.socket.messaging.SubProtocolHandler
        Throws:
        java.lang.Exception
      • handleMessageToClient

        public void handleMessageToClient​(org.springframework.web.socket.WebSocketSession session,
                                          org.springframework.messaging.Message<?> message)
        Specified by:
        handleMessageToClient in interface org.springframework.web.socket.messaging.SubProtocolHandler
      • resolveSessionId

        public java.lang.String resolveSessionId​(org.springframework.messaging.Message<?> message)
        Specified by:
        resolveSessionId in interface org.springframework.web.socket.messaging.SubProtocolHandler
      • afterSessionStarted

        public void afterSessionStarted​(org.springframework.web.socket.WebSocketSession session,
                                        org.springframework.messaging.MessageChannel outputChannel)
                                 throws java.lang.Exception
        Specified by:
        afterSessionStarted in interface org.springframework.web.socket.messaging.SubProtocolHandler
        Throws:
        java.lang.Exception
      • afterSessionEnded

        public void afterSessionEnded​(org.springframework.web.socket.WebSocketSession session,
                                      org.springframework.web.socket.CloseStatus closeStatus,
                                      org.springframework.messaging.MessageChannel outputChannel)
                               throws java.lang.Exception
        Specified by:
        afterSessionEnded in interface org.springframework.web.socket.messaging.SubProtocolHandler
        Throws:
        java.lang.Exception
      • sendErrorMessage

        protected void sendErrorMessage​(org.springframework.web.socket.WebSocketSession session,
                                        java.lang.Throwable error,
                                        org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage message)
        Invoked to send an ERROR frame to the client.
      • setApplicationEventPublisher

        public void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
        Specified by:
        setApplicationEventPublisher in interface org.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.