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 Summary
Modifier and TypeClassDescriptionprotected static class
Nested classes/interfaces inherited from interface org.keycloak.models.UserSessionModel
UserSessionModel.SessionPersistenceState, UserSessionModel.State
-
Field Summary
Fields inherited from interface org.keycloak.models.UserSessionModel
CORRESPONDING_SESSION_ID
-
Constructor Summary
ConstructorDescriptionPersistentUserSessionAdapter
(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String, AuthenticatedClientSessionModel> clientSessions) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModel
object.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()
int
getNotes()
getRealm()
int
getState()
getUser()
int
hashCode()
boolean
boolean
void
removeAuthenticatedClientSessions
(Collection<String> removedClientUUIDS) Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDS
parameter.void
removeNote
(String name) void
restartSession
(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) void
setLastSessionRefresh
(int seconds) void
void
setState
(UserSessionModel.State state) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.models.UserSessionModel
getAuthenticatedClientSessionByClient, getPersistenceState
-
Constructor Details
-
PersistentUserSessionAdapter
-
PersistentUserSessionAdapter
public PersistentUserSessionAdapter(KeycloakSession session, PersistentUserSessionModel model, RealmModel realm, String userId, Map<String, AuthenticatedClientSessionModel> clientSessions)
-
-
Method Details
-
getUpdatedModel
-
getId
- Specified by:
getId
in interfaceUserSessionModel
-
getBrokerSessionId
Description copied from interface:UserSessionModel
If 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:
getBrokerSessionId
in interfaceUserSessionModel
- Returns:
-
getBrokerUserId
- Specified by:
getBrokerUserId
in interfaceUserSessionModel
-
getUser
- Specified by:
getUser
in interfaceUserSessionModel
-
getUserId
- Specified by:
getUserId
in interfaceOfflineUserSessionModel
-
getRealm
- Specified by:
getRealm
in interfaceUserSessionModel
-
getLoginUsername
- Specified by:
getLoginUsername
in interfaceUserSessionModel
-
getIpAddress
- Specified by:
getIpAddress
in interfaceUserSessionModel
-
getAuthMethod
- Specified by:
getAuthMethod
in interfaceUserSessionModel
-
isRememberMe
public boolean isRememberMe()- Specified by:
isRememberMe
in interfaceUserSessionModel
-
getStarted
public int getStarted()- Specified by:
getStarted
in interfaceUserSessionModel
-
getLastSessionRefresh
public int getLastSessionRefresh()- Specified by:
getLastSessionRefresh
in interfaceUserSessionModel
-
setLastSessionRefresh
public void setLastSessionRefresh(int seconds) - Specified by:
setLastSessionRefresh
in interfaceUserSessionModel
-
isOffline
public boolean isOffline()- Specified by:
isOffline
in interfaceUserSessionModel
-
getAuthenticatedClientSessions
Description copied from interface:UserSessionModel
Returns map where key is ID of the client (its UUID) and value is ID respectiveAuthenticatedClientSessionModel
object.- Specified by:
getAuthenticatedClientSessions
in interfaceUserSessionModel
- Returns:
-
removeAuthenticatedClientSessions
Description copied from interface:UserSessionModel
Removes authenticated client sessions for all clients whose UUID is present inremovedClientUUIDS
parameter.- Specified by:
removeAuthenticatedClientSessions
in interfaceUserSessionModel
-
getNote
- Specified by:
getNote
in interfaceUserSessionModel
-
setNote
- Specified by:
setNote
in interfaceUserSessionModel
-
removeNote
- Specified by:
removeNote
in interfaceUserSessionModel
-
getNotes
- Specified by:
getNotes
in interfaceUserSessionModel
-
getState
- Specified by:
getState
in interfaceUserSessionModel
-
setState
- Specified by:
setState
in interfaceUserSessionModel
-
restartSession
public void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) - Specified by:
restartSession
in interfaceUserSessionModel
-
equals
-
hashCode
public int hashCode() -
toString
-