Spring LDAP

org.springframework.ldap.core
Interface IncrementalAttributesMapper

All Superinterfaces:
AttributesMapper
All Known Implementing Classes:
DefaultIncrementalAttributesMapper

public interface IncrementalAttributesMapper
extends AttributesMapper

Utility that helps with reading all attribute values from Active Directory using Incremental Retrieval of Multi-valued Properties.

Since:
1.3.2
Author:
Mattias Hellborg Arthursson
See Also:
Incremental Retrieval of Multi-valued Properties, org.springframework.ldap.core.support.DefaultIncrementalAttributesMapper}

Method Summary
 String[] getAttributesForLookup()
          Get properly formatted attributes for use in the next query.
 Attributes getCollectedAttributes()
          Get all collected values for all managed attributes as an Attributes instance.
 List getValues(String attributeName)
          Get all of the collected values for the specified attribute.
 boolean hasMore()
          Check whether another query iteration is required to get all values for all attributes.
 Object mapFromAttributes(Attributes attributes)
          Goes through all of the attributes to record their values and figure out whether a new query iteration is needed to get more values.
 

Method Detail

getValues

List getValues(String attributeName)
Get all of the collected values for the specified attribute.

Parameters:
attributeName - the attribute to get values for.
Returns:
the collected values for the specified attribute. Will be null if the requested attribute has not been returned by the server (attribute did not exist).

getCollectedAttributes

Attributes getCollectedAttributes()
Get all collected values for all managed attributes as an Attributes instance.

Returns:
an Attributes instance populated with all collected values.

hasMore

boolean hasMore()
Check whether another query iteration is required to get all values for all attributes.

Returns:
true if there are more values for at least one of the managed attributes, false otherwise.

getAttributesForLookup

String[] getAttributesForLookup()
Get properly formatted attributes for use in the next query. The attribute names included will include Range specifiers as needed and only the attributes that have not been retrieved in full will be included.

Returns:
an array of Strings to be used as input to e.g. LdapTemplate.lookup(javax.naming.Name, String[], org.springframework.ldap.core.AttributesMapper) in the next iteration.

mapFromAttributes

Object mapFromAttributes(Attributes attributes)
                         throws NamingException
Goes through all of the attributes to record their values and figure out whether a new query iteration is needed to get more values.

Specified by:
mapFromAttributes in interface AttributesMapper
Parameters:
attributes - attributes from a SearchResult.
Returns:
this instance.
Throws:
NamingException

Spring LDAP