org.springframework.messaging.simp.user

## Class DefaultUserSessionRegistry

- java.lang.Object
- - org.springframework.messaging.simp.user.DefaultUserSessionRegistry

- All Implemented Interfaces:
    UserSessionRegistry

      public class DefaultUserSessionRegistry
      extends Object
      implements UserSessionRegistry

  A default thread-safe implementation of `UserSessionRegistry`.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultUserSessionRegistry()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `getSessionIds(String user)` Return the active session id's for the given user.
    `void` | `registerSessionId(String user, String sessionId)` Register an active session id for the given user.
    `void` | `unregisterSessionId(String userName, String sessionId)` Unregister the session id for a user.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultUserSessionRegistry

          public DefaultUserSessionRegistry()

  - ### Method Detail

    - #### getSessionIds

          public Set<String> getSessionIds(String user)

      Description copied from interface: `UserSessionRegistry`
      Return the active session id's for the given user.
      Specified by:
        `getSessionIds` in interface `UserSessionRegistry`
      Parameters:
        `user` - the user
      Returns:
        a set with 0 or more session id's

    - #### registerSessionId

          public void registerSessionId(String user,
                                        String sessionId)

      Description copied from interface: `UserSessionRegistry`
      Register an active session id for the given user.
      Specified by:
        `registerSessionId` in interface `UserSessionRegistry`
      Parameters:
        `user` - the user
        `sessionId` - the session id

    - #### unregisterSessionId

          public void unregisterSessionId(String userName,
                                          String sessionId)

      Description copied from interface: `UserSessionRegistry`
      Unregister the session id for a user.
      Specified by:
        `unregisterSessionId` in interface `UserSessionRegistry`
      Parameters:
        `userName` - the user
        `sessionId` - the session id