Top Description Methods
org.springframework.messaging.simp.user

public Interface SimpUser

Known Direct Implementers
org.springframework.messaging.simp.user.MultiServerUserRegistry.TransferSimpUser
Imports
java.security.Principal, java.util.Set, org.springframework.lang.Nullable

Represents a connected user.
Author
Rossen Stoyanchev
Since
4.2

Method Summary

Modifier and TypeMethod and Description
public String
getName()

The unique user name.

public Principal
getPrincipal()

Return the user associated with the session, if available.

public SimpSession

Returns:

the matching session, or null if none found
getSession
(String
the session id
sessionId
)

Look up the session for the given id.

public Set<SimpSession>

Returns:

a set of session ids, or an empty set if none
getSessions
()

Return the sessions for the user.

public boolean
hasSessions()

Whether the user has any sessions.

Method Detail

getNameback to summary
public String getName()

The unique user name.

getPrincipalback to summary
public Principal getPrincipal()

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.

Annotations
@Nullable
Since
5.3
getSessionback to summary
public SimpSession getSession(String sessionId)

Look up the session for the given id.

Parameters
sessionId:String

the session id

Returns:SimpSession

the matching session, or null if none found

Annotations
@Nullable
getSessionsback to summary
public Set<SimpSession> getSessions()

Return the sessions for the user. The returned set is a copy and will never be modified.

Returns:Set<SimpSession>

a set of session ids, or an empty set if none

hasSessionsback to summary
public boolean hasSessions()

Whether the user has any sessions.