Deleting an Entry
The data in an LDAP directory must be kept up-to-date and valid. Eventually an entry will need to be removed. Deleting an entire entry from the directory is a simple process:
String theDN = "uid=bjensen, ou=People, o=airius.com"; try { ld.delete(theDN); } catch ( LDAPException e ) { }
The LDAPConnection.delete method takes a single argument: the DN of the record to be deleted. All that is needed to delete a leaf node is the DN and the proper authorization to delete the record. An ou or o entry may be deleted using the code just given, provided there are no entries underneath in the tree. A node that contains entries underneath it is a branch node, and it cannot be deleted using this method. This constraint is a limitation ...
Get LDAP Programming with Java™ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.