public class JpaRealmProvider extends Object implements RealmProvider, ClientProvider, ClientScopeProvider, GroupProvider, RoleProvider, DeploymentStateProvider
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected static org.jboss.logging.Logger |
logger |
Constructor and Description |
---|
JpaRealmProvider(KeycloakSession session,
javax.persistence.EntityManager em,
Set<String> clientSearchableAttributes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClientRole, addClientRole, createClientInitialAccessModel, createGroup, createGroup, createGroup, decreaseRemainingCount, getAlwaysDisplayInConsoleClients, getClientByClientId, getClientById, getClientInitialAccessModel, getClientRole, getClientRoles, getClientRoles, getClients, getClients, getClientScopeById, getGroupById, getGroups, getGroupsByRole, getRealmRoles, getRealmRoles, getRealms, getRealmsWithProviderType, getRoleById, getTopLevelGroups, getTopLevelGroups, listClientInitialAccess, listClientInitialAccessStream, removeClient, removeClientInitialAccessModel, removeRole, searchClientsByClientId, searchForClientRoles, searchForGroupByName, searchForRoles
addClientScope
getClientRolesStream
protected static final org.jboss.logging.Logger logger
protected javax.persistence.EntityManager em
public JpaRealmProvider(KeycloakSession session, javax.persistence.EntityManager em, Set<String> clientSearchableAttributes)
public MigrationModel getMigrationModel()
getMigrationModel
in interface DeploymentStateProvider
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 Stream<RealmModel> getRealmsWithProviderTypeStream(Class<?> providerType)
getRealmsWithProviderTypeStream
in interface RealmProvider
public Stream<RealmModel> getRealmsStream()
getRealmsStream
in interface RealmProvider
public RealmModel getRealmByName(String name)
getRealmByName
in interface RealmProvider
public boolean removeRealm(String id)
removeRealm
in interface RealmProvider
public RoleModel addRealmRole(RealmModel realm, String name)
addRealmRole
in interface RealmProvider
addRealmRole
in interface RoleProvider
public RoleModel addRealmRole(RealmModel realm, String id, String name)
addRealmRole
in interface RealmProvider
addRealmRole
in interface RoleProvider
public RoleModel getRealmRole(RealmModel realm, String name)
getRealmRole
in interface RealmProvider
getRealmRole
in interface RoleLookupProvider
public RoleModel addClientRole(ClientModel client, String name)
addClientRole
in interface RoleProvider
public RoleModel addClientRole(ClientModel client, String id, String name)
addClientRole
in interface RoleProvider
public Stream<RoleModel> getRealmRolesStream(RealmModel realm)
getRealmRolesStream
in interface RoleProvider
public RoleModel getClientRole(ClientModel client, String name)
getClientRole
in interface RoleLookupProvider
public Map<ClientModel,Set<String>> getAllRedirectUrisOfEnabledClients(RealmModel realm)
getAllRedirectUrisOfEnabledClients
in interface ClientProvider
public Stream<RoleModel> getRealmRolesStream(RealmModel realm, Integer first, Integer max)
getRealmRolesStream
in interface RoleProvider
public Stream<RoleModel> getClientRolesStream(ClientModel client, Integer first, Integer max)
getClientRolesStream
in interface RoleProvider
protected Stream<RoleModel> getRolesStream(javax.persistence.TypedQuery<RoleEntity> query, RealmModel realm, Integer first, Integer max)
public Stream<RoleModel> searchForClientRolesStream(ClientModel client, String search, Integer first, Integer max)
searchForClientRolesStream
in interface RoleLookupProvider
public Stream<RoleModel> searchForRolesStream(RealmModel realm, String search, Integer first, Integer max)
searchForRolesStream
in interface RoleLookupProvider
protected Stream<RoleModel> searchForRoles(javax.persistence.TypedQuery<RoleEntity> query, RealmModel realm, String search, Integer first, Integer max)
public boolean removeRole(RoleModel role)
removeRole
in interface RoleProvider
public RoleContainerModel.RoleRemovedEvent roleRemovedEvent(RoleModel role)
public void removeRoles(RealmModel realm)
removeRoles
in interface RoleProvider
public void removeRoles(ClientModel client)
removeRoles
in interface RoleProvider
public RoleModel getRoleById(RealmModel realm, String id)
getRoleById
in interface RoleLookupProvider
public GroupModel getGroupById(RealmModel realm, String id)
getGroupById
in interface RealmProvider
getGroupById
in interface GroupLookupProvider
public void moveGroup(RealmModel realm, GroupModel group, GroupModel toParent)
moveGroup
in interface GroupProvider
moveGroup
in interface RealmProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm)
getGroupsStream
in interface GroupProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
getGroupsStream
in interface GroupProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm, Stream<String> ids, Integer first, Integer max)
getGroupsStream
in interface GroupProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm, Stream<String> ids)
getGroupsStream
in interface GroupProvider
public Long getGroupsCount(RealmModel realm, Stream<String> ids, String search)
getGroupsCount
in interface GroupProvider
public Long getGroupsCount(RealmModel realm, Boolean onlyTopGroups)
getGroupsCount
in interface GroupProvider
getGroupsCount
in interface RealmProvider
public long getClientsCount(RealmModel realm)
getClientsCount
in interface ClientProvider
getClientsCount
in interface RealmProvider
public Long getGroupsCountByNameContaining(RealmModel realm, String search)
getGroupsCountByNameContaining
in interface GroupProvider
getGroupsCountByNameContaining
in interface RealmProvider
public Stream<GroupModel> getGroupsByRoleStream(RealmModel realm, RoleModel role, Integer firstResult, Integer maxResults)
getGroupsByRoleStream
in interface GroupProvider
public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm)
getTopLevelGroupsStream
in interface GroupProvider
public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm, Integer first, Integer max)
getTopLevelGroupsStream
in interface GroupProvider
public boolean removeGroup(RealmModel realm, GroupModel group)
removeGroup
in interface GroupProvider
removeGroup
in interface RealmProvider
public GroupModel createGroup(RealmModel realm, String id, String name, GroupModel toParent)
createGroup
in interface GroupProvider
createGroup
in interface RealmProvider
public void addTopLevelGroup(RealmModel realm, GroupModel subGroup)
addTopLevelGroup
in interface GroupProvider
addTopLevelGroup
in interface RealmProvider
public void preRemove(RealmModel realm, RoleModel role)
public ClientModel addClient(RealmModel realm, String clientId)
addClient
in interface ClientProvider
addClient
in interface RealmProvider
public ClientModel addClient(RealmModel realm, String id, String clientId)
addClient
in interface ClientProvider
addClient
in interface RealmProvider
public Stream<ClientModel> getClientsStream(RealmModel realm)
getClientsStream
in interface ClientProvider
public Stream<ClientModel> getClientsStream(RealmModel realm, Integer firstResult, Integer maxResults)
getClientsStream
in interface ClientProvider
public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
getAlwaysDisplayInConsoleClientsStream
in interface ClientProvider
public ClientModel getClientById(RealmModel realm, String id)
getClientById
in interface ClientLookupProvider
public ClientModel getClientByClientId(RealmModel realm, String clientId)
getClientByClientId
in interface ClientLookupProvider
public Stream<ClientModel> searchClientsByClientIdStream(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
searchClientsByClientIdStream
in interface ClientLookupProvider
public Stream<ClientModel> searchClientsByAttributes(RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
searchClientsByAttributes
in interface ClientLookupProvider
public void removeClients(RealmModel realm)
removeClients
in interface ClientProvider
public boolean removeClient(RealmModel realm, String id)
removeClient
in interface ClientProvider
public ClientScopeModel getClientScopeById(RealmModel realm, String id)
getClientScopeById
in interface RealmProvider
getClientScopeById
in interface ClientScopeLookupProvider
public Stream<ClientScopeModel> getClientScopesStream(RealmModel realm)
getClientScopesStream
in interface ClientScopeProvider
public ClientScopeModel addClientScope(RealmModel realm, String id, String name)
addClientScope
in interface ClientScopeProvider
public boolean removeClientScope(RealmModel realm, String id)
removeClientScope
in interface ClientScopeProvider
public void removeClientScopes(RealmModel realm)
removeClientScopes
in interface ClientScopeProvider
public void addClientScopes(RealmModel realm, ClientModel client, Set<ClientScopeModel> clientScopes, boolean defaultScope)
addClientScopes
in interface ClientProvider
public void removeClientScope(RealmModel realm, ClientModel client, ClientScopeModel clientScope)
removeClientScope
in interface ClientProvider
public Map<String,ClientScopeModel> getClientScopes(RealmModel realm, ClientModel client, boolean defaultScope)
getClientScopes
in interface ClientLookupProvider
public Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Integer first, Integer max)
searchForGroupByNameStream
in interface GroupLookupProvider
public void removeExpiredClientInitialAccess()
removeExpiredClientInitialAccess
in interface RealmProvider
public boolean updateLocalizationText(RealmModel realm, String locale, String key, String text)
updateLocalizationText
in interface RealmProvider
public void saveLocalizationText(RealmModel realm, String locale, String key, String text)
saveLocalizationText
in interface RealmProvider
public void saveLocalizationTexts(RealmModel realm, String locale, Map<String,String> localizationTexts)
saveLocalizationTexts
in interface RealmProvider
public boolean deleteLocalizationTextsByLocale(RealmModel realm, String locale)
deleteLocalizationTextsByLocale
in interface RealmProvider
public String getLocalizationTextsById(RealmModel realm, String locale, String key)
getLocalizationTextsById
in interface RealmProvider
public boolean deleteLocalizationText(RealmModel realm, String locale, String key)
deleteLocalizationText
in interface RealmProvider
Copyright © 2021 JBoss by Red Hat. All rights reserved.