Package org.keycloak.models.map.realm
Class MapRealmProvider
java.lang.Object
org.keycloak.models.map.realm.MapRealmProvider
- All Implemented Interfaces:
RealmProvider
,Provider
-
Constructor Summary
ConstructorDescriptionMapRealmProvider
(KeycloakSession session, MapStorage<MapRealmEntity, RealmModel> realmStore) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createRealm
(String name) Creates new realm with the given name.createRealm
(String id, String name) Created new realm with given ID and name.boolean
deleteLocalizationText
(RealmModel realm, String locale, String key) boolean
deleteLocalizationTextsByLocale
(RealmModel realm, String locale) getLocalizationTextsById
(RealmModel realm, String locale, String key) Exact search for a realm by its internal ID.getRealmByName
(String name) Exact search for a realm by its name.Returns realms as a stream.getRealmsWithProviderTypeStream
(Class<?> type) Returns stream of realms which has component with the given provider type.void
Removes all expired client initial accesses from all realms.boolean
removeRealm
(String id) Removes realm with the given id.void
saveLocalizationText
(RealmModel realm, String locale, String key, String text) void
saveLocalizationTexts
(RealmModel realm, String locale, Map<String, String> localizationTexts) boolean
updateLocalizationText
(RealmModel realm, String locale, String key, String text) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.models.RealmProvider
createClientInitialAccessModel, decreaseRemainingCount, getClientInitialAccessModel, listClientInitialAccessStream, removeClientInitialAccessModel
-
Constructor Details
-
MapRealmProvider
-
-
Method Details
-
createRealm
Description copied from interface:RealmProvider
Creates new realm with the given name. The internal ID will be generated automatically.- Specified by:
createRealm
in interfaceRealmProvider
- Parameters:
name
- String name of the realm- Returns:
- Model of the created realm.
-
createRealm
Description copied from interface:RealmProvider
Created new realm with given ID and name.- Specified by:
createRealm
in interfaceRealmProvider
- Parameters:
id
- Internal ID of the realm ornull
if one is to be created by the underlying store. If the store expects the ID to have a certain format (for exampleUUID
) and the supplied ID doesn't follow the expected format, the store may replace theid
with a new one at its own discretion.name
- String name of the realm- Returns:
- Model of the created realm.
-
getRealm
Description copied from interface:RealmProvider
Exact search for a realm by its internal ID.- Specified by:
getRealm
in interfaceRealmProvider
- Parameters:
id
- Internal ID of the realm.- Returns:
- Model of the realm
-
getRealmByName
Description copied from interface:RealmProvider
Exact search for a realm by its name.- Specified by:
getRealmByName
in interfaceRealmProvider
- Parameters:
name
- String name of the realm- Returns:
- Model of the realm
-
getRealmsStream
Description copied from interface:RealmProvider
Returns realms as a stream.- Specified by:
getRealmsStream
in interfaceRealmProvider
- Returns:
- Stream of
RealmModel
. Never returnsnull
.
-
getRealmsWithProviderTypeStream
Description copied from interface:RealmProvider
Returns stream of realms which has component with the given provider type.- Specified by:
getRealmsWithProviderTypeStream
in interfaceRealmProvider
- Parameters:
type
-Class<?>
Type of the provider.- Returns:
- Stream of
RealmModel
. Never returnsnull
.
-
removeRealm
Description copied from interface:RealmProvider
Removes realm with the given id.- Specified by:
removeRealm
in interfaceRealmProvider
- Parameters:
id
- of realm.- Returns:
true
if the realm was successfully removed.
-
removeExpiredClientInitialAccess
public void removeExpiredClientInitialAccess()Description copied from interface:RealmProvider
Removes all expired client initial accesses from all realms.- Specified by:
removeExpiredClientInitialAccess
in interfaceRealmProvider
-
saveLocalizationText
- Specified by:
saveLocalizationText
in interfaceRealmProvider
-
saveLocalizationTexts
public void saveLocalizationTexts(RealmModel realm, String locale, Map<String, String> localizationTexts) - Specified by:
saveLocalizationTexts
in interfaceRealmProvider
-
updateLocalizationText
- Specified by:
updateLocalizationText
in interfaceRealmProvider
-
deleteLocalizationTextsByLocale
- Specified by:
deleteLocalizationTextsByLocale
in interfaceRealmProvider
-
deleteLocalizationText
- Specified by:
deleteLocalizationText
in interfaceRealmProvider
-
getLocalizationTextsById
- Specified by:
getLocalizationTextsById
in interfaceRealmProvider
-
close
public void close()
-