Interface SessionManagementService
- All Known Implementing Classes:
AbstractSessionManagementService,DefaultSessionManagementService,ExternalBrokerSessionManagementService
public interface SessionManagementService
Service contract for managing websocket sessions.
Each method is documented to improve generated JavaDoc and maintainability.
-
Method Summary
Modifier and TypeMethodDescriptionintgetUserSessionCount(UUID userId) Returns the count of sessions for the provider user idbooleanisUserOnline(UUID userId) Returns if the user has any active session and so is considered as online.onSessionCreated(String sessionId, WebSocketUser user) Callback method to call when a user connects to a web socket session.onSessionDestroyed(String sessionId) Callback method to call when a user disconnects from a web socket session.
-
Method Details
-
onSessionCreated
Callback method to call when a user connects to a web socket session.- Parameters:
sessionId- the STOMP session iduser- the connected user- Returns:
- the
Userentity if it was updated, null otherwise
-
onSessionDestroyed
Callback method to call when a user disconnects from a web socket session.- Parameters:
sessionId- the STOMP session id- Returns:
- the
Userentity if it was updated, null otherwise
-
isUserOnline
Returns if the user has any active session and so is considered as online.- Parameters:
userId- the user id- Returns:
trueif online,falseotherwise
-
getUserSessionCount
Returns the count of sessions for the provider user id- Parameters:
userId- the user id- Returns:
- the session count
-