[英]how to delete all entries ldap java
I have an application in Java, using Spring LDAP and Java Naming. 我有一个使用Spring LDAP和Java Naming的Java应用程序。 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: 当我尝试删除分支A时,向我发送以下异常:
[LDAP: error code 66 - subordinate objects must be deleted first]
Please help me! 请帮我! thank you!
谢谢!
Greetings.! 问候。!
If you are using Spring LDAP, you should be able to accomplish this using LdapTemplate#unbind method that takes 'recursive' argument: 如果您使用的是Spring LDAP,则应该能够使用带有'recursive'参数的LdapTemplate#unbind方法来完成此操作:
http://docs.spring.io/spring-ldap/docs/2.0.2.RELEASE/apidocs/org/springframework/ldap/core/LdapTemplate.html#unbind(javax.naming.Name , boolean) http://docs.spring.io/spring-ldap/docs/2.0.2.RELEASE/apidocs/org/springframework/ldap/core/LdapTemplate.html#unbind(javax.naming.Name,boolean )
除非LDAP服务器支持TreeDelete扩展操作或请求控制(无论它是什么),并且您可以找到客户端代码的Java实现,否则您将必须遍历子树并自下而上删除条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.