Class AbstractGraphQLSubProtocolEvent

java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.activiti.cloud.services.notifications.graphql.ws.transport.AbstractGraphQLSubProtocolEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GraphQLSessionConnectEvent, GraphQLSessionDisconnectEvent, GraphQLSessionSubscribeEvent, GraphQLSessionUnsubscribeEvent

public abstract class AbstractGraphQLSubProtocolEvent extends org.springframework.context.ApplicationEvent
A base class for events for a message received from a WebSocket client and parsed into a higher-level GraphQL WS sub-protocol.
See Also:
  • Constructor Details

    • AbstractGraphQLSubProtocolEvent

      protected AbstractGraphQLSubProtocolEvent(Object source, org.springframework.messaging.Message<GraphQLMessage> message)
      Create a new AbstractGraphQLSubProtocolEvent.
      Parameters:
      source - the component that published the event (never null)
      message - the incoming message
    • AbstractGraphQLSubProtocolEvent

      protected AbstractGraphQLSubProtocolEvent(Object source, org.springframework.messaging.Message<GraphQLMessage> message, Principal user)
      Create a new AbstractGraphQLSubProtocolEvent.
      Parameters:
      source - the component that published the event (never null)
      message - the incoming message
  • Method Details

    • getMessage

      public org.springframework.messaging.Message<GraphQLMessage> getMessage()
      Return the Message associated with the event. Here is an example of obtaining information about the session id or any headers in the message:
       StompHeaderAccessor headers = StompHeaderAccessor.wrap(message);
       headers.getSessionId();
       headers.getSessionAttributes();
       headers.getPrincipal();
       
    • getUser

      public Principal getUser()
      Return the user for the session associated with the event.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject