Class ImportSessionFactoryWrapper
- java.lang.Object
-
- org.keycloak.models.map.datastore.ImportSessionFactoryWrapper
-
- All Implemented Interfaces:
KeycloakSessionFactory
,InvalidationHandler
,ProviderEventManager
public class ImportSessionFactoryWrapper extends Object implements KeycloakSessionFactory
This wraps an existing KeycloakSessionFactory and redirects all calls to aMapStorageProvider
toConcurrentHashMapStorageProvider
. 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
Constructors Constructor Description ImportSessionFactoryWrapper(KeycloakSessionFactory keycloakSessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
KeycloakSession
create()
Stream<ProviderFactory>
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
getServerStartupTimestamp()
Spi
getSpi(Class<? extends Provider> providerClass)
Set<Spi>
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 Detail
-
ImportSessionFactoryWrapper
public ImportSessionFactoryWrapper(KeycloakSessionFactory keycloakSessionFactory)
-
-
Method Detail
-
create
public KeycloakSession create()
- Specified by:
create
in interfaceKeycloakSessionFactory
-
getSpis
public Set<Spi> getSpis()
- Specified by:
getSpis
in interfaceKeycloakSessionFactory
-
getSpi
public Spi getSpi(Class<? extends Provider> providerClass)
- Specified by:
getSpi
in interfaceKeycloakSessionFactory
-
getProviderFactory
public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz)
- Specified by:
getProviderFactory
in interfaceKeycloakSessionFactory
-
getProviderFactory
public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz, String id)
- 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
public Stream<ProviderFactory> getProviderFactoriesStream(Class<? extends Provider> clazz)
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
public void register(ProviderEventListener listener)
- Specified by:
register
in interfaceProviderEventManager
-
unregister
public void unregister(ProviderEventListener listener)
- Specified by:
unregister
in interfaceProviderEventManager
-
publish
public void publish(ProviderEvent event)
- Specified by:
publish
in interfaceProviderEventManager
-
-