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.ApplicationEventA base class for events for a message received from a WebSocket client and parsed into a higher-level GraphQL WS sub-protocol.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGraphQLSubProtocolEvent(Object source, org.springframework.messaging.Message<GraphQLMessage> message)Create a new AbstractGraphQLSubProtocolEvent.protectedAbstractGraphQLSubProtocolEvent(Object source, org.springframework.messaging.Message<GraphQLMessage> message, Principal user)Create a new AbstractGraphQLSubProtocolEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.messaging.Message<GraphQLMessage>getMessage()Return the Message associated with the event.PrincipalgetUser()Return the user for the session associated with the event.StringtoString()-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Constructor Detail
-
AbstractGraphQLSubProtocolEvent
protected AbstractGraphQLSubProtocolEvent(Object source, org.springframework.messaging.Message<GraphQLMessage> message)
Create a new AbstractGraphQLSubProtocolEvent.- Parameters:
source- the component that published the event (nevernull)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 (nevernull)message- the incoming message
-
-
Method Detail
-
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:
toStringin classEventObject
-
-