NSD1102 Update LDAP object with custom code
Fact
Identity manager 3.x Stand alone and Web Edition
Situation
When writing custom code one may want to update multiple attributes on one LDAP object, all in one LDAP operation. Attached is the code snippet NSD1102.java. The code looks like below.
Solution (Code example)
package nsd;
/**
*
* @author Nordicedge
*/
public class NSD1102 {
//Updating multiple attribute with on LDAP operation//
/**
*
* @param userSession – Nordicedge NEIDMgmtSession object
* @param theDN – object to update
*/
public void multipleAttributeUpdate(se.nordicedge.session.NEIDMgmtSession userSession, String theDN) {
//Creating the updater object//
se.nordicedge.AppDBAtomicallyModify updater = new se.nordicedge.AppDBAtomicallyModify(userSession);
//Preparing it by filling it with attributes//
/**
* First param – affected object
* Second param – attribute to update
* Third param – attribute value, set "" to remove
* Fourth param – should value be added to current value
*/
updater.setLDAPConfig(theDN, "mobile", "123456", false);
updater.setLDAPConfig(theDN, "mail", "jdoe@contose.com", false);
updater.setLDAPConfig(theDN, "description", "dummy user", false);
//Commiting the update//
if (updater.commitModifications(theDN) == null) {
userSession.log("Update done!");
}
}
}
Attachement
Disclaimer
The origin of this information may be internal or external to Nordic Edge™. Nordic Edge™ makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Nordic Edge™ makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.
Nordic Edge Support – www.nordicedge.se
