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, Sam Brannen
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.springframework.messaging.simp.user.SimpSubscription> findSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher) intgetOrder()@Nullable org.springframework.messaging.simp.user.SimpUserintSet<org.springframework.messaging.simp.user.SimpUser> getUsers()voidonApplicationEvent(org.springframework.context.ApplicationEvent event) voidsetOrder(int order) Specify the order value for this registry.booleansupportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) booleansupportsSourceType(@Nullable Class<?> sourceType) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.springframework.context.event.SmartApplicationListener
getListenerId
-
Constructor Details
-
DefaultSimpUserRegistry
public DefaultSimpUserRegistry()
-
-
Method Details
-
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:
getOrderin interfaceorg.springframework.core.Ordered- Specified by:
getOrderin interfaceorg.springframework.context.event.SmartApplicationListener
-
supportsEventType
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) - Specified by:
supportsEventTypein interfaceorg.springframework.context.event.SmartApplicationListener
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
-
supportsSourceType
-
getUser
-
getUsers
- Specified by:
getUsersin interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
getUserCount
public int getUserCount()- Specified by:
getUserCountin interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
findSubscriptions
public Set<org.springframework.messaging.simp.user.SimpSubscription> findSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher) - Specified by:
findSubscriptionsin interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
toString
-