org.keycloak.federation.ldap.mappers

## Class AbstractLDAPFederationMapperFactory

- java.lang.Object
- - org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapperFactory

- All Implemented Interfaces:
    UserFederationMapperFactory, ConfiguredProvider, ProviderFactory<UserFederationMapper>
  Direct Known Subclasses:
    FullNameLDAPFederationMapperFactory, GroupLDAPFederationMapperFactory, HardcodedLDAPRoleMapperFactory, MSADUserAccountControlMapperFactory, RoleLDAPFederationMapperFactory, UserAttributeLDAPFederationMapperFactory

      public abstract class AbstractLDAPFederationMapperFactory
      extends Object
      implements UserFederationMapperFactory

  Author:
    Marek Posolda

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ATTRIBUTE_MAPPER_CATEGORY`
    `static String` | `GROUP_MAPPER_CATEGORY`
    `static String` | `ROLE_MAPPER_CATEGORY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractLDAPFederationMapperFactory()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkMandatoryConfigAttribute(String name, String displayName, UserFederationMapperModel mapperModel)`
    `void` | `close()` This is called when the server shuts down.
    `UserFederationMapper` | `create(KeycloakSession session)`
    `static ProviderConfigProperty` | `createConfigProperty(String name, String label, String helpText, String type, Object defaultValue)`
    `protected abstract AbstractLDAPFederationMapper` | `createMapper(UserFederationMapperModel mapperModel, LDAPFederationProvider federationProvider, RealmModel realm)`
    `String` | `getFederationProviderType()` Refers to providerName (type) of the federated provider, which this mapper can be used for.
    `UserFederationMapperSyncConfigRepresentation` | `getSyncConfig()` Specifies if mapper supports sync data from federated storage to keycloak and viceversa.
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.mappers.UserFederationMapperFactory

      `getDefaultConfig, getDisplayCategory, getDisplayType, validateConfig`

    - ### Methods inherited from interface org.keycloak.provider.ProviderFactory

      `getId`

    - ### Methods inherited from interface org.keycloak.provider.ConfiguredProvider

      `getConfigProperties, getHelpText`

- - ### Field Detail

    - #### ATTRIBUTE_MAPPER_CATEGORY

          public static final String ATTRIBUTE_MAPPER_CATEGORY

      See Also:
        Constant Field Values

    - #### ROLE_MAPPER_CATEGORY

          public static final String ROLE_MAPPER_CATEGORY

      See Also:
        Constant Field Values

    - #### GROUP_MAPPER_CATEGORY

          public static final String GROUP_MAPPER_CATEGORY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractLDAPFederationMapperFactory

          public AbstractLDAPFederationMapperFactory()

  - ### Method Detail

    - #### init

          public void init(Config.Scope config)

      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 interface `ProviderFactory<UserFederationMapper>`

    - #### create

          public UserFederationMapper create(KeycloakSession session)

      Specified by:
        `create` in interface `ProviderFactory<UserFederationMapper>`

    - #### createMapper

          protected abstract AbstractLDAPFederationMapper createMapper(UserFederationMapperModel mapperModel,
                                                                       LDAPFederationProvider federationProvider,
                                                                       RealmModel realm)

    - #### getFederationProviderType

          public String getFederationProviderType()

      Description copied from interface: `UserFederationMapperFactory`
      Refers to providerName (type) of the federated provider, which this mapper can be used for. For example "ldap" or "kerberos"
      Specified by:
        `getFederationProviderType` in interface `UserFederationMapperFactory`
      Returns:
        providerName

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<UserFederationMapper>`

    - #### getSyncConfig

          public UserFederationMapperSyncConfigRepresentation getSyncConfig()

      Description copied from interface: `UserFederationMapperFactory`
      Specifies if mapper supports sync data from federated storage to keycloak and viceversa. Also specifies messages to be displayed in admin console UI (For example "Sync roles from LDAP" etc)
      Specified by:
        `getSyncConfig` in interface `UserFederationMapperFactory`
      Returns:
        syncConfig representation

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `ProviderFactory<UserFederationMapper>`

    - #### createConfigProperty

          public static ProviderConfigProperty createConfigProperty(String name,
                                                                    String label,
                                                                    String helpText,
                                                                    String type,
                                                                    Object defaultValue)

    - #### checkMandatoryConfigAttribute

          protected void checkMandatoryConfigAttribute(String name,
                                                       String displayName,
                                                       UserFederationMapperModel mapperModel)
                                                throws FederationConfigValidationException

      Throws:
        `FederationConfigValidationException`

Copyright © 2016 JBoss by Red Hat. All rights reserved.