org.springframework.ldap.samples.person.dao
Class PersonContextMapper

java.lang.Object
  extended by org.springframework.ldap.samples.person.dao.PersonContextMapper
All Implemented Interfaces:
ContextMapper

public class PersonContextMapper
extends Object
implements ContextMapper

Maps from DirContextOperations (DirContextAdapters, really) to Person objects. A DN for a person will be of the form cn=[fullname],ou=[company],c=[country], so the values of these attributes must be extracted from the DN. For this, we use the DistinguishedName.

Author:
Mattias Arthursson, Ulrik Sandberg

Constructor Summary
PersonContextMapper()
           
 
Method Summary
 Object mapFromContext(Object ctx)
          Map a single LDAP Context to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersonContextMapper

public PersonContextMapper()
Method Detail

mapFromContext

public Object mapFromContext(Object ctx)
Description copied from interface: ContextMapper
Map a single LDAP Context to an object. The supplied Object ctx is the object from a single SearchResult, Binding, or a lookup operation.

Specified by:
mapFromContext in interface ContextMapper
Parameters:
ctx - the context to map to an object. Typically this will be a DirContextAdapter instance, unless a project specific DirObjectFactory has been specified on the ContextSource.
Returns:
an object built from the data in the context.


Copyright © 2006-2009 Spring Framework. All Rights Reserved.