Use this procedure to dynamically add a new profile repository
to the current configuration at runtime.
About this task
Note: When this dynamic call is made, only the configuration in memory
is updated. The configuration file is not updated. You can only dynamically
add an LDAP repository or a custom repository.
- Event Type
- DYNA_CONFIG_EVENT_ADD_REPOSITORY
- Configuration Data
- DYNA_CONFIG_KEY_REPOS_CONFIG (required) - [DataObject]
- Specifies the profile repository configuration data object based on the
wimconfig.xsd file.
The following is a sample task:
- Ensure that the LDAP server is set up correctly and running. Also
ensure that the base entries that you are using for the LDAP repository are
created.
- Ensure that virtual member manager is running.
- Add the new LDAP repository. For example using the default
virtual member manager LDAP adapter:
DataObject configProvider = SDOHelper.createConfigProviderDataObject();
DataObject reposDO = SDOHelper.createConfigRepositoryDataObject(configProvider,
CONFIG_DO_LDAP_REPOSITORY_TYPE);
reposDO.setString(CONFIG_PROP_ID, "NewLDAP");
reposDO.setString(CONFIG_PROP_LDAP_SERVER_TYPE, "IDS60");
reposDO.setBoolean(CONFIG_PROP_SUPPORT_PAGING, false);
reposDO.setBoolean(CONFIG_PROP_SUPPORT_SORTING, false);
DataObject baseEntry1 = SDOHelper.createConfigDataObject(reposDO,
WIM_CONFIG_NS_URI, CONFIG_DO_BASE_ENTRIES);
baseEntry1.set(CONFIG_PROP_NAME, "cn=realmusers,dc=yourco,dc=com");
DataObject baseEntry2 = SDOHelper.createConfigDataObject(reposDO,
WIM_CONFIG_NS_URI, CONFIG_DO_BASE_ENTRIES);
baseEntry2.set(CONFIG_PROP_NAME, "cn=realmgroups,dc=yourco,dc=com");
// ldap server config
DataObject ldapServerCfgDO = SDOHelper.createConfigDataObject(reposDO,
WIM_CONFIG_NS_URI, CONFIG_DO_LDAP_SERVER_CONFIGURATION);
DataObject ldapServerDO = SDOHelper.createConfigDataObject(ldapServerCfgDO,
WIM_CONFIG_NS_URI, CONFIG_DO_LDAP_SERVERS);
ldapServerDO.setString(CONFIG_PROP_BIND_DN, "cn=yourco");
ldapServerDO.setString(CONFIG_PROP_BIND_PASSWORD, "yourpassword");
ldapServerDO.setBoolean(CONFIG_PROP_SSL_ENABLED, false);
DataObject ldapConnectionDO = SDOHelper.createConfigDataObject(ldapServerDO,
WIM_CONFIG_NS_URI, CONFIG_DO_CONNECTIONS);
ldapConnectionDO.setString(CONFIG_PROP_HOST, "yourldap.server.yourco.com");
ldapConnectionDO.setString(CONFIG_PROP_PORT, "389");
Hashtable configData = new Hashtable();
configData.put(DYNA_CONFIG_KEY_REPOS_CONFIG, reposDO);
service.dynamicUpdateConfig(DYNA_CONFIG_EVENT_ADD_REPOSITORY, configData);