org.springframework.web.socket.messaging

## Class DefaultSimpUserRegistry

- java.lang.Object
- - org.springframework.web.socket.messaging.DefaultSimpUserRegistry

All Implemented Interfaces:
  EventListener, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.context.event.SmartApplicationListener, org.springframework.core.Ordered, org.springframework.messaging.simp.user.SimpUserRegistry

    public class DefaultSimpUserRegistry
    extends Object
    implements org.springframework.messaging.simp.user.SimpUserRegistry, org.springframework.context.event.SmartApplicationListener

A default implementation of `SimpUserRegistry` that relies on `AbstractSubProtocolEvent` application context events to keep track of connected users and their subscriptions.

Since:
  4.2
Author:
  Rossen Stoyanchev

### Field Summary

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

### Constructor Summary

Constructors
Constructor and Description
`DefaultSimpUserRegistry()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Set<org.springframework.messaging.simp.user.SimpSubscription>` `findSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher)`
`int` `getOrder()`
`org.springframework.messaging.simp.user.SimpUser` `getUser(String userName)`
`int` `getUserCount()`
`Set<org.springframework.messaging.simp.user.SimpUser>` `getUsers()`
`void` `onApplicationEvent(org.springframework.context.ApplicationEvent event)`
`void` `setOrder(int order)` Specify the order value for this registry.
`boolean` `supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)`
`boolean` `supportsSourceType(Class<?> sourceType)`
`String` `toString()`

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

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

### Constructor Detail

#### DefaultSimpUserRegistry

    public DefaultSimpUserRegistry()

### Method Detail

#### setOrder

    public void setOrder(int order)

Specify the order value for this registry.

Default is `Ordered.LOWEST_PRECEDENCE`.

Since:
  5.0.8

#### getOrder

    public int getOrder()

Specified by:
  `getOrder` in interface `org.springframework.context.event.SmartApplicationListener`
Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`

#### supportsEventType

    public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)

Specified by:
  `supportsEventType` in interface `org.springframework.context.event.SmartApplicationListener`

#### onApplicationEvent

    public void onApplicationEvent(org.springframework.context.ApplicationEvent event)

Specified by:
  `onApplicationEvent` in interface `org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>`

#### supportsSourceType

    public boolean supportsSourceType(@Nullable
                                      Class<?> sourceType)

Specified by:
  `supportsSourceType` in interface `org.springframework.context.event.SmartApplicationListener`

#### getUser

    @Nullable
    public org.springframework.messaging.simp.user.SimpUser getUser(String userName)

Specified by:
  `getUser` in interface `org.springframework.messaging.simp.user.SimpUserRegistry`

#### getUsers

    public Set<org.springframework.messaging.simp.user.SimpUser> getUsers()

Specified by:
  `getUsers` in interface `org.springframework.messaging.simp.user.SimpUserRegistry`

#### getUserCount

    public int getUserCount()

Specified by:
  `getUserCount` in interface `org.springframework.messaging.simp.user.SimpUserRegistry`

#### findSubscriptions

    public Set<org.springframework.messaging.simp.user.SimpSubscription> findSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher)

Specified by:
  `findSubscriptions` in interface `org.springframework.messaging.simp.user.SimpUserRegistry`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`