org.keycloak.examples.federation.properties

## Class BasePropertiesFederationFactory

- java.lang.Object
- - org.keycloak.examples.federation.properties.BasePropertiesFederationFactory

- All Implemented Interfaces:
    UserFederationProviderFactory, ProviderFactory<UserFederationProvider>
  Direct Known Subclasses:
    ClasspathPropertiesFederationFactory, FilePropertiesFederationFactory

      public abstract class BasePropertiesFederationFactory
      extends Object
      implements UserFederationProviderFactory

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ConcurrentHashMap<String,Properties>` | `files`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePropertiesFederationFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `UserFederationProvider` | `create(KeycloakSession session)`
    `protected abstract BasePropertiesFederationProvider` | `createProvider(KeycloakSession session, UserFederationProviderModel model, Properties props)`
    `Set<String>` | `getConfigurationOptions()` List the configuration options to render and display in the admin console's generic management page for this plugin
    `UserFederationProvider` | `getInstance(KeycloakSession session, UserFederationProviderModel model)` called per Keycloak transaction.
    `protected abstract InputStream` | `getPropertiesFileStream(String path)`
    `void` | `init(Config.Scope config)` You can import additional plugin configuration from keycloak-server.json here.
    `void` | `syncAllUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model)` Sync all users from the provider storage to Keycloak storage.
    `void` | `syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)` Sync just changed (added / updated / removed) users from the provider storage to Keycloak storage.

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

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

    - ### Methods inherited from interface org.keycloak.models.UserFederationProviderFactory

      `getId`

- - ### Field Detail

    - #### files

          protected ConcurrentHashMap<String,Properties> files

  - ### Constructor Detail

    - #### BasePropertiesFederationFactory

          public BasePropertiesFederationFactory()

  - ### Method Detail

    - #### getInstance

          public UserFederationProvider getInstance(KeycloakSession session,
                                           UserFederationProviderModel model)

      Description copied from interface: `UserFederationProviderFactory`
      called per Keycloak transaction.
      Specified by:
        `getInstance` in interface `UserFederationProviderFactory`
      Returns:

    - #### getPropertiesFileStream

          protected abstract InputStream getPropertiesFileStream(String path)

    - #### createProvider

          protected abstract BasePropertiesFederationProvider createProvider(KeycloakSession session,
                                                        UserFederationProviderModel model,
                                                        Properties props)

    - #### getConfigurationOptions

          public Set<String> getConfigurationOptions()

      List the configuration options to render and display in the admin console's generic management page for this plugin
      Specified by:
        `getConfigurationOptions` in interface `UserFederationProviderFactory`
      Returns:

    - #### create

          public UserFederationProvider create(KeycloakSession session)

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

    - #### init

          public void init(Config.Scope config)

      You can import additional plugin configuration from keycloak-server.json here.
      Specified by:
        `init` in interface `ProviderFactory<UserFederationProvider>`
      Parameters:
        `config` -

    - #### close

          public void close()

      Specified by:
        `close` in interface `ProviderFactory<UserFederationProvider>`

    - #### syncAllUsers

          public void syncAllUsers(KeycloakSessionFactory sessionFactory,
                          String realmId,
                          UserFederationProviderModel model)

      Description copied from interface: `UserFederationProviderFactory`
      Sync all users from the provider storage to Keycloak storage.
      Specified by:
        `syncAllUsers` in interface `UserFederationProviderFactory`

    - #### syncChangedUsers

          public void syncChangedUsers(KeycloakSessionFactory sessionFactory,
                              String realmId,
                              UserFederationProviderModel model,
                              Date lastSync)

      Description copied from interface: `UserFederationProviderFactory`
      Sync just changed (added / updated / removed) users from the provider storage to Keycloak storage. This is useful in case that your storage supports "changelogs" (Tracking what users changed since specified date). It's implementation specific to decide what exactly will be changed (For example LDAP supports tracking of added / updated users, but not removed users. So removed users are not synced)
      Specified by:
        `syncChangedUsers` in interface `UserFederationProviderFactory`

Copyright © 2015. All Rights Reserved.