public class SessionConnectEvent extends ApplicationEvent
Note that this is not the same as the WebSocket session getting established but rather the client's first attempt to connect within the the sub-protocol, for example sending the STOMP CONNECT frame.
The provided message
can be examined to check
information about the connected user, The session id, and any headers
sent by the client, for STOMP check the class
StompHeaderAccessor
.
For example:
StompHeaderAccessor headers = StompHeaderAccessor.wrap(message); headers.getSessionId(); headers.getSessionAttributes(); headers.getPrincipal();
Constructor and Description |
---|
SessionConnectEvent(java.lang.Object source,
Message<byte[]> message)
Create a new SessionConnectEvent.
|
Modifier and Type | Method and Description |
---|---|
Message<byte[]> |
getMessage()
Return the connect message.
|
java.lang.String |
toString() |
getTimestamp
private final Message<byte[]> message
public SessionConnectEvent(java.lang.Object source, Message<byte[]> message)
source
- the component that published the event (never null
)message
- the connect messagepublic Message<byte[]> getMessage()
public java.lang.String toString()
toString
in class java.util.EventObject