Class SessionDisconnectEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.web.socket.messaging.AbstractSubProtocolEvent
org.springframework.web.socket.messaging.SessionDisconnectEvent
- All Implemented Interfaces:
- Serializable
Event raised when the session of a WebSocket client using a Simple Messaging
 Protocol (for example, STOMP) as the WebSocket sub-protocol is closed.
 
Note that this event may be raised more than once for a single session and therefore event consumers should be idempotent and ignore a duplicate event.
- Since:
- 4.0.3
- Author:
- Rossen Stoyanchev
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionSessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus) Create a new SessionDisconnectEvent.SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus, @Nullable Principal user) Create a new SessionDisconnectEvent.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the status with which the session was closed.Return the session id.toString()Methods inherited from class org.springframework.web.socket.messaging.AbstractSubProtocolEventgetMessage, getUserMethods inherited from class org.springframework.context.ApplicationEventgetTimestampMethods inherited from class java.util.EventObjectgetSource
- 
Constructor Details- 
SessionDisconnectEventpublic SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus) Create a new SessionDisconnectEvent.- Parameters:
- source- the component that published the event (never- null)
- message- the message (never- null)
- sessionId- the disconnect message
- closeStatus- the status object
 
- 
SessionDisconnectEventpublic SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus, @Nullable Principal user) Create a new SessionDisconnectEvent.- Parameters:
- source- the component that published the event (never- null)
- message- the message (never- null)
- sessionId- the disconnect message
- closeStatus- the status object
- user- the current session user
 
 
- 
- 
Method Details- 
getSessionIdReturn the session id.
- 
getCloseStatusReturn the status with which the session was closed.
- 
toString- Overrides:
- toStringin class- AbstractSubProtocolEvent
 
 
-