Class IncrementalAttributeMapper

java.lang.Object
com.atlassian.crowd.directory.ldap.util.IncrementalAttributeMapper
All Implemented Interfaces:
org.springframework.ldap.core.AttributesMapper

public class IncrementalAttributeMapper extends Object implements org.springframework.ldap.core.AttributesMapper
Code based on: http://jira.springframework.org/browse/LDAP-176 To fix: http://jira.atlassian.com/browse/CWD-1445 Utility class that helps with reading all attribute values from Active Directory using Incremental Retrieval of Multi-valued Properties.

Example usage of this attribute mapper:

     public void retrieveAttributeIncrementally(LdapTemplate ldap, CrowdLdapName entrDn, String attributeName, AttributeValueProcessor valueProcessor)
     {
         IncrementalAttributeMapper incrementalAttributeMapper = new IncrementalAttributeMapper(attributeName, valueProcessor);

         while (incrementalAttributeMapper.hasMore())
         {
             ldap.lookup(entrDn, incrementalAttributeMapper.getAttributesArray(), incrementalAttributeMapper);
         }
     }
 
Author:
Marius Scurtescu
See Also:
  • Constructor Details

  • Method Details

    • mapFromAttributes

      public Object mapFromAttributes(Attributes attributes) throws NamingException
      Specified by:
      mapFromAttributes in interface org.springframework.ldap.core.AttributesMapper
      Throws:
      NamingException
    • hasMore

      public boolean hasMore()
    • getAttributesArray

      public String[] getAttributesArray()