Interface ProviderFactory<T extends Provider>

All Known Subinterfaces:
ComponentFactory<CreatedType,ProviderType>, HostnameProviderFactory, LocaleSelectorProviderFactory, LocaleUpdaterProviderFactory, SimpleValidator, SubComponentFactory<CreatedType,ProviderType>, ThemeResourceProviderFactory, ThemeSelectorProviderFactory, ValidatorFactory, VaultProviderFactory
All Known Implementing Classes:
AbstractSimpleValidator, AbstractStringValidator

public interface ProviderFactory<T extends Provider>
At boot time, keycloak discovers all factories. For each discovered factory, the init() method is called. After all factories have been initialized, the postInit() method is called. close() is called when the server shuts down. Only one instance of a factory exists per server.
Author:
Stian Thorgersen
  • Method Details

    • create

      T create(KeycloakSession session)
    • init

      void init(Config.Scope config)
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Parameters:
      config -
    • postInit

      void postInit(KeycloakSessionFactory factory)
      Called after all provider factories have been initialized
    • close

      void close()
      This is called when the server shuts down.
    • getId

      String getId()
    • order

      default int order()
    • getConfigMetadata

      default List<ProviderConfigProperty> getConfigMetadata()
      Returns the metadata for each configuration property supported by this factory.
      Returns:
      a list with the metadata for each configuration property supported by this factory
    • dependsOn

      default Set<Class<? extends Provider>> dependsOn()
      Optional method used to declare that a ProviderFactory has a dependency on one or more Providers. If a Provider is declared here, it is guaranteed that the dependencies postInit(org.keycloak.models.KeycloakSessionFactory) method will be executed before this ProviderFactory's postInit(org.keycloak.models.KeycloakSessionFactory). Similarly, it's guaranteed that close() will be called on this ProviderFactory before close() is called on any of the dependent ProviderFactory implementations.