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 Summary
Nested Classes Modifier and Type Class Description protected static classPersistentUserSessionAdapter.PersistentUserSessionData-
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 PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String,AuthenticatedClientSessionModel> clientSessions)PersistentUserSessionAdapter(UserSessionModel other)
-
Method Summary
All 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.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.UserSessionModel
getAuthenticatedClientSessionByClient
-
-
-
-
Constructor Detail
-
PersistentUserSessionAdapter
public PersistentUserSessionAdapter(UserSessionModel other)
-
PersistentUserSessionAdapter
public PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String,AuthenticatedClientSessionModel> clientSessions)
-
-
Method Detail
-
getUpdatedModel
public PersistentUserSessionModel getUpdatedModel()
-
getId
public String getId()
- Specified by:
getIdin 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
-
getUserId
public String getUserId()
- Specified by:
getUserIdin interfaceOfflineUserSessionModel
-
getRealm
public RealmModel getRealm()
- Specified by:
getRealmin 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 seconds)
- Specified by:
setLastSessionRefreshin interfaceUserSessionModel
-
isOffline
public boolean isOffline()
- Specified by:
isOfflinein interfaceUserSessionModel
-
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:
-
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
-
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
-
restartSession
public void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId)
- Specified by:
restartSessionin interfaceUserSessionModel
-
-