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:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGraphQLSubProtocolEvent(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
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<GraphQLMessage> Return the Message associated with the event.getUser()Return the user for the session associated with the event.toString()Methods inherited from class org.springframework.context.ApplicationEvent
getTimestampMethods inherited from class java.util.EventObject
getSource
-
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 (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 Details
-
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
Return the user for the session associated with the event. -
toString
- Overrides:
toStringin classEventObject
-