Package org.keycloak.models
Interface UserSessionModel
- All Known Subinterfaces:
OfflineUserSessionModel
- All Known Implementing Classes:
AbstractUserSessionModel
,MapUserSessionAdapter
,PersistentUserSessionAdapter
,UserSessionAdapter
public interface UserSessionModel
- Author:
- Stian Thorgersen
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static enum
Flag used when creating user sessionstatic enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Represents the corresponding online/offline user session. -
Method Summary
Modifier and TypeMethodDescriptiondefault AuthenticatedClientSessionModel
getAuthenticatedClientSessionByClient
(String clientUUID) Returns a client session for the given client UUID.Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModel
object.If created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSessiongetId()
int
getNotes()
getRealm()
int
getState()
getUser()
boolean
boolean
void
removeAuthenticatedClientSessions
(Collection<String> removedClientUUIDS) Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDS
parameter.void
removeNote
(String name) void
restartSession
(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) void
setLastSessionRefresh
(int seconds) void
void
setState
(UserSessionModel.State state)
-
Field Details
-
CORRESPONDING_SESSION_ID
Represents the corresponding online/offline user session.- See Also:
-
-
Method Details
-
getId
String getId() -
getRealm
RealmModel getRealm() -
getBrokerSessionId
String getBrokerSessionId()If created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSession- Returns:
-
getBrokerUserId
String getBrokerUserId() -
getUser
UserModel getUser() -
getLoginUsername
String getLoginUsername() -
getIpAddress
String getIpAddress() -
getAuthMethod
String getAuthMethod() -
isRememberMe
boolean isRememberMe() -
getStarted
int getStarted() -
getLastSessionRefresh
int getLastSessionRefresh() -
setLastSessionRefresh
void setLastSessionRefresh(int seconds) -
isOffline
boolean isOffline() -
getAuthenticatedClientSessions
Map<String,AuthenticatedClientSessionModel> getAuthenticatedClientSessions()Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModel
object.- Returns:
-
getAuthenticatedClientSessionByClient
Returns a client session for the given client UUID.- Returns:
-
removeAuthenticatedClientSessions
Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDS
parameter.- Parameters:
removedClientUUIDS
-
-
getNote
-
setNote
-
removeNote
-
getNotes
-
getState
UserSessionModel.State getState() -
setState
-
restartSession
-