Package org.keycloak.models.session
Class PersistentUserSessionAdapter
java.lang.Object
org.keycloak.models.session.PersistentUserSessionAdapter
- All Implemented Interfaces:
- OfflineUserSessionModel,- UserSessionModel
- Author:
- Marek Posolda
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from interface org.keycloak.models.UserSessionModelUserSessionModel.SessionPersistenceState, UserSessionModel.State
- 
Field SummaryFields inherited from interface org.keycloak.models.UserSessionModelCORRESPONDING_SESSION_ID
- 
Constructor SummaryConstructorsConstructorDescriptionPersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String, AuthenticatedClientSessionModel> clientSessions) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModelobject.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()Note: will not be an address when a proxy does not provide a valid oneintgetNotes()getRealm()intgetState()getUser()inthashCode()booleanbooleanvoidremoveAuthenticatedClientSessions(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) voidsetAuthMethod(String authMethod) voidsetBrokerSessionId(String brokerSessionId) voidsetBrokerUserId(String brokerUserId) voidsetClientSessionsLoader(Consumer<Map<String, AuthenticatedClientSessionModel>> clientSessionsLoader) voidsetIpAddress(String ipAddress) voidsetLastSessionRefresh(int seconds) Set the last session refresh timestamp for the user session.voidsetLoginUsername(String loginUsername) voidvoidsetRealm(RealmModel realm) voidsetRememberMe(boolean rememberMe) voidsetStarted(int started) voidsetState(UserSessionModel.State state) voidtoString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.keycloak.models.UserSessionModelgetAuthenticatedClientSessionByClient, getPersistenceState
- 
Constructor Details- 
PersistentUserSessionAdapter
- 
PersistentUserSessionAdapterpublic PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String, AuthenticatedClientSessionModel> clientSessions) 
 
- 
- 
Method Details- 
getUpdatedModel
- 
getId- Specified by:
- getIdin interface- UserSessionModel
 
- 
getBrokerSessionIdDescription copied from interface:UserSessionModelIf created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSession- Specified by:
- getBrokerSessionIdin interface- UserSessionModel
- Returns:
 
- 
getBrokerUserId- Specified by:
- getBrokerUserIdin interface- UserSessionModel
 
- 
getUser- Specified by:
- getUserin interface- UserSessionModel
 
- 
getUserId- Specified by:
- getUserIdin interface- OfflineUserSessionModel
 
- 
getRealm- Specified by:
- getRealmin interface- UserSessionModel
 
- 
getLoginUsername- Specified by:
- getLoginUsernamein interface- UserSessionModel
 
- 
getIpAddressDescription copied from interface:UserSessionModelNote: will not be an address when a proxy does not provide a valid one- Specified by:
- getIpAddressin interface- UserSessionModel
- Returns:
- the ip address
 
- 
getAuthMethod- Specified by:
- getAuthMethodin interface- UserSessionModel
 
- 
isRememberMepublic boolean isRememberMe()- Specified by:
- isRememberMein interface- UserSessionModel
 
- 
getStartedpublic int getStarted()- Specified by:
- getStartedin interface- UserSessionModel
 
- 
getLastSessionRefreshpublic int getLastSessionRefresh()- Specified by:
- getLastSessionRefreshin interface- UserSessionModel
 
- 
setLastSessionRefreshpublic void setLastSessionRefresh(int seconds) Description copied from interface:UserSessionModelSet the last session refresh timestamp for the user session. If the timestamp is smaller or equal than the current timestamp, the operation is ignored.- Specified by:
- setLastSessionRefreshin interface- UserSessionModel
 
- 
isOfflinepublic boolean isOffline()- Specified by:
- isOfflinein interface- UserSessionModel
 
- 
getAuthenticatedClientSessionsDescription copied from interface:UserSessionModelReturns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModelobject.Any direct modification via the Mapinterface will throw anUnsupportedOperationException. To add a new mapping, use a method likeUserSessionProvider.createClientSession(RealmModel, ClientModel, UserSessionModel)or equivalent. To remove a mapping, useAuthenticatedClientSessionModel.detachFromUserSession().- Specified by:
- getAuthenticatedClientSessionsin interface- UserSessionModel
 
- 
removeAuthenticatedClientSessionsDescription copied from interface:UserSessionModelRemoves authenticated client sessions for all clients whose UUID is present inremovedClientUUIDSparameter.- Specified by:
- removeAuthenticatedClientSessionsin interface- UserSessionModel
 
- 
getNote- Specified by:
- getNotein interface- UserSessionModel
 
- 
setNote- Specified by:
- setNotein interface- UserSessionModel
 
- 
removeNote- Specified by:
- removeNotein interface- UserSessionModel
 
- 
getNotes- Specified by:
- getNotesin interface- UserSessionModel
 
- 
getState- Specified by:
- getStatein interface- UserSessionModel
 
- 
setState- Specified by:
- setStatein interface- UserSessionModel
 
- 
restartSessionpublic void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) - Specified by:
- restartSessionin interface- UserSessionModel
 
- 
setLoginUsername- Specified by:
- setLoginUsernamein interface- OfflineUserSessionModel
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
setRealm
- 
setUser
- 
setIpAddress
- 
setAuthMethod
- 
setRememberMepublic void setRememberMe(boolean rememberMe) 
- 
setStartedpublic void setStarted(int started) 
- 
setBrokerSessionId
- 
setBrokerUserId
- 
setClientSessionsLoaderpublic void setClientSessionsLoader(Consumer<Map<String, AuthenticatedClientSessionModel>> clientSessionsLoader) 
 
-