|
对于最新稳定版本,请使用 Spring LDAP 4.0.0! |
Utilities
本节介绍了你可以与Spring LDAP一起使用的其他工具。
多值属性的增量检索
当某一特定属性的属性值数量非常多(>1500)时,Active Directory 通常拒绝一次性返回所有这些值。相反,属性值会根据多值属性的增量检索方法返回。这样做需要调用部分检查返回的属性是否有特定标记,并在必要时进行额外的查找请求,直到找到所有值。
春季LDAPorg.springframework.ldap.core.support.DefaultIncrementalAttributesMapper在处理这类属性时会有帮助,具体如下:
Object[] attrNames = new Object[]{"oneAttribute", "anotherAttribute"};
Attributes attrs = DefaultIncrementalAttributeMapper.lookupAttributes(ldapTemplate, theDn, attrNames);
前例解析所有返回的属性范围标记,并根据需要重复请求,直到所有请求属性的值都被检索出来。