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
Constructors Constructor Description MapRootAuthenticationSessionAdapter(KeycloakSession session, RealmModel realm, MapRootAuthenticationSessionEntity entity, int authSessionsLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationSessionModelcreateAuthenticationSession(ClientModel client)Create a new authentication session and returns it.AuthenticationSessionModelgetAuthenticationSession(ClientModel client, String tabId)Returns an authentication session for the particular client and tab or null if it doesn't yet exists.Map<String,AuthenticationSessionModel>getAuthenticationSessions()Returns authentication sessions for the root authentication session.StringgetId()Returns id of the root authentication session.RealmModelgetRealm()Returns realm associated to the root authentication session.intgetTimestamp()Returns timestamp when the root authentication session was created or updated.voidremoveAuthenticationSessionByTabId(String tabId)Removes the authentication session specified by tab id from the root authentication session.voidrestartSession(RealmModel realm)Will completely restart whole state of authentication session.voidsetTimestamp(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 Detail
-
MapRootAuthenticationSessionAdapter
public MapRootAuthenticationSessionAdapter(KeycloakSession session, RealmModel realm, MapRootAuthenticationSessionEntity entity, int authSessionsLimit)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:RootAuthenticationSessionModelReturns id of the root authentication session.- Returns:
String
-
getRealm
public RealmModel getRealm()
Description copied from interface:RootAuthenticationSessionModelReturns realm associated to the root authentication session.- Returns:
RealmModel
-
getTimestamp
public int getTimestamp()
Description copied from interface:RootAuthenticationSessionModelReturns timestamp when the root authentication session was created or updated.- Returns:
int
-
setTimestamp
public void setTimestamp(int timestamp)
Description copied from interface:RootAuthenticationSessionModelSets 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
public Map<String,AuthenticationSessionModel> getAuthenticationSessions()
Description copied from interface:RootAuthenticationSessionModelReturns 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
public AuthenticationSessionModel getAuthenticationSession(ClientModel client, String tabId)
Description copied from interface:RootAuthenticationSessionModelReturns an authentication session for the particular client and tab or null if it doesn't yet exists.- Parameters:
client-ClientModelIfnullis provided the method will returnnull.tabId-StringIfnullis provided the method will returnnull.- Returns:
AuthenticationSessionModelornullin no authentication session is found.
-
createAuthenticationSession
public AuthenticationSessionModel createAuthenticationSession(ClientModel client)
Description copied from interface:RootAuthenticationSessionModelCreate a new authentication session and returns it.- Parameters:
client-ClientModelCan't benull.- Returns:
AuthenticationSessionModelnon-null fresh authentication session. Never returnsnull.
-
removeAuthenticationSessionByTabId
public void removeAuthenticationSessionByTabId(String tabId)
Description copied from interface:RootAuthenticationSessionModelRemoves 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-StringCan't benull.
-
restartSession
public void restartSession(RealmModel realm)
Description copied from interface:RootAuthenticationSessionModelWill completely restart whole state of authentication session. It will just keep same ID. It will setup it with provided realm.- Parameters:
realm-RealmModelAssociated realm to the root authentication session.
-
-