Package org.keycloak.models.session
Class PersistentUserSessionAdapter
- java.lang.Object
- 
- org.keycloak.models.session.PersistentUserSessionAdapter
 
- 
- All Implemented Interfaces:
- OfflineUserSessionModel,- UserSessionModel
 
 public class PersistentUserSessionAdapter extends Object implements OfflineUserSessionModel - Author:
- Marek Posolda
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classPersistentUserSessionAdapter.PersistentUserSessionData- 
Nested classes/interfaces inherited from interface org.keycloak.models.UserSessionModelUserSessionModel.SearchableFields, UserSessionModel.SessionPersistenceState, UserSessionModel.State
 
- 
 - 
Field Summary- 
Fields inherited from interface org.keycloak.models.UserSessionModelCORRESPONDING_SESSION_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String,AuthenticatedClientSessionModel> clientSessions)PersistentUserSessionAdapter(UserSessionModel other)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)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()PersistentUserSessionModelgetUpdatedModel()UserModelgetUser()StringgetUserId()inthashCode()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)- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.UserSessionModelgetAuthenticatedClientSessionByClient
 
- 
 
- 
- 
- 
Constructor Detail- 
PersistentUserSessionAdapterpublic PersistentUserSessionAdapter(UserSessionModel other) 
 - 
PersistentUserSessionAdapterpublic PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String,AuthenticatedClientSessionModel> clientSessions) 
 
- 
 - 
Method Detail- 
getUpdatedModelpublic PersistentUserSessionModel getUpdatedModel() 
 - 
getIdpublic String getId() - Specified by:
- getIdin interface- UserSessionModel
 
 - 
getBrokerSessionIdpublic String getBrokerSessionId() Description 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:
 
 - 
getBrokerUserIdpublic String getBrokerUserId() - Specified by:
- getBrokerUserIdin interface- UserSessionModel
 
 - 
getUserpublic UserModel getUser() - Specified by:
- getUserin interface- UserSessionModel
 
 - 
getUserIdpublic String getUserId() - Specified by:
- getUserIdin interface- OfflineUserSessionModel
 
 - 
getRealmpublic RealmModel getRealm() - Specified by:
- getRealmin interface- UserSessionModel
 
 - 
getLoginUsernamepublic String getLoginUsername() - Specified by:
- getLoginUsernamein interface- UserSessionModel
 
 - 
getIpAddresspublic String getIpAddress() - Specified by:
- getIpAddressin interface- UserSessionModel
 
 - 
getAuthMethodpublic String 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) - Specified by:
- setLastSessionRefreshin interface- UserSessionModel
 
 - 
isOfflinepublic boolean isOffline() - Specified by:
- isOfflinein interface- UserSessionModel
 
 - 
getAuthenticatedClientSessionspublic Map<String,AuthenticatedClientSessionModel> getAuthenticatedClientSessions() Description copied from interface:UserSessionModelReturns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModelobject.- Specified by:
- getAuthenticatedClientSessionsin interface- UserSessionModel
- Returns:
 
 - 
removeAuthenticatedClientSessionspublic void removeAuthenticatedClientSessions(Collection<String> removedClientUUIDS) Description copied from interface:UserSessionModelRemoves authenticated client sessions for all clients whose UUID is present inremovedClientUUIDSparameter.- Specified by:
- removeAuthenticatedClientSessionsin interface- UserSessionModel
 
 - 
getNotepublic String getNote(String name) - Specified by:
- getNotein interface- UserSessionModel
 
 - 
setNotepublic void setNote(String name, String value) - Specified by:
- setNotein interface- UserSessionModel
 
 - 
removeNotepublic void removeNote(String name) - Specified by:
- removeNotein interface- UserSessionModel
 
 - 
getNotespublic Map<String,String> getNotes() - Specified by:
- getNotesin interface- UserSessionModel
 
 - 
getStatepublic UserSessionModel.State getState() - Specified by:
- getStatein interface- UserSessionModel
 
 - 
setStatepublic void setState(UserSessionModel.State state) - 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
 
 
- 
 
-