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
-
Method Summary
Modifier and TypeMethodDescriptionSet<org.springframework.messaging.simp.user.SimpSubscription>
findSubscriptions
(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher) int
getOrder()
org.springframework.messaging.simp.user.SimpUser
int
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) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
getOrder
in interfaceorg.springframework.core.Ordered
- Specified by:
getOrder
in interfaceorg.springframework.context.event.SmartApplicationListener
-
supportsEventType
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) - Specified by:
supportsEventType
in interfaceorg.springframework.context.event.SmartApplicationListener
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event) - Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
-
supportsSourceType
- Specified by:
supportsSourceType
in interfaceorg.springframework.context.event.SmartApplicationListener
-
getUser
- Specified by:
getUser
in interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
getUsers
- Specified by:
getUsers
in interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
getUserCount
public int getUserCount()- Specified by:
getUserCount
in 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:
findSubscriptions
in interfaceorg.springframework.messaging.simp.user.SimpUserRegistry
-
toString
-