Dynamically adding a new entity type configuration

Use this procedure to dynamically add a new supported entity type configuration.

Before you begin

This entity type must already exist in the schema.

About this task

Note: When this dynamic call is made, only the configuration in memory is updated. The configuration file is not updated.
Event Type
DYNA_CONFIG_EVENT_ADD_ENTITY_CONFIG
Configuration Data
DYNA_CONFIG_KEY_ENTITY_TYPE (required) - [String]
Specifies the qualified name of the entity type to be added.
DYNA_CONFIG_KEY_RDNS (required) - [List]
Specifies the relative distinguished name (RDN) properties of the entity type.
DYNA_CONFIG_KEY_DEFAULT_PARENT (required) - [String
Specifies the default parent of the entity type.
DYNA_CONFIG_KEY_ENTITY_CONFIGS - [Hashtable]
Specifies the key of the hash table, which is the repository id. The value of the hash table is a data object. For example, if the repository is an LDAP repository, the data object is the LdapEntityTypes, which contains all configurations setting specific to the LDAP adapter. If the repository does not need any specific setting (like database repository), this parameter is not needed.
The following is a sample task:

Procedure

  1. Ensure that virtual member manager is running.
  2. Call dynamicUpdateConfig API method to add the new entity configuration. For example to add a PersonAccount entity type:
    // dynamic update
    Hashtable configData = new Hashtable();
    configData.put(DynamicConfigConstants.DYNA_CONFIG_KEY_REPOS_ID, "LDAP1");
    configData.put(DynamicConfigConstants.DYNA_CONFIG_KEY_ENTITY_TYPE, DO_PERSON_ACCOUNT);
    List rdns = new ArrayList();
    rdns.add("uid");
    configData.put(DynamicConfigConstants.DYNA_CONFIG_KEY_RDNS, rdns);
    configData.put(DynamicConfigConstants.DYNA_CONFIG_KEY_DEFAULT_PARENT, "cn=users,dc=yourco,dc=com");
    DataObject configProvider = SDOHelper.createConfigProviderDataObject();
    DataObject ldapRepos = SDOHelper.createConfigRepositoryDataObject(configProvider,
                           ConfigConstants.CONFIG_DO_LDAP_REPOSITORY_TYPE);
    DataObject ldapEntity = ldapRepos.createDataObject(ConfigConstants.CONFIG_DO_LDAP_ENTITY_TYPES);
    ldapEntity.setString(ConfigConstants.CONFIG_PROP_NAME, DO_PERSON_ACCOUNT);
    ldapEntity.getList(CONFIG_DO_OBJECTCLASSES).add("ePerson");
    ldapEntity.getList(CONFIG_DO_OBJECTCLASSES_FOR_CREATE).add("inetOrgPerson");
    ldapEntity.getList(CONFIG_DO_OBJECTCLASSES_FOR_CREATE).add("ePerson");
    Hashtable entityConfigs = new Hashtable();
    entityConfigs.put("LDAP1", ldapEntity);
    configData.put(DynamicConfigConstants.DYNA_CONFIG_KEY_ENTITY_CONFIGS, entityConfigs);
    service.dynamicUpdateConfig(DynamicConfigConstants.DYNA_CONFIG_EVENT_ADD_ENTITY_CONFIG, configData);

Icon that indicates the type of topic Task topic



Timestamp icon Last updated: March 6, 2017 0:20
File name: dynaddnewentitytypeconfig.html