1 package com.pentila.jackrabbit.auth;
3 import javax.naming.NamingException;
4 import javax.naming.directory.Attributes;
6 import org.springframework.ldap.core.AttributesMapper;
8 public class LdapUserMapper implements AttributesMapper {
11 private String attrId;
13 private String attrLogin;
15 public LdapUserMapper(String attrId, String attrLogin){
18 this.attrLogin = attrLogin;
23 public LdapUser mapFromAttributes(Attributes attrs) throws NamingException {
25 LdapUser u = new LdapUser();
27 u.setLogin((String)attrs.get(attrLogin).get());
28 u.setId((String)attrs.get(attrId).get());