Package org.keycloak.models.map.common
Class AbstractMapProviderFactory<T extends Provider,V extends AbstractEntity,M>
java.lang.Object
org.keycloak.models.map.common.AbstractMapProviderFactory<T,V,M>
- All Implemented Interfaces:
AmphibianProviderFactory<T>
,ComponentFactory<T,
,T> ConfiguredProvider
,EnvironmentDependentProviderFactory
,ProviderFactory<T>
- Direct Known Subclasses:
MapClientProviderFactory
,MapClientScopeProviderFactory
,MapGlobalLockProviderFactory
,MapGroupProviderFactory
,MapPublicKeyStorageProviderFactory
,MapRealmProviderFactory
,MapRoleProviderFactory
,MapRootAuthenticationSessionProviderFactory
,MapSingleUseObjectProviderFactory
,MapUserLoginFailureProviderFactory
,MapUserProviderFactory
,MapUserSessionProviderFactory
public abstract class AbstractMapProviderFactory<T extends Provider,V extends AbstractEntity,M>
extends Object
implements AmphibianProviderFactory<T>, EnvironmentDependentProviderFactory
- Author:
- hmlnarik
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final org.jboss.logging.Logger
static final String
static final AtomicInteger
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMapProviderFactory
(Class<M> modelType, Class<T> providerType) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(KeycloakSession session) Returns instance of a provider.abstract T
createNew
(KeycloakSession session) Creates new instance of a provider.getId()
MapStorage<V,
M> getMapStorage
(KeycloakSession session) static ProviderFactory<MapStorageProvider>
getProviderFactoryOrComponentFactory
(KeycloakSession session, Config.Scope storageConfigScope) void
init
(Config.Scope config) Only called once when the factory is first created.boolean
void
postInit
(KeycloakSessionFactory factory) Called after all provider factories have been initializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.component.AmphibianProviderFactory
close, create, getConfigProperties, onUpdate, preRemove
Methods inherited from interface org.keycloak.component.ComponentFactory
getCommonProviderConfigProperties, getTypeMetadata, onCreate, validateConfiguration
Methods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig, getHelpText
Methods inherited from interface org.keycloak.provider.EnvironmentDependentProviderFactory
isSupported
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
Field Details
-
PROVIDER_ID
- See Also:
-
CONFIG_STORAGE
- See Also:
-
LOG
protected final org.jboss.logging.Logger LOG -
uniqueCounter
-
modelType
-
-
Constructor Details
-
AbstractMapProviderFactory
-
-
Method Details
-
createNew
Creates new instance of a provider.- Parameters:
session
-- Returns:
- See description.
-
create
Returns instance of a provider. If the instance is already created within the session (it's found in session attributes), it's returned from there, otherwise new instance is created (and stored among the session attributes).- Specified by:
create
in interfaceAmphibianProviderFactory<T extends Provider>
- Specified by:
create
in interfaceComponentFactory<T extends Provider,
V extends AbstractEntity> - Specified by:
create
in interfaceProviderFactory<T extends Provider>
- Parameters:
session
-- Returns:
- See description.
-
getId
- Specified by:
getId
in interfaceProviderFactory<T extends Provider>
-
getMapStorage
-
getProviderFactoryOrComponentFactory
public static ProviderFactory<MapStorageProvider> getProviderFactoryOrComponentFactory(KeycloakSession session, Config.Scope storageConfigScope) -
postInit
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<T extends Provider>
-
init
Description copied from interface:ProviderFactory
Only called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
init
in interfaceProviderFactory<T extends Provider>
-
isSupported
public boolean isSupported()- Specified by:
isSupported
in interfaceEnvironmentDependentProviderFactory
- Returns:
true
if the provider is supported and should be available,false
otherwise
-