Utilities

本节描述了你可以与 Spring LDAP 一起使用的其他实用程序。

Incremental Retrieval of Multi-Valued Attributes

当特定属性的属性值非常多(>1500)时,Active Directory 通常拒绝一次返回所有这些值。相反,属性值是根据 Incremental Retrieval of Multi-valued Properties 方法返回的。这样做要求调用部分检查特定标记的返回属性,并在必要时发出额外的查找请求,直到找到所有值。

Spring LDAP 的 org.springframework.ldap.core.support.DefaultIncrementalAttributesMapper 在处理这种类型的属性时提供帮助,如下所示:

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

前面的示例解析任何已返回的属性范围标记,并在需要时进行重复请求,直到检索到所有请求属性的所有值为止。