Class UserSessionAdapter
- java.lang.Object
- 
- org.keycloak.models.sessions.infinispan.UserSessionAdapter
 
- 
- All Implemented Interfaces:
- UserSessionModel
 
 public class UserSessionAdapter extends Object implements UserSessionModel - Author:
- Stian Thorgersen
 
- 
- 
Nested Class Summary- 
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 UserSessionAdapter(KeycloakSession session, InfinispanUserSessionProvider provider, InfinispanChangelogBasedTransaction<String,UserSessionEntity> userSessionUpdateTx, InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> clientSessionUpdateTx, RealmModel realm, UserSessionEntity entity, boolean offline)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)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()UserSessionModel.SessionPersistenceStategetPersistenceState()RealmModelgetRealm()intgetStarted()UserSessionModel.StategetState()UserModelgetUser()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 lastSessionRefresh)voidsetNote(String name, String value)voidsetPersistenceState(UserSessionModel.SessionPersistenceState persistenceState)voidsetState(UserSessionModel.State state)
 
- 
- 
- 
Constructor Detail- 
UserSessionAdapterpublic UserSessionAdapter(KeycloakSession session, InfinispanUserSessionProvider provider, InfinispanChangelogBasedTransaction<String,UserSessionEntity> userSessionUpdateTx, InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> clientSessionUpdateTx, RealmModel realm, UserSessionEntity entity, boolean offline) 
 
- 
 - 
Method Detail- 
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:
 
 - 
getAuthenticatedClientSessionByClientpublic AuthenticatedClientSessionModel getAuthenticatedClientSessionByClient(String clientUUID) Description copied from interface:UserSessionModelReturns a client session for the given client UUID.- Specified by:
- getAuthenticatedClientSessionByClientin 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
 
 - 
getIdpublic String getId() - Specified by:
- getIdin interface- UserSessionModel
 
 - 
getRealmpublic RealmModel getRealm() - Specified by:
- getRealmin 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
 
 - 
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 lastSessionRefresh) - Specified by:
- setLastSessionRefreshin interface- UserSessionModel
 
 - 
isOfflinepublic boolean isOffline() - Specified by:
- isOfflinein 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
 
 - 
getPersistenceStatepublic UserSessionModel.SessionPersistenceState getPersistenceState() 
 - 
setPersistenceStatepublic void setPersistenceState(UserSessionModel.SessionPersistenceState persistenceState) 
 - 
restartSessionpublic void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) - Specified by:
- restartSessionin interface- UserSessionModel
 
 
- 
 
-