Package org.keycloak.models
Interface RealmProvider
- All Superinterfaces:
Provider
- All Known Subinterfaces:
CacheRealmProvider
- All Known Implementing Classes:
JpaRealmProvider
,RealmCacheSession
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptiondefault ClientInitialAccessModel
createClientInitialAccessModel
(RealmModel realm, int expiration, int count) createRealm
(String name) Creates new realm with the given name.createRealm
(String id, String name) Created new realm with given ID and name.default void
decreaseRemainingCount
(RealmModel realm, ClientInitialAccessModel clientInitialAccess) boolean
deleteLocalizationText
(RealmModel realm, String locale, String key) boolean
deleteLocalizationTextsByLocale
(RealmModel realm, String locale) default ClientInitialAccessModel
getClientInitialAccessModel
(RealmModel realm, String id) 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.default Stream<ClientInitialAccessModel>
Returns client's initial access as a stream.default void
removeClientInitialAccessModel
(RealmModel realm, String id) 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)
-
Method Details
-
createRealm
Creates new realm with the given name. The internal ID will be generated automatically.- Parameters:
name
- String name of the realm- Returns:
- Model of the created realm.
-
createRealm
Created new realm with given ID and name.- 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
Exact search for a realm by its internal ID.- Parameters:
id
- Internal ID of the realm.- Returns:
- Model of the realm
-
getRealmByName
Exact search for a realm by its name.- Parameters:
name
- String name of the realm- Returns:
- Model of the realm
-
getRealmsStream
Stream<RealmModel> getRealmsStream()Returns realms as a stream.- Returns:
- Stream of
RealmModel
. Never returnsnull
.
-
getRealmsWithProviderTypeStream
Returns stream of realms which has component with the given provider type.- Parameters:
type
-Class<?>
Type of the provider.- Returns:
- Stream of
RealmModel
. Never returnsnull
.
-
removeRealm
Removes realm with the given id.- Parameters:
id
- of realm.- Returns:
true
if the realm was successfully removed.
-
createClientInitialAccessModel
default ClientInitialAccessModel createClientInitialAccessModel(RealmModel realm, int expiration, int count) -
getClientInitialAccessModel
-
removeClientInitialAccessModel
-
listClientInitialAccessStream
Returns client's initial access as a stream.- Parameters:
realm
-RealmModel
The realm where to list client's initial access.- Returns:
- Stream of
ClientInitialAccessModel
. Never returnsnull
.
-
removeExpiredClientInitialAccess
void removeExpiredClientInitialAccess()Removes all expired client initial accesses from all realms. -
decreaseRemainingCount
-
saveLocalizationText
-
saveLocalizationTexts
-
updateLocalizationText
-
deleteLocalizationTextsByLocale
-
deleteLocalizationText
-
getLocalizationTextsById
-