public class RealmCacheSession extends Object implements CacheRealmProvider
Modifier and Type | Field and Description |
---|---|
protected RealmCacheManager |
cache |
protected boolean |
clearAll |
protected ClientProvider |
clientDelegate |
protected Set<InvalidationEvent> |
invalidationEvents |
protected Set<String> |
invalidations |
protected Set<String> |
listInvalidations |
protected static org.jboss.logging.Logger |
logger |
protected Map<String,ClientModel> |
managedApplications |
protected Map<String,ClientScopeAdapter> |
managedClientScopes |
protected Map<String,GroupAdapter> |
managedGroups |
protected Map<String,RealmAdapter> |
managedRealms |
protected Map<String,RoleAdapter> |
managedRoles |
static String |
REALM_CLIENTS_QUERY_SUFFIX |
protected RealmProvider |
realmDelegate |
static String |
ROLES_QUERY_SUFFIX |
protected KeycloakSession |
session |
protected boolean |
setRollbackOnly |
protected long |
startupRevision |
protected boolean |
transactionActive |
Constructor and Description |
---|
RealmCacheSession(RealmCacheManager cache,
KeycloakSession session) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createGroup, createGroup, createGroup
protected static final org.jboss.logging.Logger logger
public static final String REALM_CLIENTS_QUERY_SUFFIX
public static final String ROLES_QUERY_SUFFIX
protected RealmCacheManager cache
protected KeycloakSession session
protected RealmProvider realmDelegate
protected ClientProvider clientDelegate
protected boolean transactionActive
protected boolean setRollbackOnly
protected Map<String,RealmAdapter> managedRealms
protected Map<String,ClientModel> managedApplications
protected Map<String,ClientScopeAdapter> managedClientScopes
protected Map<String,RoleAdapter> managedRoles
protected Map<String,GroupAdapter> managedGroups
protected Set<InvalidationEvent> invalidationEvents
protected boolean clearAll
protected final long startupRevision
public RealmCacheSession(RealmCacheManager cache, KeycloakSession session)
public long getStartupRevision()
public boolean isInvalid(String id)
public void clear()
clear
in interface CacheRealmProvider
public MigrationModel getMigrationModel()
getMigrationModel
in interface RealmProvider
public RealmProvider getRealmDelegate()
getRealmDelegate
in interface CacheRealmProvider
public ClientProvider getClientDelegate()
public void registerRealmInvalidation(String id, String name)
registerRealmInvalidation
in interface CacheRealmProvider
public void registerClientInvalidation(String id, String clientId, String realmId)
registerClientInvalidation
in interface CacheRealmProvider
public void registerClientScopeInvalidation(String id)
registerClientScopeInvalidation
in interface CacheRealmProvider
public void registerRoleInvalidation(String id, String roleName, String roleContainerId)
registerRoleInvalidation
in interface CacheRealmProvider
public void registerGroupInvalidation(String id)
registerGroupInvalidation
in interface CacheRealmProvider
protected void runInvalidations()
public RealmModel createRealm(String name)
createRealm
in interface RealmProvider
public RealmModel createRealm(String id, String name)
createRealm
in interface RealmProvider
public RealmModel getRealm(String id)
getRealm
in interface RealmProvider
public RealmModel getRealmByName(String name)
getRealmByName
in interface RealmProvider
public List<RealmModel> getRealmsWithProviderType(Class<?> type)
getRealmsWithProviderType
in interface RealmProvider
public List<RealmModel> getRealms()
getRealms
in interface RealmProvider
public boolean removeRealm(String id)
removeRealm
in interface RealmProvider
public void evictRealmOnRemoval(RealmModel realm)
public ClientModel addClient(RealmModel realm, String clientId)
addClient
in interface ClientProvider
public ClientModel addClient(RealmModel realm, String id, String clientId)
addClient
in interface ClientProvider
public List<ClientModel> getClients(RealmModel realm, Integer firstResult, Integer maxResults)
getClients
in interface ClientProvider
public List<ClientModel> getClients(RealmModel realm)
getClients
in interface ClientProvider
public List<ClientModel> getAlwaysDisplayInConsoleClients(RealmModel realm)
getAlwaysDisplayInConsoleClients
in interface ClientProvider
public boolean removeClient(String id, RealmModel realm)
removeClient
in interface ClientProvider
public void close()
close
in interface RealmProvider
close
in interface Provider
public RoleModel addRealmRole(RealmModel realm, String name)
addRealmRole
in interface RealmProvider
public RoleModel addRealmRole(RealmModel realm, String id, String name)
addRealmRole
in interface RealmProvider
public Set<RoleModel> getRealmRoles(RealmModel realm)
getRealmRoles
in interface RealmProvider
public Set<RoleModel> getClientRoles(RealmModel realm, ClientModel client)
getClientRoles
in interface ClientProvider
public Set<RoleModel> getRealmRoles(RealmModel realm, Integer first, Integer max)
getRealmRoles
in interface RealmProvider
public Set<RoleModel> getClientRoles(RealmModel realm, ClientModel client, Integer first, Integer max)
getClientRoles
in interface RealmProvider
public Set<RoleModel> searchForClientRoles(RealmModel realm, ClientModel client, String search, Integer first, Integer max)
searchForClientRoles
in interface RealmProvider
public Set<RoleModel> searchForRoles(RealmModel realm, String search, Integer first, Integer max)
searchForRoles
in interface RealmProvider
public RoleModel addClientRole(RealmModel realm, ClientModel client, String name)
addClientRole
in interface ClientProvider
public RoleModel addClientRole(RealmModel realm, ClientModel client, String id, String name)
addClientRole
in interface ClientProvider
public RoleModel getRealmRole(RealmModel realm, String name)
getRealmRole
in interface RealmProvider
public RoleModel getClientRole(RealmModel realm, ClientModel client, String name)
getClientRole
in interface ClientProvider
public boolean removeRole(RealmModel realm, RoleModel role)
removeRole
in interface RealmProvider
public RoleModel getRoleById(String id, RealmModel realm)
getRoleById
in interface RealmProvider
public GroupModel getGroupById(String id, RealmModel realm)
getGroupById
in interface RealmProvider
public void moveGroup(RealmModel realm, GroupModel group, GroupModel toParent)
moveGroup
in interface RealmProvider
public List<GroupModel> getGroups(RealmModel realm)
getGroups
in interface RealmProvider
public Long getGroupsCount(RealmModel realm, Boolean onlyTopGroups)
getGroupsCount
in interface RealmProvider
public Long getClientsCount(RealmModel realm)
getClientsCount
in interface RealmProvider
public Long getGroupsCountByNameContaining(RealmModel realm, String search)
getGroupsCountByNameContaining
in interface RealmProvider
public List<GroupModel> getGroupsByRole(RealmModel realm, RoleModel role, int firstResult, int maxResults)
getGroupsByRole
in interface RealmProvider
public List<GroupModel> getTopLevelGroups(RealmModel realm)
getTopLevelGroups
in interface RealmProvider
public List<GroupModel> getTopLevelGroups(RealmModel realm, Integer first, Integer max)
getTopLevelGroups
in interface RealmProvider
public List<GroupModel> searchForGroupByName(RealmModel realm, String search, Integer first, Integer max)
searchForGroupByName
in interface RealmProvider
public boolean removeGroup(RealmModel realm, GroupModel group)
removeGroup
in interface RealmProvider
public GroupModel createGroup(RealmModel realm, String id, String name, GroupModel toParent)
createGroup
in interface RealmProvider
public void addTopLevelGroup(RealmModel realm, GroupModel subGroup)
addTopLevelGroup
in interface RealmProvider
public ClientModel getClientById(String id, RealmModel realm)
getClientById
in interface ClientLookupProvider
protected ClientModel cacheClient(RealmModel realm, ClientModel delegate, Long revision)
protected ClientModel validateCache(RealmModel realm, CachedClient cached)
public List<ClientModel> searchClientsByClientId(String clientId, Integer firstResult, Integer maxResults, RealmModel realm)
searchClientsByClientId
in interface ClientLookupProvider
public ClientModel getClientByClientId(String clientId, RealmModel realm)
getClientByClientId
in interface ClientLookupProvider
public ClientScopeModel getClientScopeById(String id, RealmModel realm)
getClientScopeById
in interface RealmProvider
public ClientInitialAccessModel createClientInitialAccessModel(RealmModel realm, int expiration, int count)
createClientInitialAccessModel
in interface RealmProvider
public ClientInitialAccessModel getClientInitialAccessModel(RealmModel realm, String id)
getClientInitialAccessModel
in interface RealmProvider
public void removeClientInitialAccessModel(RealmModel realm, String id)
removeClientInitialAccessModel
in interface RealmProvider
public List<ClientInitialAccessModel> listClientInitialAccess(RealmModel realm)
listClientInitialAccess
in interface RealmProvider
public void removeExpiredClientInitialAccess()
removeExpiredClientInitialAccess
in interface RealmProvider
public void decreaseRemainingCount(RealmModel realm, ClientInitialAccessModel clientInitialAccess)
decreaseRemainingCount
in interface RealmProvider
Copyright © 2020 JBoss by Red Hat. All rights reserved.