SimpUserRegistry that relies on
AbstractSubProtocolEvent application context events to keep
track of connected users and their subscriptions.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final Object | |
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Set | findSubscriptions(SimpSubscriptionMatcher
the matcher to use matcher)Implements org. Find subscriptions with the given matcher. |
| public int | getOrder()
Overrides default org. Determine this listener's order in a set of listeners for the same event. |
| public SimpUser | getUser(String
the name of the user to look up userName)Implements org. Get the user for the given name. |
| public int | getUserCount()
Implements org. Return the count of all connected users. |
| public Set | getUsers()
Implements org. Return a snapshot of all connected users. |
| public void | onApplicationEvent(ApplicationEvent
the event to respond to event)Implements org. Handle an application event. |
| public void | |
| public boolean | supportsEventType(Class<? extends ApplicationEvent>
the event type (never eventType)null)Implements org. Determine whether this listener actually supports the given event type. |
| public boolean | supportsSourceType(Class<?>
the source type, or sourceType)null if no sourceOverrides default org. Determine whether this listener actually supports the given source type. |
| public String |
| order | back to summary |
|---|---|
| private int order | |
| sessionLock | back to summary |
|---|---|
| private final Object sessionLock | |
| sessions | back to summary |
|---|---|
| private final Map<String, DefaultSimpUserRegistry. | |
| users | back to summary |
|---|---|
| private final Map<String, DefaultSimpUserRegistry. | |
| DefaultSimpUserRegistry | back to summary |
|---|---|
| public DefaultSimpUserRegistry() | |
| findSubscriptions | back to summary |
|---|---|
| public Set Implements org. Doc from org. Find subscriptions with the given matcher.
| |
| getOrder | back to summary |
|---|---|
| public int getOrder() Overrides default org. Doc from org. Determine this listener's order in a set of listeners for the same event. The default implementation returns
| |
| getUser | back to summary |
|---|---|
| public SimpUser getUser(String userName) Implements org. Doc from org. Get the user for the given name. | |
| getUserCount | back to summary |
|---|---|
| public int getUserCount() Implements org. Doc from org. Return the count of all connected users.
| |
| getUsers | back to summary |
|---|---|
| public Set Implements org. Doc from org. Return a snapshot of all connected users. The returned set is a copy and will not reflect further changes. | |
| onApplicationEvent | back to summary |
|---|---|
| public void onApplicationEvent(ApplicationEvent event) Implements org. Doc from org. Handle an application event.
| |
| setOrder | back to summary |
|---|---|
| public void setOrder(int order) Specify the order value for this registry. Default is
| |
| supportsEventType | back to summary |
|---|---|
| public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) Implements org. Doc from org. Determine whether this listener actually supports the given event type.
| |
| supportsSourceType | back to summary |
|---|---|
| public boolean supportsSourceType(Class<?> sourceType) Overrides default org. Doc from org. Determine whether this listener actually supports the given source type. The default implementation always returns | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final Map | |
| private final DefaultSimpUserRegistry. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public Set | getSubscriptions()
Implements org. Return the subscriptions for this session. |
| public DefaultSimpUserRegistry. | getUser()
Implements org. Return the user associated with the session. |
| public int | |
| pack-priv void | |
| public String |
| id | back to summary |
|---|---|
| private final String id | |
| subscriptions | back to summary |
|---|---|
| private final Map<String, SimpSubscription> subscriptions | |
| user | back to summary |
|---|---|
| private final DefaultSimpUserRegistry. | |
| LocalSimpSession | back to summary |
|---|---|
| public LocalSimpSession(String id, DefaultSimpUserRegistry. | |
| addSubscription | back to summary |
|---|---|
| pack-priv void addSubscription(String id, String destination) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Return the session id.
| |
| getSubscriptions | back to summary |
|---|---|
| public Set Implements org. Doc from org. Return the subscriptions for this session.
| |
| getUser | back to summary |
|---|---|
| public DefaultSimpUserRegistry. Implements org. Doc from org. Return the user associated with the session.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| removeSubscription | back to summary |
|---|---|
| pack-priv void removeSubscription(String id) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final DefaultSimpUserRegistry. |
| Access | Constructor and Description |
|---|---|
| public | LocalSimpSubscription(String id, String destination, DefaultSimpUserRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | getDestination()
Implements org. Return the subscription's destination. |
| public String | getId()
Implements org. Return the id associated of the subscription. |
| public DefaultSimpUserRegistry. | getSession()
Implements org. Return the session of the subscription. |
| public int | |
| public String |
| destination | back to summary |
|---|---|
| private final String destination | |
| id | back to summary |
|---|---|
| private final String id | |
| session | back to summary |
|---|---|
| private final DefaultSimpUserRegistry. | |
| LocalSimpSubscription | back to summary |
|---|---|
| public LocalSimpSubscription(String id, String destination, DefaultSimpUserRegistry. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDestination | back to summary |
|---|---|
| public String getDestination() Implements org. Doc from org. Return the subscription's destination.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Return the id associated of the subscription.
| |
| getSession | back to summary |
|---|---|
| public DefaultSimpUserRegistry. Implements org. Doc from org. Return the session of the subscription.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final Principal | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public Principal | getPrincipal()
Implements org. Return the user associated with the session, if available. |
| public SimpSession | getSession(String
the session id sessionId)Implements org. Look up the session for the given id. |
| public Set | getSessions()
Implements org. Return the sessions for the user. |
| public int | |
| public boolean | hasSessions()
Implements org. Whether the user has any sessions. |
| pack-priv void | |
| public String |
| name | back to summary |
|---|---|
| private final String name | |
| user | back to summary |
|---|---|
| private final Principal user | |
| userSessions | back to summary |
|---|---|
| private final Map<String, SimpSession> userSessions | |
| LocalSimpUser | back to summary |
|---|---|
| public LocalSimpUser(String userName, Principal user) | |
| addSession | back to summary |
|---|---|
| pack-priv void addSession(SimpSession session) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. The unique user name.
| |
| getPrincipal | back to summary |
|---|---|
| public Principal getPrincipal() Implements org. Doc from org. Return the user associated with the session, if available. Typically, the user information is available unless the user is connected to a different server in a multi-server user registry scenario. | |
| getSession | back to summary |
|---|---|
| public SimpSession getSession(String sessionId) Implements org. Doc from org. Look up the session for the given id.
| |
| getSessions | back to summary |
|---|---|
| public Set Implements org. Doc from org. Return the sessions for the user. The returned set is a copy and will never be modified.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasSessions | back to summary |
|---|---|
| public boolean hasSessions() Implements org. Doc from org. Whether the user has any sessions.
| |
| removeSession | back to summary |
|---|---|
| pack-priv void removeSession(String sessionId) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |