Class ImportKeycloakSession
java.lang.Object
org.keycloak.models.map.datastore.ImportKeycloakSession
- All Implemented Interfaces:
AutoCloseable,KeycloakSession
This implementation of
KeycloakSession wraps an existing session and directs all calls to the datastore provider
to a separate KeycloakSessionFactory.
This allows it to create instantiate different storage providers during import.- Author:
- Alexander Schwartz
-
Constructor Summary
ConstructorsConstructorDescriptionImportKeycloakSession(ImportSessionFactoryWrapper factory, KeycloakSession session) -
Method Summary
Modifier and TypeMethodDescriptionClient Policy Managerclients()Returns a managed provider instance.Returns a managed provider instance.voidclose()voidenlistForClose(Provider provider) getAllProviders(Class<T> clazz) getAttribute(String attribute) <T> TgetAttribute(String attribute, Class<T> clazz) <T> TgetAttributeOrDefault(String attribute, T defaultValue) <T extends Provider>
TgetComponentProvider(Class<T> clazz, String componentId) Returns a component provider for a component from the realm that is relevant to this session.<T extends Provider>
TgetComponentProvider(Class<T> clazz, String componentId, Function<KeycloakSessionFactory, ComponentModel> modelGetter) Returns a component provider for a component from the realm that is relevant to this session.<T extends Provider>
TgetProvider(Class<T> clazz) Get dedicated provider instance of provider type clazz that was created for this session.<T extends Provider>
TgetProvider(Class<T> clazz, String id) Get dedicated provider instance for a specific provider factory of id of provider type clazz that was created for this session.<T extends Provider>
TgetProvider(Class<T> clazz, ComponentModel componentModel) getProviderClass(String providerClassName) groups()Returns a managed group provider instance.voidinvalidate(InvalidationHandler.InvalidableObjectType type, Object... ids) Invalidates intermediate states of the given objects, both immediately and at the end of this session.keys()Key managerlistProviderIds(Class<T> clazz) Get all provider factories that manage provider instances of class.Returns a managed provider instance.realms()Returns a managed provider instance.removeAttribute(String attribute) roles()Returns a managed provider instance.sessions()Returns a managed provider instance.voidsetAttribute(String name, Object value) theme()Theme managertokens()Token managerusers()A cached view of all users in system including users loaded by UserStorageProvidersvault()Vault transcriber
-
Constructor Details
-
ImportKeycloakSession
-
-
Method Details
-
getContext
- Specified by:
getContextin interfaceKeycloakSession
-
getTransactionManager
- Specified by:
getTransactionManagerin interfaceKeycloakSession
-
getProvider
Description copied from interface:KeycloakSessionGet dedicated provider instance of provider type clazz that was created for this session. If one hasn't been created yet, find the factory and allocate by calling ProviderFactory.create(KeycloakSession). The provider to use is determined by the "provider" config entry in keycloak-server boot configuration. (keycloak-server.json)- Specified by:
getProviderin interfaceKeycloakSession- Returns:
-
getProvider
Description copied from interface:KeycloakSessionGet dedicated provider instance for a specific provider factory of id of provider type clazz that was created for this session. If one hasn't been created yet, find the factory and allocate by calling ProviderFactory.create(KeycloakSession).- Specified by:
getProviderin interfaceKeycloakSession- Returns:
-
getComponentProvider
Description copied from interface:KeycloakSessionReturns a component provider for a component from the realm that is relevant to this session. The relevant realm must be set prior to calling this method in the context, seeKeycloakContext.getRealm().- Specified by:
getComponentProviderin interfaceKeycloakSessioncomponentId- Component configuration- Returns:
- Provider configured according to the ,
nullif it cannot be instantiated.
-
getComponentProvider
public <T extends Provider> T getComponentProvider(Class<T> clazz, String componentId, Function<KeycloakSessionFactory, ComponentModel> modelGetter) Description copied from interface:KeycloakSessionReturns a component provider for a component from the realm that is relevant to this session. The relevant realm must be set prior to calling this method in the context, seeKeycloakContext.getRealm().- Specified by:
getComponentProviderin interfaceKeycloakSessioncomponentId- Component configurationmodelGetter- Getter to retrieve componentModel- Returns:
- Provider configured according to the ,
nullif it cannot be instantiated.
-
getProvider
- Specified by:
getProviderin interfaceKeycloakSession- Returns:
-
listProviderIds
Description copied from interface:KeycloakSessionGet all provider factories that manage provider instances of class.- Specified by:
listProviderIdsin interfaceKeycloakSession- Returns:
-
getAllProviders
- Specified by:
getAllProvidersin interfaceKeycloakSession
-
getProviderClass
- Specified by:
getProviderClassin interfaceKeycloakSession
-
getAttribute
- Specified by:
getAttributein interfaceKeycloakSession
-
getAttribute
- Specified by:
getAttributein interfaceKeycloakSession
-
getAttributeOrDefault
- Specified by:
getAttributeOrDefaultin interfaceKeycloakSession
-
removeAttribute
- Specified by:
removeAttributein interfaceKeycloakSession
-
setAttribute
- Specified by:
setAttributein interfaceKeycloakSession
-
getAttributes
- Specified by:
getAttributesin interfaceKeycloakSession
-
invalidate
Description copied from interface:KeycloakSessionInvalidates intermediate states of the given objects, both immediately and at the end of this session.- Specified by:
invalidatein interfaceKeycloakSession- Parameters:
type- Type of the objects to invalidateids- Parameters used for the invalidation
-
enlistForClose
- Specified by:
enlistForClosein interfaceKeycloakSession
-
getKeycloakSessionFactory
- Specified by:
getKeycloakSessionFactoryin interfaceKeycloakSession
-
realms
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
realmsin interfaceKeycloakSession- Returns:
-
clients
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
clientsin interfaceKeycloakSession- Returns:
-
clientScopes
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
clientScopesin interfaceKeycloakSession- Returns:
- Currently used ClientScopeProvider instance.
-
groups
Description copied from interface:KeycloakSessionReturns a managed group provider instance.- Specified by:
groupsin interfaceKeycloakSession- Returns:
- Currently used GroupProvider instance.
-
roles
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
rolesin interfaceKeycloakSession- Returns:
-
sessions
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
sessionsin interfaceKeycloakSession- Returns:
-
loginFailures
Description copied from interface:KeycloakSessionReturns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.- Specified by:
loginFailuresin interfaceKeycloakSession- Returns:
UserLoginFailureProvider
-
authenticationSessions
- Specified by:
authenticationSessionsin interfaceKeycloakSession
-
singleUseObjects
- Specified by:
singleUseObjectsin interfaceKeycloakSession
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceKeycloakSession
-
users
Description copied from interface:KeycloakSessionA cached view of all users in system including users loaded by UserStorageProviders- Specified by:
usersin interfaceKeycloakSession- Returns:
- UserProvider instance
-
keys
Description copied from interface:KeycloakSessionKey manager- Specified by:
keysin interfaceKeycloakSession- Returns:
-
theme
Description copied from interface:KeycloakSessionTheme manager- Specified by:
themein interfaceKeycloakSession- Returns:
-
tokens
Description copied from interface:KeycloakSessionToken manager- Specified by:
tokensin interfaceKeycloakSession- Returns:
-
vault
Description copied from interface:KeycloakSessionVault transcriber- Specified by:
vaultin interfaceKeycloakSession
-
clientPolicy
Description copied from interface:KeycloakSessionClient Policy Manager- Specified by:
clientPolicyin interfaceKeycloakSession
-