I have LDAP schema where are users. I need remove one attribute named "notify" which have values: phone number or mail or remove attribute from user. I found method
LDAPConnection myCon = new LDAPConnection("localhost",389);
myCon.delete("uid=test1, ou=People, o=domain.com, o=isp");
but this remove whole user and i need remove only one attribute "notifyTo" of this user. I need remove whole attribute not only its value.
Thanks for reply
You can set that attribute as LDAPModification.DELETE in the LDAPModificationSet
If the attribute is "notifyTo",
You can add, replace or delete any number of attributes from the user. All these can be specified in the LDAPModificationSet actions to be performed. If you want to replace an attribute "email" for the user, add it to the LDAPModificationSet and call the modify() method in the end.
While deleting an attribute,just make sure that the attribute is already present in the user LDAP entry, otherwise a NO_SUCH_ATTRIBUTE(Error Code 16) LDAPException would be thrown when the modify() method is called.