public class MapRealmProvider<K> extends Object implements RealmProvider
Constructor and Description |
---|
MapRealmProvider(KeycloakSession session,
MapStorage<K,MapRealmEntity<K>,RealmModel> realmStore) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClient, addClientRole, addClientRole, addRealmRole, 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
getClientsStream
addClientScope
getGroupsCount, getGroupsStream, getGroupsStream
addClientRole, getClientRolesStream, getRealmRolesStream
public MapRealmProvider(KeycloakSession session, MapStorage<K,MapRealmEntity<K>,RealmModel> realmStore)
public RealmModel createRealm(String name)
RealmProvider
createRealm
in interface RealmProvider
name
- String name of the realmpublic RealmModel createRealm(String id, String name)
RealmProvider
createRealm
in interface RealmProvider
id
- Internal ID of the realm or null
if one is to be created by the underlying storename
- String name of the realmpublic RealmModel getRealm(String id)
RealmProvider
getRealm
in interface RealmProvider
id
- Internal ID of the realm.public RealmModel getRealmByName(String name)
RealmProvider
getRealmByName
in interface RealmProvider
name
- String name of the realmpublic Stream<RealmModel> getRealmsStream()
RealmProvider
getRealmsStream
in interface RealmProvider
RealmModel
. Never returns null
.public Stream<RealmModel> getRealmsWithProviderTypeStream(Class<?> type)
RealmProvider
getRealmsWithProviderTypeStream
in interface RealmProvider
type
- Class<?>
Type of the provider.RealmModel
. Never returns null
.public boolean removeRealm(String id)
RealmProvider
removeRealm
in interface RealmProvider
id
- of realm.true
if the realm was successfully removed.public void removeExpiredClientInitialAccess()
RealmProvider
removeExpiredClientInitialAccess
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 updateLocalizationText(RealmModel realm, String locale, String key, String text)
updateLocalizationText
in interface RealmProvider
public boolean deleteLocalizationTextsByLocale(RealmModel realm, String locale)
deleteLocalizationTextsByLocale
in interface RealmProvider
public boolean deleteLocalizationText(RealmModel realm, String locale, String key)
deleteLocalizationText
in interface RealmProvider
public String getLocalizationTextsById(RealmModel realm, String locale, String key)
getLocalizationTextsById
in interface RealmProvider
@Deprecated public ClientModel addClient(RealmModel realm, String id, String clientId)
ClientProvider
clientId
to the given realm.addClient
in interface ClientProvider
addClient
in interface RealmProvider
realm
- Realm owning this client.id
- Internal ID of the client or null
if one is to be created by the underlying storeclientId
- String that identifies the client to the external parties.
Maps to client_id
in OIDC or entityID
in SAML.@Deprecated public long getClientsCount(RealmModel realm)
ClientProvider
getClientsCount
in interface ClientProvider
getClientsCount
in interface RealmProvider
realm
- Realm.@Deprecated public Stream<ClientModel> getClientsStream(RealmModel realm, Integer firstResult, Integer maxResults)
ClientProvider
getClientsStream
in interface ClientProvider
realm
- Realm.firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
ClientProvider
getAlwaysDisplayInConsoleClientsStream
in interface ClientProvider
realm
- Realm owning the clients.null
.@Deprecated public boolean removeClient(RealmModel realm, String id)
ClientProvider
removeClient
in interface ClientProvider
realm
- Realm.id
- Internal ID of the clienttrue
if the client existed and has been removed, false
otherwise.@Deprecated public void removeClients(RealmModel realm)
ClientProvider
removeClients
in interface ClientProvider
realm
- Realm.@Deprecated public ClientModel getClientById(RealmModel realm, String id)
ClientLookupProvider
getClientById
in interface ClientLookupProvider
realm
- Realm to limit the search.id
- Internal IDnull
if no client is found.@Deprecated public ClientModel getClientByClientId(RealmModel realm, String clientId)
ClientLookupProvider
getClientByClientId
in interface ClientLookupProvider
realm
- Realm to limit the search for clients.clientId
- String that identifies the client to the external parties.
Maps to client_id
in OIDC or entityID
in SAML.null
if no client is found.@Deprecated public Stream<ClientModel> searchClientsByClientIdStream(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
ClientLookupProvider
searchClientsByClientIdStream
in interface ClientLookupProvider
realm
- Realm to limit the search for clients.clientId
- Searched substring of the public client
identifier (client_id
in OIDC or entityID
in SAML.)firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public Stream<ClientModel> searchClientsByAttributes(RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
searchClientsByAttributes
in interface ClientLookupProvider
@Deprecated public void addClientScopes(RealmModel realm, ClientModel client, Set<ClientScopeModel> clientScopes, boolean defaultScope)
ClientProvider
addClientScopes
in interface ClientProvider
realm
- Realm.client
- Client.clientScopes
- to be assigneddefaultScope
- if true the scopes are assigned as default, or optional in case of false@Deprecated public void removeClientScope(RealmModel realm, ClientModel client, ClientScopeModel clientScope)
ClientProvider
removeClientScope
in interface ClientProvider
realm
- Realm.client
- Client.clientScope
- to be unassigned@Deprecated public Map<String,ClientScopeModel> getClientScopes(RealmModel realm, ClientModel client, boolean defaultScopes)
ClientLookupProvider
defaultScope
is true
) or all optional scopes (if defaultScope
is false
) linked with the clientgetClientScopes
in interface ClientLookupProvider
realm
- Realmclient
- ClientdefaultScopes
- if true default scopes, if false optional scopes, are returned@Deprecated public ClientScopeModel getClientScopeById(RealmModel realm, String id)
ClientScopeLookupProvider
getClientScopeById
in interface RealmProvider
getClientScopeById
in interface ClientScopeLookupProvider
realm
- Realm.id
- Internal ID of the role.@Deprecated public Stream<ClientScopeModel> getClientScopesStream(RealmModel realm)
ClientScopeProvider
getClientScopesStream
in interface ClientScopeProvider
realm
- Realm.null
.@Deprecated public ClientScopeModel addClientScope(RealmModel realm, String id, String name)
ClientScopeProvider
name
to the given realm.
Spaces in name
will be replaced by underscore so that scope name
can be used as value of scope parameter.addClientScope
in interface ClientScopeProvider
realm
- Realm owning this client scope.id
- Internal ID of the client scope or null
if one is to be created by the underlying storename
- String name of the client scope.@Deprecated public boolean removeClientScope(RealmModel realm, String id)
ClientScopeProvider
removeClientScope
in interface ClientScopeProvider
realm
- Realm.id
- Internal ID of the client scopetrue
if the client scope existed and has been removed, false
otherwise.@Deprecated public void removeClientScopes(RealmModel realm)
ClientScopeProvider
removeClientScopes
in interface ClientScopeProvider
realm
- Realm.@Deprecated public Map<ClientModel,Set<String>> getAllRedirectUrisOfEnabledClients(RealmModel realm)
ClientProvider
getAllRedirectUrisOfEnabledClients
in interface ClientProvider
@Deprecated public void moveGroup(RealmModel realm, GroupModel group, GroupModel toParent)
GroupProvider
moveGroup
in interface GroupProvider
moveGroup
in interface RealmProvider
realm
- Realm owning this group.group
- Group to update.toParent
- New parent group, or null
if we are moving the group to top level group.@Deprecated public GroupModel getGroupById(RealmModel realm, String id)
GroupLookupProvider
getGroupById
in interface RealmProvider
getGroupById
in interface GroupLookupProvider
realm
- Realm.id
- Id.@Deprecated public Long getGroupsCount(RealmModel realm, Boolean onlyTopGroups)
GroupProvider
getGroupsCount
in interface GroupProvider
getGroupsCount
in interface RealmProvider
realm
- Realm.onlyTopGroups
- When true the function returns a count of top level groups only.@Deprecated public Long getGroupsCountByNameContaining(RealmModel realm, String search)
GroupProvider
getGroupsCountByNameContaining
in interface GroupProvider
getGroupsCountByNameContaining
in interface RealmProvider
realm
- Realm.search
- Case insensitive string which will be searched for.@Deprecated public boolean removeGroup(RealmModel realm, GroupModel group)
GroupProvider
removeGroup
in interface GroupProvider
removeGroup
in interface RealmProvider
realm
- Realm.group
- Group.@Deprecated public GroupModel createGroup(RealmModel realm, String id, String name, GroupModel toParent)
GroupProvider
createGroup
in interface GroupProvider
createGroup
in interface RealmProvider
realm
- Realm.id
- Id, will be generated if null
.name
- Name.toParent
- Parent group, or null
if the group is top level group@Deprecated public void addTopLevelGroup(RealmModel realm, GroupModel subGroup)
GroupProvider
addTopLevelGroup
in interface GroupProvider
addTopLevelGroup
in interface RealmProvider
realm
- Realm.subGroup
- Group.@Deprecated public Stream<GroupModel> getGroupsStream(RealmModel realm)
GroupProvider
getGroupsStream
in interface GroupProvider
realm
- Realm.@Deprecated public Stream<GroupModel> getGroupsStream(RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
GroupProvider
getGroupsStream
in interface GroupProvider
realm
- Realm.ids
- Stream of ids.search
- Case insensitive string which will be searched for. Ignored if null.first
- Index of the first result to return. Ignored if negative or null
.max
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public Stream<GroupModel> getGroupsByRoleStream(RealmModel realm, RoleModel role, Integer firstResult, Integer maxResults)
GroupProvider
getGroupsByRoleStream
in interface GroupProvider
realm
- Realm.role
- Role.firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm)
GroupProvider
getTopLevelGroupsStream
in interface GroupProvider
realm
- Realm.null
.@Deprecated public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm, Integer firstResult, Integer maxResults)
GroupProvider
getTopLevelGroupsStream
in interface GroupProvider
realm
- Realm.firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Integer firstResult, Integer maxResults)
GroupLookupProvider
searchForGroupByNameStream
in interface GroupLookupProvider
realm
- Realm.search
- Case sensitive searched string.firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public RoleModel addRealmRole(RealmModel realm, String id, String name)
RoleProvider
name
to the given realm.addRealmRole
in interface RealmProvider
addRealmRole
in interface RoleProvider
realm
- Realm owning this role.id
- Internal ID of the role or null
if one is to be created by the underlying storename
- String name of the role.@Deprecated public RoleModel getRealmRole(RealmModel realm, String name)
RoleLookupProvider
getRealmRole
in interface RealmProvider
getRealmRole
in interface RoleLookupProvider
realm
- Realm.name
- String name of the role.null
if no role is found.@Deprecated public Stream<RoleModel> getRealmRolesStream(RealmModel realm, Integer first, Integer max)
RoleProvider
getRealmRolesStream
in interface RoleProvider
realm
- Realm.first
- First result to return. Ignored if negative or null
.max
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public boolean removeRole(RoleModel role)
RoleProvider
removeRole
in interface RoleProvider
role
- Role to be removed.true
if the role existed and has been removed, false
otherwise.@Deprecated public void removeRoles(RealmModel realm)
RoleProvider
removeRoles
in interface RoleProvider
realm
- Realm.@Deprecated public RoleModel addClientRole(ClientModel client, String id, String name)
RoleProvider
name
to the given client.addClientRole
in interface RoleProvider
client
- Client owning this role.id
- Internal ID of the client role or null
if one is to be created by the underlying store.name
- String name of the role.@Deprecated public Stream<RoleModel> getClientRolesStream(ClientModel client, Integer first, Integer max)
RoleProvider
getClientRolesStream
in interface RoleProvider
client
- Client.first
- First result to return. Ignored if negative or null
.max
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public void removeRoles(ClientModel client)
RoleProvider
removeRoles
in interface RoleProvider
client
- Client.@Deprecated public RoleModel getRoleById(RealmModel realm, String id)
RoleLookupProvider
getRoleById
in interface RoleLookupProvider
realm
- Realm.id
- Internal ID of the role.@Deprecated public Stream<RoleModel> searchForRolesStream(RealmModel realm, String search, Integer first, Integer max)
RoleLookupProvider
searchForRolesStream
in interface RoleLookupProvider
realm
- Realm.search
- Searched substring of the role's name or description.first
- First result to return. Ignored if negative or null
.max
- Maximum number of results to return. Ignored if negative or null
.null
.@Deprecated public RoleModel getClientRole(ClientModel client, String name)
RoleLookupProvider
getClientRole
in interface RoleLookupProvider
client
- Client.name
- String name of the role.null
if no role is found.@Deprecated public Stream<RoleModel> searchForClientRolesStream(ClientModel client, String search, Integer first, Integer max)
RoleLookupProvider
searchForClientRolesStream
in interface RoleLookupProvider
client
- Client.search
- String to search by role's name or description.first
- First result to return. Ignored if negative or null
.max
- Maximum number of results to return. Ignored if negative or null
.null
.Copyright © 2021 JBoss by Red Hat. All rights reserved.