此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring LDAP 3.3.3spring-doc.cadn.net.cn

Utilities

本节介绍可与 Spring LDAP 一起使用的其他实用程序。spring-doc.cadn.net.cn

多值属性的增量检索

当特定属性的属性值非常多 (>1500) 时,Active Directory 通常拒绝一次返回所有这些值。相反,属性值将根据“多值属性的增量检索”方法返回。这样做需要调用部分检查返回的属性中是否有特定标记,并在必要时发出其他查找请求,直到找到所有值。spring-doc.cadn.net.cn

Spring LDAP 的org.springframework.ldap.core.support.DefaultIncrementalAttributesMapper在处理此类属性时有所帮助,如下所示:spring-doc.cadn.net.cn

Object[] attrNames =  new Object[]{"oneAttribute", "anotherAttribute"};
Attributes attrs = DefaultIncrementalAttributeMapper.lookupAttributes(ldapTemplate, theDn, attrNames);

前面的示例分析任何返回的属性范围标记,并根据需要重复请求,直到检索到所有请求属性的所有值。spring-doc.cadn.net.cn