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.UserSessionModel
UserSessionModel.SearchableFields, UserSessionModel.SessionPersistenceState, UserSessionModel.State
-
-
Field Summary
-
Fields inherited from interface org.keycloak.models.UserSessionModel
CORRESPONDING_SESSION_ID
-
-
Constructor Summary
Constructors Constructor Description UserSessionAdapter(KeycloakSession session, InfinispanUserSessionProvider provider, InfinispanChangelogBasedTransaction<String,UserSessionEntity> userSessionUpdateTx, InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> clientSessionUpdateTx, RealmModel realm, UserSessionEntity entity, boolean offline)
-
Method Summary
All 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
-
UserSessionAdapter
public UserSessionAdapter(KeycloakSession session, InfinispanUserSessionProvider provider, InfinispanChangelogBasedTransaction<String,UserSessionEntity> userSessionUpdateTx, InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> clientSessionUpdateTx, RealmModel realm, UserSessionEntity entity, boolean offline)
-
-
Method Detail
-
getAuthenticatedClientSessions
public 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 interfaceUserSessionModel- Returns:
-
getAuthenticatedClientSessionByClient
public AuthenticatedClientSessionModel getAuthenticatedClientSessionByClient(String clientUUID)
Description copied from interface:UserSessionModelReturns a client session for the given client UUID.- Specified by:
getAuthenticatedClientSessionByClientin interfaceUserSessionModel- Returns:
-
removeAuthenticatedClientSessions
public void removeAuthenticatedClientSessions(Collection<String> removedClientUUIDS)
Description copied from interface:UserSessionModelRemoves authenticated client sessions for all clients whose UUID is present inremovedClientUUIDSparameter.- Specified by:
removeAuthenticatedClientSessionsin interfaceUserSessionModel
-
getId
public String getId()
- Specified by:
getIdin interfaceUserSessionModel
-
getRealm
public RealmModel getRealm()
- Specified by:
getRealmin interfaceUserSessionModel
-
getBrokerSessionId
public 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 interfaceUserSessionModel- Returns:
-
getBrokerUserId
public String getBrokerUserId()
- Specified by:
getBrokerUserIdin interfaceUserSessionModel
-
getUser
public UserModel getUser()
- Specified by:
getUserin interfaceUserSessionModel
-
getLoginUsername
public String getLoginUsername()
- Specified by:
getLoginUsernamein interfaceUserSessionModel
-
getIpAddress
public String getIpAddress()
- Specified by:
getIpAddressin interfaceUserSessionModel
-
getAuthMethod
public String getAuthMethod()
- Specified by:
getAuthMethodin interfaceUserSessionModel
-
isRememberMe
public boolean isRememberMe()
- Specified by:
isRememberMein interfaceUserSessionModel
-
getStarted
public int getStarted()
- Specified by:
getStartedin interfaceUserSessionModel
-
getLastSessionRefresh
public int getLastSessionRefresh()
- Specified by:
getLastSessionRefreshin interfaceUserSessionModel
-
setLastSessionRefresh
public void setLastSessionRefresh(int lastSessionRefresh)
- Specified by:
setLastSessionRefreshin interfaceUserSessionModel
-
isOffline
public boolean isOffline()
- Specified by:
isOfflinein interfaceUserSessionModel
-
getNote
public String getNote(String name)
- Specified by:
getNotein interfaceUserSessionModel
-
setNote
public void setNote(String name, String value)
- Specified by:
setNotein interfaceUserSessionModel
-
removeNote
public void removeNote(String name)
- Specified by:
removeNotein interfaceUserSessionModel
-
getNotes
public Map<String,String> getNotes()
- Specified by:
getNotesin interfaceUserSessionModel
-
getState
public UserSessionModel.State getState()
- Specified by:
getStatein interfaceUserSessionModel
-
setState
public void setState(UserSessionModel.State state)
- Specified by:
setStatein interfaceUserSessionModel
-
getPersistenceState
public UserSessionModel.SessionPersistenceState getPersistenceState()
-
setPersistenceState
public void setPersistenceState(UserSessionModel.SessionPersistenceState persistenceState)
-
restartSession
public void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId)
- Specified by:
restartSessionin interfaceUserSessionModel
-
-