com.atlassian.crowd.directory.ldap.util
Class IncrementalAttributeMapper

java.lang.Object
  extended by 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, LdapName 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:
Incremental Retrieval of Multi-valued Properties

Constructor Summary
IncrementalAttributeMapper(String attributeName, AttributeValueProcessor valueProcessor)
           
IncrementalAttributeMapper(String attributeName, AttributeValueProcessor valueProcessor, RangeOption requestRange)
           
 
Method Summary
 String[] getAttributesArray()
           
 boolean hasMore()
           
 Object mapFromAttributes(Attributes attributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncrementalAttributeMapper

public IncrementalAttributeMapper(String attributeName,
                                  AttributeValueProcessor valueProcessor)

IncrementalAttributeMapper

public IncrementalAttributeMapper(String attributeName,
                                  AttributeValueProcessor valueProcessor,
                                  RangeOption requestRange)
Method Detail

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()


Copyright © 2013 Atlassian. All Rights Reserved.