Class AbstractSubProtocolEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.web.socket.messaging.AbstractSubProtocolEvent
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- SessionConnectedEvent,- SessionConnectEvent,- SessionDisconnectEvent,- SessionSubscribeEvent,- SessionUnsubscribeEvent
A base class for events for a message received from a WebSocket client and
 parsed into a higher-level sub-protocol (e.g. STOMP).
- Since:
- 4.1
- Author:
- Rossen Stoyanchev
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractSubProtocolEvent(Object source, Message<byte[]> message) Create a new AbstractSubProtocolEvent.protectedAbstractSubProtocolEvent(Object source, Message<byte[]> message, Principal user) Create a new AbstractSubProtocolEvent.
- 
Method SummaryMethods inherited from class org.springframework.context.ApplicationEventgetTimestampMethods inherited from class java.util.EventObjectgetSource
- 
Constructor Details- 
AbstractSubProtocolEventCreate a new AbstractSubProtocolEvent.- Parameters:
- source- the component that published the event (never- null)
- message- the incoming message (never- null)
 
- 
AbstractSubProtocolEventprotected AbstractSubProtocolEvent(Object source, Message<byte[]> message, @Nullable Principal user) Create a new AbstractSubProtocolEvent.- Parameters:
- source- the component that published the event (never- null)
- message- the incoming message (never- null)
 
 
- 
- 
Method Details- 
getMessageReturn 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(); 
- 
getUserReturn the user for the session associated with the event.
- 
toString- Overrides:
- toStringin class- EventObject
 
 
-