Utilities

本节介绍了你可以与Spring LDAP一起使用的其他工具。spring-doc.cadn.net.cn

多值属性的增量检索

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

春季LDAPorg.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