public class DefaultSimpUserRegistry extends Object implements SimpUserRegistry, SmartApplicationListener
SimpUserRegistry that relies on
 AbstractSubProtocolEvent application context events to keep
 track of connected users and their subscriptions.HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description | 
|---|
| DefaultSimpUserRegistry() | 
| Modifier and Type | Method and Description | 
|---|---|
| Set<SimpSubscription> | findSubscriptions(SimpSubscriptionMatcher matcher)Find subscriptions with the given matcher. | 
| int | getOrder()Determine this listener's order in a set of listeners for the same event. | 
| SimpUser | getUser(String userName)Get the user for the given name. | 
| int | getUserCount()Return the count of all connected users. | 
| Set<SimpUser> | getUsers()Return a snapshot of all connected users. | 
| void | onApplicationEvent(ApplicationEvent event)Handle an application event. | 
| void | setOrder(int order)Specify the order value for this registry. | 
| boolean | supportsEventType(Class<? extends ApplicationEvent> eventType)Determine whether this listener actually supports the given event type. | 
| boolean | supportsSourceType(Class<?> sourceType)Determine whether this listener actually supports the given source type. | 
| String | toString() | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetListenerIdforPayloadpublic void setOrder(int order)
Default is Ordered.LOWEST_PRECEDENCE.
public int getOrder()
SmartApplicationListenerThe default implementation returns Ordered.LOWEST_PRECEDENCE.
getOrder in interface SmartApplicationListenergetOrder in interface OrderedOrdered.HIGHEST_PRECEDENCE, 
Ordered.LOWEST_PRECEDENCEpublic boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
SmartApplicationListenersupportsEventType in interface SmartApplicationListenereventType - the event type (never null)public void onApplicationEvent(ApplicationEvent event)
ApplicationListeneronApplicationEvent in interface ApplicationListener<ApplicationEvent>event - the event to respond topublic boolean supportsSourceType(@Nullable Class<?> sourceType)
SmartApplicationListenerThe default implementation always returns true.
supportsSourceType in interface SmartApplicationListenersourceType - the source type, or null if no source@Nullable public SimpUser getUser(String userName)
SimpUserRegistrygetUser in interface SimpUserRegistryuserName - the name of the user to look upnull if not connectedpublic Set<SimpUser> getUsers()
SimpUserRegistryThe returned set is a copy and will not reflect further changes.
getUsers in interface SimpUserRegistrypublic int getUserCount()
SimpUserRegistrygetUserCount in interface SimpUserRegistrypublic Set<SimpSubscription> findSubscriptions(SimpSubscriptionMatcher matcher)
SimpUserRegistryfindSubscriptions in interface SimpUserRegistrymatcher - the matcher to use