Feature #24

Recursively delete entries

Added by Jonathan Clarke over 1 year ago. Updated over 1 year ago.

Status:Closed Start:13/01/2009
Priority:Normal Due date:
Assigned to:Sébastien Bahloul % Done:

100%

Category:Core
Target version:1.1.0

Description

From Clément:
My users entries in OpenLDAP have subentries, so I need that the delete operation supports recursivity. How I see that : the delete operation encounter a specific LDAP error code (66 - Operation not allowed on non-leaf), so it searches all subentries and delete them. We can imagine a config parameters allowing LSC to do recursive delete.

History

Updated by Jonathan Clarke over 1 year ago

The Java exception thrown for this is ContextNotEmptyException which extends NamingException (see http://java.sun.com/docs/books/tutorial/jndi/ldap/exceptions.html).

Updated by Jonathan Clarke over 1 year ago

After a first discussion with Rémy-Christophe on the subject, we see this as follows:
- a config parameter : recursive delete which can be true or false
- if true, then before deleting an entry, do a search (scope = sub, base = the entry to delete) to get all the DNs including the one to delete and all below
--> if the count of this is 1, just skip to normal delete
--> if the count is >1, sort DNs by string length, and delete them one by one, longest first
- if false, then try and delete the entry, catch the error 66 exception and display an intelligent message pointing to the config parameter

Updated by Sébastien Bahloul over 1 year ago

  • Status changed from New to Assigned
  • Assigned to set to Sébastien Bahloul

I propose to add the following boolean parameter :
X.java.naming.recursivedelete = value
with
- X = src or dst
- value = true or false
If true, all the entries located under a synchronized entry which have to be deleted will be recursively deleted. If not, a delete operation on a synchronized entry with children entries will encountered an exception.

Updated by Jonathan Clarke over 1 year ago

  • Status changed from Assigned to Feedback

This is now implemented. Set dst.java.naming.recursivedelete = true in lsc.properties, and the whole subtree below each entry will be deleted with that entry (the src.... property makes no sense, since we never delete anything in the source, currently :) )

If the property is false (the default), and an LDAP error 66 is received, a corresponding error message is displayed.

I have tested this, works OK for me. Clément, are you able to confirm on your original directory? (grab the latest SVN trunk)

Updated by Sébastien Bahloul over 1 year ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

After some tests, I think we can close this issue. Can be reopened if required.

Also available in: Atom PDF