Package org.keycloak.services
Class DefaultKeycloakSessionFactory
- java.lang.Object
-
- org.keycloak.services.DefaultKeycloakSessionFactory
-
- All Implemented Interfaces:
KeycloakSessionFactory
,InvalidationHandler
,ProviderEventManager
,ProviderManagerDeployer
public class DefaultKeycloakSessionFactory extends Object implements KeycloakSessionFactory, ProviderManagerDeployer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.provider.InvalidationHandler
InvalidationHandler.InvalidableObjectType, InvalidationHandler.ObjectType
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentFactoryProviderFactory
componentFactoryPF
protected Map<Class<? extends Provider>,Map<String,ProviderFactory>>
factoriesMap
protected CopyOnWriteArrayList<ProviderEventListener>
listeners
protected Map<Class<? extends Provider>,String>
provider
protected long
serverStartupTimestamp
protected Set<Spi>
spis
-
Constructor Summary
Constructors Constructor Description DefaultKeycloakSessionFactory()
-
Method Summary
-
-
-
Field Detail
-
factoriesMap
protected volatile Map<Class<? extends Provider>,Map<String,ProviderFactory>> factoriesMap
-
listeners
protected CopyOnWriteArrayList<ProviderEventListener> listeners
-
serverStartupTimestamp
protected long serverStartupTimestamp
-
componentFactoryPF
protected ComponentFactoryProviderFactory componentFactoryPF
-
-
Method Detail
-
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
-
init
public void init()
-
getFactoriesCopy
protected Map<Class<? extends Provider>,Map<String,ProviderFactory>> getFactoriesCopy()
-
deploy
public void deploy(ProviderManager pm)
- Specified by:
deploy
in interfaceProviderManagerDeployer
-
undeploy
public void undeploy(ProviderManager pm)
- Specified by:
undeploy
in interfaceProviderManagerDeployer
-
getThemeManagerFactory
protected DefaultThemeManagerFactory getThemeManagerFactory()
-
checkProvider
protected void checkProvider()
-
loadFactories
protected Map<Class<? extends Provider>,Map<String,ProviderFactory>> loadFactories(ProviderManager pm)
-
isEnabled
protected boolean isEnabled(ProviderFactory factory, Config.Scope scope)
-
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
-
invalidate
public void invalidate(KeycloakSession session, InvalidationHandler.InvalidableObjectType type, Object... ids)
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 invalidateids
- Parameters used for the invalidation
-
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
.
-
close
public void close()
- Specified by:
close
in interfaceKeycloakSessionFactory
-
isInternal
public static boolean isInternal(ProviderFactory<?> factory)
-
getClientStorageProviderTimeout
public long getClientStorageProviderTimeout()
-
getRoleStorageProviderTimeout
public long getRoleStorageProviderTimeout()
-
getServerStartupTimestamp
public long getServerStartupTimestamp()
- Specified by:
getServerStartupTimestamp
in interfaceKeycloakSessionFactory
- Returns:
- timestamp of Keycloak server startup
-
updateComponentFactoryProviderFactory
protected void updateComponentFactoryProviderFactory()
-
-