| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.ldap; |
| 17 | |
|
| 18 | |
import org.springframework.ldap.core.ContextMapper; |
| 19 | |
import org.springframework.ldap.core.DirContextOperations; |
| 20 | |
import org.springframework.ldap.core.support.AbstractContextMapper; |
| 21 | |
|
| 22 | |
import org.kuali.rice.kim.api.identity.name.EntityName; |
| 23 | |
import org.kuali.rice.kim.api.identity.principal.EntityNamePrincipalName; |
| 24 | |
import org.kuali.rice.kim.util.Constants; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | 0 | public class EntityNamePrincipalNameMapper extends AbstractContextMapper { |
| 31 | |
private Constants constants; |
| 32 | |
|
| 33 | |
private ContextMapper defaultNameMapper; |
| 34 | |
|
| 35 | |
public EntityNamePrincipalName mapFromContext(DirContextOperations context) { |
| 36 | 0 | return ((EntityNamePrincipalName.Builder) doMapFromContext(context)).build(); |
| 37 | |
} |
| 38 | |
|
| 39 | |
public Object doMapFromContext(DirContextOperations context) { |
| 40 | 0 | final EntityNamePrincipalName.Builder person = EntityNamePrincipalName.Builder.create(); |
| 41 | 0 | person.setDefaultName((EntityName.Builder) getDefaultNameMapper().mapFromContext(context)); |
| 42 | 0 | person.setPrincipalName(context.getStringAttribute(getConstants().getKimLdapNameProperty())); |
| 43 | 0 | return person; |
| 44 | |
} |
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
public final Constants getConstants() { |
| 52 | 0 | return this.constants; |
| 53 | |
} |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
public final void setConstants(final Constants argConstants) { |
| 61 | 0 | this.constants = argConstants; |
| 62 | 0 | } |
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
public final ContextMapper getDefaultNameMapper() { |
| 71 | 0 | return this.defaultNameMapper; |
| 72 | |
} |
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
public final void setDefaultNameMapper(final ContextMapper argDefaultNameMapper) { |
| 80 | 0 | this.defaultNameMapper = argDefaultNameMapper; |
| 81 | 0 | } |
| 82 | |
} |