how to delete all entries ldap java

核能气质少年 提交于 2019-12-11 01:55:21

问题


I have an application in Java, using Spring LDAP and Java Naming. The problem is when I delete a branch that contains entries. example:

root
|
|----A
|    |
|    |--A1
|       |
|       |----A2
|            |
|            |---A3  
|
|
|-----B

When I try to delete the branch A, sends me the following exception:

[LDAP: error code 66 - subordinate objects must be deleted first]

Please help me! thank you!

Greetings.!


回答1:


If you are using Spring LDAP, you should be able to accomplish this using LdapTemplate#unbind method that takes 'recursive' argument:

http://docs.spring.io/spring-ldap/docs/2.0.2.RELEASE/apidocs/org/springframework/ldap/core/LdapTemplate.html#unbind(javax.naming.Name, boolean)




回答2:


Unless the LDAP server supports the TreeDelete extended operation or request control, whatever it is, and you can find a Java implementation of the client side code, you will have to traverse the subtree and delete the entries bottom-up.



来源:https://stackoverflow.com/questions/24002206/how-to-delete-all-entries-ldap-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!