Utilities
本节描述了你可以与 Spring LDAP 一起使用的其他实用程序。
This section describes additional utilities that you can use with Spring LDAP.
Incremental Retrieval of Multi-Valued Attributes
当特定属性的属性值非常多(>1500)时,Active Directory 通常拒绝一次返回所有这些值。相反,属性值是根据 Incremental Retrieval of Multi-valued Properties 方法返回的。这样做要求调用部分检查特定标记的返回属性,并在必要时发出额外的查找请求,直到找到所有值。
When there are a very large number of attribute values (>1500) for a specific attribute, Active Directory typically refuses to return all these values at once. Instead, the attribute values are returned according to the Incremental Retrieval of Multi-valued Properties method. Doing so requires the calling part to inspect the returned attribute for specific markers and, if necessary, make additional lookup requests until all values are found.
Spring LDAP 的 org.springframework.ldap.core.support.DefaultIncrementalAttributesMapper
在处理这种类型的属性时提供帮助,如下所示:
Spring LDAP’s org.springframework.ldap.core.support.DefaultIncrementalAttributesMapper
helps when working with this kind of attributes, as follows:
Object[] attrNames = new Object[]{"oneAttribute", "anotherAttribute"};
Attributes attrs = DefaultIncrementalAttributeMapper.lookupAttributes(ldapTemplate, theDn, attrNames);
前面的示例解析任何已返回的属性范围标记,并在需要时进行重复请求,直到检索到所有请求属性的所有值为止。
The preceding example parses any returned attribute range markers and makes repeated requests as necessary until all values for all requested attributes have been retrieved.