Class AbstractGraphQLSubProtocolEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.springframework.context.ApplicationEvent
-
- org.activiti.cloud.services.notifications.graphql.ws.transport.AbstractGraphQLSubProtocolEvent
-
- All Implemented Interfaces:
java.io.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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGraphQLSubProtocolEvent(java.lang.Object source, org.springframework.messaging.Message<org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage> message)Create a new AbstractGraphQLSubProtocolEvent.protectedAbstractGraphQLSubProtocolEvent(java.lang.Object source, org.springframework.messaging.Message<org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage> message, java.security.Principal user)Create a new AbstractGraphQLSubProtocolEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.messaging.Message<org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage>getMessage()Return the Message associated with the event.java.security.PrincipalgetUser()Return the user for the session associated with the event.java.lang.StringtoString()
-
-
-
Constructor Detail
-
AbstractGraphQLSubProtocolEvent
protected AbstractGraphQLSubProtocolEvent(java.lang.Object source, org.springframework.messaging.Message<org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage> message)Create a new AbstractGraphQLSubProtocolEvent.- Parameters:
source- the component that published the event (nevernull)message- the incoming message
-
AbstractGraphQLSubProtocolEvent
protected AbstractGraphQLSubProtocolEvent(java.lang.Object source, org.springframework.messaging.Message<org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage> message, java.security.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<org.activiti.cloud.services.notifications.graphql.ws.api.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 java.security.Principal getUser()
Return the user for the session associated with the event.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.EventObject
-
-