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 Type
    Method
    Description
    int
    Returns the count of sessions for the provider user id
    boolean
    Returns if the user has any active session and so is considered as online.
    Callback method to call when a user connects to a web socket session.
    Callback method to call when a user disconnects from a web socket session.
  • Method Details

    • onSessionCreated

      User onSessionCreated(@NonNull String sessionId, @NonNull WebSocketUser user)
      Callback method to call when a user connects to a web socket session.
      Parameters:
      sessionId - the STOMP session id
      user - the connected user
      Returns:
      the User entity if it was updated, null otherwise
    • onSessionDestroyed

      User onSessionDestroyed(@NonNull String sessionId)
      Callback method to call when a user disconnects from a web socket session.
      Parameters:
      sessionId - the STOMP session id
      Returns:
      the User entity if it was updated, null otherwise
    • isUserOnline

      boolean isUserOnline(@NonNull UUID userId)
      Returns if the user has any active session and so is considered as online.
      Parameters:
      userId - the user id
      Returns:
      true if online, false otherwise
    • getUserSessionCount

      int getUserSessionCount(@NonNull UUID userId)
      Returns the count of sessions for the provider user id
      Parameters:
      userId - the user id
      Returns:
      the session count