spring-projects / spring-ldap

Spring LDAP
https://spring.io/spring-ldap
Apache License 2.0
342 stars 481 forks source link

LDAP-149: Add DnContextMapper implementation #185

Closed spring-projects-issues closed 15 years ago

spring-projects-issues commented 15 years ago

["Mattias Hellborg Arthursson":https://jira.spring.io/secure/ViewProfile.jspa?name=marthursson](Migrated from ["LDAP-149":https://jira.spring.io/browse/LDAP-149?redirect=false]) said:

A default ContextMapper implementation should be provided to get the DN of found entries. There should be two options: relative or absolute DNs.

spring-projects-issues commented 15 years ago

["Ulrik Sandberg":https://jira.spring.io/secure/ViewProfile.jspa?name=ulsa] said:

Any point in mapping to an object which contains both?

bc.. public class DnContextMapper extends AbstractParameterizedContextMapper { @Override protected DnPair doMapFromContext(DirContextOperations ctx) { DnPair dnPair = new DnPair(); dnpair.relativeDn = ctx.getDn(); dnpair.absoluteDn = ctx.getNameInNamespace(); return dnpair; } public static class DnPair { public DistinguishedName relativeDn; public DistinguishedName absoluteDn; } }

p.

spring-projects-issues commented 15 years ago

["Mattias Hellborg Arthursson":https://jira.spring.io/secure/ViewProfile.jspa?name=marthursson] said:

Added @LdapEntryIdentificationContextMapper@.