Class MapRootAuthenticationSessionAdapter
java.lang.Object
org.keycloak.models.map.authSession.AbstractRootAuthenticationSessionModel<MapRootAuthenticationSessionEntity>
org.keycloak.models.map.authSession.MapRootAuthenticationSessionAdapter
- All Implemented Interfaces:
RootAuthenticationSessionModel
public class MapRootAuthenticationSessionAdapter
extends AbstractRootAuthenticationSessionModel<MapRootAuthenticationSessionEntity>
- Author:
- Martin Kanis
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.sessions.RootAuthenticationSessionModel
RootAuthenticationSessionModel.SearchableFields
-
Field Summary
Fields inherited from class org.keycloak.models.map.authSession.AbstractRootAuthenticationSessionModel
entity, realm, session
-
Constructor Summary
ConstructorDescriptionMapRootAuthenticationSessionAdapter
(KeycloakSession session, RealmModel realm, MapRootAuthenticationSessionEntity entity, int authSessionsLimit) -
Method Summary
Modifier and TypeMethodDescriptionCreate a new authentication session and returns it.getAuthenticationSession
(ClientModel client, String tabId) Returns an authentication session for the particular client and tab or null if it doesn't yet exists.Returns authentication sessions for the root authentication session.getId()
Returns id of the root authentication session.getRealm()
Returns realm associated to the root authentication session.int
Returns timestamp when the root authentication session was created or updated.void
Removes the authentication session specified by tab id from the root authentication session.void
restartSession
(RealmModel realm) Will completely restart whole state of authentication session.void
setTimestamp
(int timestamp) Sets a timestamp when the root authentication session was created or updated.Methods inherited from class org.keycloak.models.map.authSession.AbstractRootAuthenticationSessionModel
equals, hashCode
-
Constructor Details
-
MapRootAuthenticationSessionAdapter
public MapRootAuthenticationSessionAdapter(KeycloakSession session, RealmModel realm, MapRootAuthenticationSessionEntity entity, int authSessionsLimit)
-
-
Method Details
-
getId
Description copied from interface:RootAuthenticationSessionModel
Returns id of the root authentication session.- Returns:
String
-
getRealm
Description copied from interface:RootAuthenticationSessionModel
Returns realm associated to the root authentication session.- Returns:
RealmModel
-
getTimestamp
public int getTimestamp()Description copied from interface:RootAuthenticationSessionModel
Returns timestamp when the root authentication session was created or updated.- Returns:
int
-
setTimestamp
public void setTimestamp(int timestamp) Description copied from interface:RootAuthenticationSessionModel
Sets a timestamp when the root authentication session was created or updated. It also updates the expiration time for the root authentication session entity.- Parameters:
timestamp
-int
-
getAuthenticationSessions
Description copied from interface:RootAuthenticationSessionModel
Returns authentication sessions for the root authentication session. Key is tabId, Value is AuthenticationSessionModel.- Returns:
Map<String, AuthenticationSessionModel>
authentication sessions or empty map if no authentication sessions are present. Never return null.
-
getAuthenticationSession
Description copied from interface:RootAuthenticationSessionModel
Returns an authentication session for the particular client and tab or null if it doesn't yet exists.- Parameters:
client
-ClientModel
Ifnull
is provided the method will returnnull
.tabId
-String
Ifnull
is provided the method will returnnull
.- Returns:
AuthenticationSessionModel
ornull
in no authentication session is found.
-
createAuthenticationSession
Description copied from interface:RootAuthenticationSessionModel
Create a new authentication session and returns it.- Parameters:
client
-ClientModel
Can't benull
.- Returns:
AuthenticationSessionModel
non-null fresh authentication session. Never returnsnull
.
-
removeAuthenticationSessionByTabId
Description copied from interface:RootAuthenticationSessionModel
Removes the authentication session specified by tab id from the root authentication session. If there's no child authentication session left in the root authentication session, it's removed as well.- Parameters:
tabId
-String
Can't benull
.
-
restartSession
Description copied from interface:RootAuthenticationSessionModel
Will completely restart whole state of authentication session. It will just keep same ID. It will setup it with provided realm.- Parameters:
realm
-RealmModel
Associated realm to the root authentication session.
-