com.atlassian.crowd.directory.ldap.mapper
Class ContextMapperWithCustomAttributes<T>

java.lang.Object
  extended by com.atlassian.crowd.directory.ldap.mapper.ContextMapperWithCustomAttributes<T>
All Implemented Interfaces:
ContextMapperWithRequiredAttributes<T>, org.springframework.ldap.core.ContextMapper
Direct Known Subclasses:
GroupContextMapper, UserContextMapper

public abstract class ContextMapperWithCustomAttributes<T>
extends Object
implements ContextMapperWithRequiredAttributes<T>

An abstract implementation of ContextMapperWithRequiredAttributes for cases where a mapper requires core attributes and also the attributes for any attached custom AttributeMappers.


Field Summary
protected  List<AttributeMapper> customAttributeMappers
           
 
Constructor Summary
ContextMapperWithCustomAttributes(List<AttributeMapper> customAttributeMappers)
           
 
Method Summary
static Set<String> aggregate(AttributeMapper... mappers)
           
protected abstract  Set<String> getCoreRequiredLdapAttributes()
           
 Set<String> getRequiredLdapAttributes()
          Returns the LDAP attributes that should be requested in a search where ContextMapperWithRequiredAttributes.mapFromContext(Object) will be called on the results.
abstract  T mapFromContext(org.springframework.ldap.core.DirContextAdapter ctx)
           
 T mapFromContext(Object ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customAttributeMappers

protected final List<AttributeMapper> customAttributeMappers
Constructor Detail

ContextMapperWithCustomAttributes

public ContextMapperWithCustomAttributes(List<AttributeMapper> customAttributeMappers)
Method Detail

mapFromContext

public final T mapFromContext(Object ctx)
Specified by:
mapFromContext in interface ContextMapperWithRequiredAttributes<T>
Specified by:
mapFromContext in interface org.springframework.ldap.core.ContextMapper

mapFromContext

public abstract T mapFromContext(org.springframework.ldap.core.DirContextAdapter ctx)

getCoreRequiredLdapAttributes

protected abstract Set<String> getCoreRequiredLdapAttributes()

getRequiredLdapAttributes

public Set<String> getRequiredLdapAttributes()
Description copied from interface: ContextMapperWithRequiredAttributes
Returns the LDAP attributes that should be requested in a search where ContextMapperWithRequiredAttributes.mapFromContext(Object) will be called on the results. If an implementation returns null then all attributes will be requested.

Specified by:
getRequiredLdapAttributes in interface ContextMapperWithRequiredAttributes<T>
Returns:
the LDAP attributes that should be requested, or null for all

aggregate

public static Set<String> aggregate(AttributeMapper... mappers)


Copyright © 2013 Atlassian. All Rights Reserved.