com.atlassian.crowd.integration.directory.connector.mapper.entity
Class LDAPUserAttributesMapper

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.connector.mapper.entity.LDAPUserAttributesMapper

public class LDAPUserAttributesMapper
extends Object

Maps an LDAP Attributes object to the Crowd {User} object type, and vice versa.


Field Summary
protected  long directoryId
           
protected  LDAPPropertiesMapper ldapPropertiesMapper
           
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
LDAPUserAttributesMapper(long directoryId, LDAPPropertiesMapper ldapPropertiesMapper)
           
 
Method Summary
protected  boolean getUserActiveFromAttribute(Attributes directoryAttributes)
           
protected  String getUserDisplayNameFromAttribute(Attributes directoryAttributes)
           
protected  String getUserEmailFromAttribute(Attributes directoryAttributes)
           
protected  String getUserFirstNameFromAttribute(Attributes directoryAttributes)
           
protected  String getUserLastNameFromAttribute(Attributes directoryAttributes)
           
protected  String getUsernameFromAttributes(Attributes directoryAttributes)
           
 Attributes mapAttributesFromUser(User user)
          Creates an LDAP Attributes object containing the information in the User object.
 Object mapFromAttributes(Attributes attributes)
          Maps an LDAP object to the Crowd User object type.
 UserTemplateWithAttributes mapUserFromAttributes(Attributes directoryAttributes)
          Creates a User object containing the information in the Attributes object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger

ldapPropertiesMapper

protected final LDAPPropertiesMapper ldapPropertiesMapper

directoryId

protected final long directoryId
Constructor Detail

LDAPUserAttributesMapper

public LDAPUserAttributesMapper(long directoryId,
                                LDAPPropertiesMapper ldapPropertiesMapper)
Method Detail

mapFromAttributes

public Object mapFromAttributes(Attributes attributes)
                         throws org.springframework.ldap.NamingException
Maps an LDAP object to the Crowd User object type. Implementation of AttributesMapper from Spring LDAP framework.

Parameters:
attributes - The principal from the LDAP server to map into a {User} object.
Returns:
The populated {User}.
Throws:
org.springframework.ldap.NamingException - A mapping exception occured.
See Also:
AttributesMapper.mapFromAttributes(javax.naming.directory.Attributes)

mapAttributesFromUser

public Attributes mapAttributesFromUser(User user)
                                 throws org.springframework.ldap.NamingException
Creates an LDAP Attributes object containing the information in the User object.

Parameters:
user - The object to take the values from
Returns:
A populated directory-specific Attributes object.
Throws:
org.springframework.ldap.NamingException

mapUserFromAttributes

public UserTemplateWithAttributes mapUserFromAttributes(Attributes directoryAttributes)
                                                 throws org.springframework.ldap.NamingException
Creates a User object containing the information in the Attributes object.

Parameters:
directoryAttributes - The directory-specific {Attributes} object to take the values from
Returns:
A populated {User} object.
Throws:
org.springframework.ldap.NamingException

getUserDisplayNameFromAttribute

protected String getUserDisplayNameFromAttribute(Attributes directoryAttributes)

getUserLastNameFromAttribute

protected String getUserLastNameFromAttribute(Attributes directoryAttributes)

getUserFirstNameFromAttribute

protected String getUserFirstNameFromAttribute(Attributes directoryAttributes)

getUserEmailFromAttribute

protected String getUserEmailFromAttribute(Attributes directoryAttributes)

getUserActiveFromAttribute

protected boolean getUserActiveFromAttribute(Attributes directoryAttributes)

getUsernameFromAttributes

protected String getUsernameFromAttributes(Attributes directoryAttributes)
                                    throws org.springframework.ldap.NamingException
Throws:
org.springframework.ldap.NamingException


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.