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 SummaryNested Classes Modifier and Type Interface Description static classUserSessionModel.SearchableFieldsstatic classUserSessionModel.SessionPersistenceStateFlag used when creating user sessionstatic classUserSessionModel.State
 - 
Field SummaryFields Modifier and Type Field Description static StringCORRESPONDING_SESSION_IDRepresents the corresponding online/offline user session.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AuthenticatedClientSessionModelgetAuthenticatedClientSessionByClient(String clientUUID)Returns a client session for the given client UUID.Map<String,AuthenticatedClientSessionModel>getAuthenticatedClientSessions()Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModelobject.StringgetAuthMethod()StringgetBrokerSessionId()If created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSessionStringgetBrokerUserId()StringgetId()StringgetIpAddress()intgetLastSessionRefresh()StringgetLoginUsername()StringgetNote(String name)Map<String,String>getNotes()RealmModelgetRealm()intgetStarted()UserSessionModel.StategetState()UserModelgetUser()booleanisOffline()booleanisRememberMe()voidremoveAuthenticatedClientSessions(Collection<String> removedClientUUIDS)Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDSparameter.voidremoveNote(String name)voidrestartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId)voidsetLastSessionRefresh(int seconds)voidsetNote(String name, String value)voidsetState(UserSessionModel.State state)
 
- 
- 
- 
Field Detail- 
CORRESPONDING_SESSION_IDstatic final String CORRESPONDING_SESSION_ID Represents the corresponding online/offline user session.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getIdString getId() 
 - 
getRealmRealmModel getRealm() 
 - 
getBrokerSessionIdString 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:
 
 - 
getBrokerUserIdString getBrokerUserId() 
 - 
getUserUserModel getUser() 
 - 
getLoginUsernameString getLoginUsername() 
 - 
getIpAddressString getIpAddress() 
 - 
getAuthMethodString getAuthMethod() 
 - 
isRememberMeboolean isRememberMe() 
 - 
getStartedint getStarted() 
 - 
getLastSessionRefreshint getLastSessionRefresh() 
 - 
setLastSessionRefreshvoid setLastSessionRefresh(int seconds) 
 - 
isOfflineboolean isOffline() 
 - 
getAuthenticatedClientSessionsMap<String,AuthenticatedClientSessionModel> getAuthenticatedClientSessions() Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModelobject.- Returns:
 
 - 
getAuthenticatedClientSessionByClientdefault AuthenticatedClientSessionModel getAuthenticatedClientSessionByClient(String clientUUID) Returns a client session for the given client UUID.- Returns:
 
 - 
removeAuthenticatedClientSessionsvoid removeAuthenticatedClientSessions(Collection<String> removedClientUUIDS) Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDSparameter.- Parameters:
- removedClientUUIDS-
 
 - 
removeNotevoid removeNote(String name) 
 - 
getStateUserSessionModel.State getState() 
 - 
setStatevoid setState(UserSessionModel.State state) 
 
- 
 
-