public class DefaultSimpUserRegistry extends Object implements org.springframework.messaging.simp.user.SimpUserRegistry, org.springframework.context.event.SmartApplicationListener
SimpUserRegistry
that relies on
AbstractSubProtocolEvent
application context events to keep
track of connected users and their subscriptions.Constructor and Description |
---|
DefaultSimpUserRegistry() |
Modifier and Type | Method and Description |
---|---|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public void setOrder(int order)
Default is Ordered.LOWEST_PRECEDENCE
.
public int getOrder()
getOrder
in interface org.springframework.context.event.SmartApplicationListener
getOrder
in interface org.springframework.core.Ordered
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
supportsEventType
in interface org.springframework.context.event.SmartApplicationListener
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
public boolean supportsSourceType(@Nullable Class<?> sourceType)
supportsSourceType
in interface org.springframework.context.event.SmartApplicationListener
@Nullable public org.springframework.messaging.simp.user.SimpUser getUser(String userName)
getUser
in interface org.springframework.messaging.simp.user.SimpUserRegistry
public Set<org.springframework.messaging.simp.user.SimpUser> getUsers()
getUsers
in interface org.springframework.messaging.simp.user.SimpUserRegistry
public int getUserCount()
getUserCount
in interface org.springframework.messaging.simp.user.SimpUserRegistry
public Set<org.springframework.messaging.simp.user.SimpSubscription> findSubscriptions(org.springframework.messaging.simp.user.SimpSubscriptionMatcher matcher)
findSubscriptions
in interface org.springframework.messaging.simp.user.SimpUserRegistry