Class ImportSessionFactoryWrapper
java.lang.Object
org.keycloak.models.map.datastore.ImportSessionFactoryWrapper
- All Implemented Interfaces:
KeycloakSessionFactory
,InvalidationHandler
,ProviderEventManager
This wraps an existing KeycloakSessionFactory and redirects all calls to a
MapStorageProvider
to
ConcurrentHashMapStorageProvider
. This allows all operations to
be in-memory. The final contents of the store can then be copied over to the final store once the import is complete.
For this to work, the CHM provider needs to be registered as a provider.- Author:
- Alexander Schwartz
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.provider.InvalidationHandler
InvalidationHandler.InvalidableObjectType, InvalidationHandler.ObjectType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
create()
getProviderFactoriesStream
(Class<? extends Provider> clazz) Returns stream of provider factories for the given provider.<T extends Provider>
ProviderFactory<T>getProviderFactory
(Class<T> clazz) <T extends Provider>
ProviderFactory<T>getProviderFactory
(Class<T> clazz, String id) <T extends Provider>
ProviderFactory<T>getProviderFactory
(Class<T> clazz, String realmId, String componentId, Function<KeycloakSessionFactory, ComponentModel> modelGetter) long
getSpis()
void
invalidate
(KeycloakSession session, InvalidationHandler.InvalidableObjectType type, Object... params) Invalidates intermediate states of the given objectsvoid
publish
(ProviderEvent event) void
register
(ProviderEventListener listener) void
unregister
(ProviderEventListener listener)
-
Constructor Details
-
ImportSessionFactoryWrapper
-
-
Method Details
-
create
- Specified by:
create
in interfaceKeycloakSessionFactory
-
getSpis
- Specified by:
getSpis
in interfaceKeycloakSessionFactory
-
getSpi
- Specified by:
getSpi
in interfaceKeycloakSessionFactory
-
getProviderFactory
- Specified by:
getProviderFactory
in interfaceKeycloakSessionFactory
-
getProviderFactory
- Specified by:
getProviderFactory
in interfaceKeycloakSessionFactory
-
getProviderFactory
public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz, String realmId, String componentId, Function<KeycloakSessionFactory, ComponentModel> modelGetter) - Specified by:
getProviderFactory
in interfaceKeycloakSessionFactory
-
getProviderFactoriesStream
Description copied from interface:KeycloakSessionFactory
Returns stream of provider factories for the given provider.- Specified by:
getProviderFactoriesStream
in interfaceKeycloakSessionFactory
- Parameters:
clazz
-Class<? extends Provider>
- Returns:
Stream<ProviderFactory>
Stream of provider factories. Never returnsnull
.
-
getServerStartupTimestamp
public long getServerStartupTimestamp()- Specified by:
getServerStartupTimestamp
in interfaceKeycloakSessionFactory
-
close
public void close()- Specified by:
close
in interfaceKeycloakSessionFactory
-
invalidate
public void invalidate(KeycloakSession session, InvalidationHandler.InvalidableObjectType type, Object... params) Description copied from interface:InvalidationHandler
Invalidates intermediate states of the given objects- Specified by:
invalidate
in interfaceInvalidationHandler
- Parameters:
session
- KeycloakSessiontype
- Type of the objects to invalidateparams
- Parameters used for the invalidation
-
register
- Specified by:
register
in interfaceProviderEventManager
-
unregister
- Specified by:
unregister
in interfaceProviderEventManager
-
publish
- Specified by:
publish
in interfaceProviderEventManager
-