public interface UserSessionService
UserSessions management.| Modifier and Type | Interface and Description |
|---|---|
static class |
UserSessionService.Filter |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMessages()
Poll for messages left for the current user session.
|
java.lang.Integer |
getPermissionValue(User user,
PermissionType permissionType,
java.lang.String target)
Get effective user permission.
|
UserSession |
getUserSession(java.util.UUID sessionId)
Get a UserSession by its identifier.
|
java.util.Collection<UserSessionEntity> |
getUserSessionInfo()
Deprecated.
Use
loadUserSessionEntities(Filter) method passing a filter |
void |
killSession(java.util.UUID id)
Disconnect a session.
|
java.util.Collection<UserSessionEntity> |
loadUserSessionEntities(UserSessionService.Filter filter)
Load list of non-persistent entities representing active user sessions.
|
void |
postMessage(java.util.List<java.util.UUID> sessionIds,
java.lang.String message)
Post a message to the list of active user sessions.
|
void |
removeSessionAttribute(java.util.UUID sessionId,
java.lang.String name)
Remove a session attribute, propagating changes to the cluster.
|
void |
setSessionAddress(java.util.UUID sessionId,
java.lang.String address)
Set client's address into the session, propagating changes to the cluster.
|
void |
setSessionAttribute(java.util.UUID sessionId,
java.lang.String name,
java.io.Serializable value)
Set a session attribute value, propagating changes to the cluster.
|
void |
setSessionClientInfo(java.util.UUID sessionId,
java.lang.String clientInfo)
Set client's information into the session, propagating changes to the cluster.
|
void |
setSessionLocale(java.util.UUID sessionId,
java.util.Locale locale)
Set user locale into the session, propagating changes to the cluster.
|
void |
setSessionTimeZone(java.util.UUID sessionId,
java.util.TimeZone timeZone)
Set user time zone into the session, propagating changes to the cluster.
|
static final java.lang.String NAME
UserSession getUserSession(java.util.UUID sessionId)
When called from the client tier, returns a copy of the session object, so any modifications of its state affect nothing.
sessionId - a session identifierNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid setSessionAttribute(java.util.UUID sessionId,
java.lang.String name,
java.io.Serializable value)
sessionId - an active session identifiername - attribute namevalue - attribute valueNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid removeSessionAttribute(java.util.UUID sessionId,
java.lang.String name)
sessionId - an active session identifiername - attribute nameNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid setSessionLocale(java.util.UUID sessionId,
java.util.Locale locale)
sessionId - an active session identifierlocale - user localeNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid setSessionTimeZone(java.util.UUID sessionId,
java.util.TimeZone timeZone)
sessionId - an active session identifiertimeZone - user time zoneNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid setSessionAddress(java.util.UUID sessionId,
java.lang.String address)
sessionId - an active session identifieraddress - client's addressNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is systemvoid setSessionClientInfo(java.util.UUID sessionId,
java.lang.String clientInfo)
sessionId - an active session identifierclientInfo - client's infoNoUserSessionException - in case of a session with the specified ID
doesn't existjava.lang.RuntimeException - if the session is system@Deprecated java.util.Collection<UserSessionEntity> getUserSessionInfo()
loadUserSessionEntities(Filter) method passing a filtervoid killSession(java.util.UUID id)
id - an active session identifiervoid postMessage(java.util.List<java.util.UUID> sessionIds,
java.lang.String message)
sessionIds - list of session identifiersmessage - the message text@Nullable java.lang.String getMessages()
java.lang.Integer getPermissionValue(User user, PermissionType permissionType, java.lang.String target)
user - userpermissionType - type of permissiontarget - permission targetjava.util.Collection<UserSessionEntity> loadUserSessionEntities(UserSessionService.Filter filter)
filter - can be used to limit the loaded list. Pass UserSessionService.Filter.ALL to load all.