spring boot测试如何使用java api将Ldif文件中的默认数据添加到Ldap服务器?
我需要将大量数据从ldif文件添加到LDAP服务器中。我研究了很多java API,但没有找到合适的
我已经试过使用LdapTestUtils,但它需要重新启动服务器。除了这个,我需要另一种方式
你可以在下面搜索框中键入要查询的问题!
我需要将大量数据从ldif文件添加到LDAP服务器中。我研究了很多java API,但没有找到合适的
我已经试过使用LdapTestUtils,但它需要重新启动服务器。除了这个,我需要另一种方式
# 1 楼答案
也可以通过LdapTemplate实现。LdapParser将以LdapAttribute的形式解析ldif文件中的记录,然后通过ldapTemplate绑定该记录。束缚
# 2 楼答案
您需要使用一个单独的库,该库具有支持LDIF导入的API。一旦这样的库被Apache Directory LDAP API。该库通常与大多数LDAP服务器兼容
参考documentation,LdifFileLoader类具有导入LDIF的功能,与DefaultDirectoryService类一起(不幸的是,我找不到演示LDIF导入的早期代码)。您可以参考this post,它展示了如何使用上述方法,尽管它处理的是不同类型的问题
我不确定您正在使用的LDAP服务器,但是,您可以尝试并检查上面的内容