com.atlassian.crowd.integration.directory.connector
Class LDAPPropertiesMapperImpl

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.connector.LDAPPropertiesMapperImpl
All Implemented Interfaces:
LDAPPropertiesMapper

public class LDAPPropertiesMapperImpl
extends java.lang.Object
implements LDAPPropertiesMapper


Field Summary
static java.lang.String CONNECTION_BINARY_ATTRIBUTES
          LDAP binary attributes.
static java.lang.String CONNECTION_FACTORY
          LDAP connection factory.
static java.lang.String CONNECTION_FACTORY_SSL_IMPL
          LDAP secure connection factory.
static java.lang.String CONNECTION_INITIAL_CONTEXT_FACTORY
          LDAP initial context factory.
static java.lang.String CONNECTION_SECURITY_AUTHENTICATION
          LDAP connection method.
static java.lang.String CONNECTION_SSL_SECURITY_PROTOCOL
          LDAP secure connection method.
 
Fields inherited from interface com.atlassian.crowd.integration.directory.connector.LDAPPropertiesMapper
GROUP_DESCRIPTION_KEY, GROUP_DN_ADDITION, GROUP_NAME_KEY, GROUP_OBJECTCLASS_KEY, GROUP_OBJECTFILTER_KEY, GROUP_USERNAMES_KEY, LDAP_BASEDN_KEY, LDAP_NESTED_GROUPS_DISABLED, LDAP_PAGEDRESULTS_KEY, LDAP_PAGEDRESULTS_SIZE, LDAP_PASSWORD_KEY, LDAP_POOLING_KEY, LDAP_REFERRAL_KEY, LDAP_RELAXED_DN_STANDARDISATION, LDAP_SECURE_KEY, LDAP_URL_KEY, LDAP_USER_ENCRYPTION_METHOD, LDAP_USERDN_KEY, LDAP_USING_USER_MEMBERSHIP_ATTRIBUTE, LDAP_USING_USER_MEMBERSHIP_ATTRIBUTE_FOR_GROUP_MEMBERSHIP, ROLE_DESCRIPTION_KEY, ROLE_DN_ADDITION, ROLE_NAME_KEY, ROLE_OBJECTCLASS_KEY, ROLE_OBJECTFILTER_KEY, ROLE_USERNAMES_KEY, ROLES_DISABLED, USER_DISPLAYNAME_KEY, USER_DN_ADDITION, USER_EMAIL_KEY, USER_FIRSTNAME_KEY, USER_GROUP_KEY, USER_LASTNAME_KEY, USER_OBJECTCLASS_KEY, USER_OBJECTFILTER_KEY, USER_PASSWORD_KEY, USER_USERNAME_KEY, USER_USERNAME_RDN_KEY
 
Constructor Summary
LDAPPropertiesMapperImpl()
           
 
Method Summary
 java.util.Map<java.lang.String,AttributeValues> getAttributes()
           
 java.lang.String getBaseDN()
           
protected  boolean getBooleanKey(java.lang.String key)
           
protected  boolean getBooleanKey(java.lang.String key, boolean defaultValue)
           
 java.util.Map<java.lang.String,java.util.Properties> getConfigurationDetails()
          Returns a map of the LDAP names as the keys and the properties associated with that LDAP connector.
 java.lang.String getConnectionURL()
           
 java.util.Hashtable<java.lang.String,java.lang.String> getEnvironment()
           
 java.lang.String getGroupBaseDN()
           
 java.lang.String getGroupDescriptionAttribute()
           
 java.lang.String getGroupFilter()
           
 java.lang.String getGroupMemberAttribute()
           
 java.lang.String getGroupNameAttribute()
           
 java.lang.String getGroupObject()
           
 java.util.Map<java.lang.String,java.lang.String> getImplementations()
          Returns a map of the LDAP names as the keys and the implementation class as Strings.
 LDAPPropertiesHelper getLdapPropertiesHelper()
           
 java.lang.String getObjectClassAttribute()
           
 int getPagedResultsSize()
           
 java.lang.String getPassword()
           
 java.lang.String getPrincipalBaseDN()
           
 java.lang.String getPrincipalDisplayNameAttribute()
           
 java.lang.String getPrincipalEmailAttribute()
           
 java.lang.String getPrincipalFilter()
           
 java.lang.String getPrincipalFirstnameAttribute()
           
 java.lang.String getPrincipalGroupMembershipsAttribute()
          The attribute on a principal that specifies their group memberships (usually "memberOf").
 java.lang.String getPrincipalLastnameAttribute()
           
 java.lang.String getPrincipalNameAttribute()
           
 java.lang.String getPrincipalNameRdnAttribute()
           
 java.lang.String getPrincipalObject()
           
 java.lang.String getPrincipalPasswordAttribute()
           
 java.lang.String getRoleBaseDN()
           
 java.lang.String getRoleDescriptionAttribute()
           
 java.lang.String getRoleFilter()
           
 java.lang.String getRoleMemberAttribute()
           
 java.lang.String getRoleNameAttribute()
           
 java.lang.String getRoleObject()
           
 java.lang.String getSingleAttribute(java.lang.String key)
           
 java.lang.String getUserEncryptionMethod()
           
 java.lang.String getUsername()
           
 boolean isNestedGroupsDisabled()
           
 boolean isPagedResultsControl()
          Checks if the configuration of the LDAP directory server uses paged results.
protected  boolean isReferral()
           
 boolean isRelaxedDnStandardisation()
          Whether we should use the more expensive but completely cross-directory compatible method for standardising DNs when mapping object DNs and and memberDNs (value = false); or if we can use a more efficient but relaxed form of standardisation (value = true).
 boolean isRolesDisabled()
          Returns true if roles should be disabled, as in some caching setups.
protected  boolean isSecureSSL()
          If the connection must be secure.
protected  boolean isUsingConnectionPooling()
           
 boolean isUsingUserMembershipAttribute()
          Whether we should use the "memberOf" (or equivalent) attribute in LDAP queries.
 boolean isUsingUserMembershipAttributeForGroupMembership()
          Whether we should use the "memberOf" (or equivalent) attribute when fetching the list of groups a user belongs to.
 java.util.List pageResults(SearchContext searchContext, java.util.List results)
           
 void setAttributes(java.util.Map<java.lang.String,AttributeValues> attributes)
           
 void setLdapPropertiesHelper(LDAPPropertiesHelper ldapPropertiesHelper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_INITIAL_CONTEXT_FACTORY

public static final java.lang.String CONNECTION_INITIAL_CONTEXT_FACTORY
LDAP initial context factory.

See Also:
Constant Field Values

CONNECTION_SECURITY_AUTHENTICATION

public static final java.lang.String CONNECTION_SECURITY_AUTHENTICATION
LDAP connection method.

See Also:
Constant Field Values

CONNECTION_SSL_SECURITY_PROTOCOL

public static final java.lang.String CONNECTION_SSL_SECURITY_PROTOCOL
LDAP secure connection method.

See Also:
Constant Field Values

CONNECTION_FACTORY

public static final java.lang.String CONNECTION_FACTORY
LDAP connection factory.

See Also:
Constant Field Values

CONNECTION_FACTORY_SSL_IMPL

public static final java.lang.String CONNECTION_FACTORY_SSL_IMPL
LDAP secure connection factory.

See Also:
Constant Field Values

CONNECTION_BINARY_ATTRIBUTES

public static final java.lang.String CONNECTION_BINARY_ATTRIBUTES
LDAP binary attributes.

See Also:
Constant Field Values
Constructor Detail

LDAPPropertiesMapperImpl

public LDAPPropertiesMapperImpl()
Method Detail

getImplementations

public java.util.Map<java.lang.String,java.lang.String> getImplementations()
Returns a map of the LDAP names as the keys and the implementation class as Strings.

Specified by:
getImplementations in interface LDAPPropertiesMapper
Returns:
The implementations.

getConfigurationDetails

public java.util.Map<java.lang.String,java.util.Properties> getConfigurationDetails()
Returns a map of the LDAP names as the keys and the properties associated with that LDAP connector.

Specified by:
getConfigurationDetails in interface LDAPPropertiesMapper
Returns:
The configuration details.

getEnvironment

public java.util.Hashtable<java.lang.String,java.lang.String> getEnvironment()
Specified by:
getEnvironment in interface LDAPPropertiesMapper

isSecureSSL

protected boolean isSecureSSL()
If the connection must be secure.

Returns:
true if and only if the connection must be securem, otherwise false.

isReferral

protected boolean isReferral()

isUsingConnectionPooling

protected boolean isUsingConnectionPooling()

getBooleanKey

protected boolean getBooleanKey(java.lang.String key)

getBooleanKey

protected boolean getBooleanKey(java.lang.String key,
                                boolean defaultValue)

getAttributes

public java.util.Map<java.lang.String,AttributeValues> getAttributes()
Specified by:
getAttributes in interface LDAPPropertiesMapper

setAttributes

public void setAttributes(java.util.Map<java.lang.String,AttributeValues> attributes)
Specified by:
setAttributes in interface LDAPPropertiesMapper

getSingleAttribute

public java.lang.String getSingleAttribute(java.lang.String key)
Specified by:
getSingleAttribute in interface LDAPPropertiesMapper

getBaseDN

public java.lang.String getBaseDN()
                           throws javax.naming.InvalidNameException
Throws:
javax.naming.InvalidNameException

getGroupBaseDN

public java.lang.String getGroupBaseDN()
                                throws javax.naming.InvalidNameException
Throws:
javax.naming.InvalidNameException

getGroupFilter

public java.lang.String getGroupFilter()
Specified by:
getGroupFilter in interface LDAPPropertiesMapper

getConnectionURL

public java.lang.String getConnectionURL()
Specified by:
getConnectionURL in interface LDAPPropertiesMapper

getUsername

public java.lang.String getUsername()
Specified by:
getUsername in interface LDAPPropertiesMapper

getPassword

public java.lang.String getPassword()
Specified by:
getPassword in interface LDAPPropertiesMapper

getGroupNameAttribute

public java.lang.String getGroupNameAttribute()
Specified by:
getGroupNameAttribute in interface LDAPPropertiesMapper

getObjectClassAttribute

public java.lang.String getObjectClassAttribute()
Specified by:
getObjectClassAttribute in interface LDAPPropertiesMapper

getRoleFilter

public java.lang.String getRoleFilter()
Specified by:
getRoleFilter in interface LDAPPropertiesMapper

getRoleBaseDN

public java.lang.String getRoleBaseDN()
                               throws javax.naming.InvalidNameException
Throws:
javax.naming.InvalidNameException

getRoleNameAttribute

public java.lang.String getRoleNameAttribute()
Specified by:
getRoleNameAttribute in interface LDAPPropertiesMapper

getPrincipalFilter

public java.lang.String getPrincipalFilter()
Specified by:
getPrincipalFilter in interface LDAPPropertiesMapper

getPrincipalBaseDN

public java.lang.String getPrincipalBaseDN()

getPrincipalNameAttribute

public java.lang.String getPrincipalNameAttribute()
Specified by:
getPrincipalNameAttribute in interface LDAPPropertiesMapper

getPrincipalNameRdnAttribute

public java.lang.String getPrincipalNameRdnAttribute()
Specified by:
getPrincipalNameRdnAttribute in interface LDAPPropertiesMapper

getPrincipalEmailAttribute

public java.lang.String getPrincipalEmailAttribute()
Specified by:
getPrincipalEmailAttribute in interface LDAPPropertiesMapper

getPrincipalGroupMembershipsAttribute

public java.lang.String getPrincipalGroupMembershipsAttribute()
Description copied from interface: LDAPPropertiesMapper
The attribute on a principal that specifies their group memberships (usually "memberOf"). Not implemented by all directories.

Specified by:
getPrincipalGroupMembershipsAttribute in interface LDAPPropertiesMapper
Returns:

pageResults

public java.util.List pageResults(SearchContext searchContext,
                                  java.util.List results)
Specified by:
pageResults in interface LDAPPropertiesMapper

getGroupObject

public java.lang.String getGroupObject()
Specified by:
getGroupObject in interface LDAPPropertiesMapper

getGroupDescriptionAttribute

public java.lang.String getGroupDescriptionAttribute()
Specified by:
getGroupDescriptionAttribute in interface LDAPPropertiesMapper

getGroupMemberAttribute

public java.lang.String getGroupMemberAttribute()
Specified by:
getGroupMemberAttribute in interface LDAPPropertiesMapper

getRoleObject

public java.lang.String getRoleObject()
Specified by:
getRoleObject in interface LDAPPropertiesMapper

getRoleDescriptionAttribute

public java.lang.String getRoleDescriptionAttribute()
Specified by:
getRoleDescriptionAttribute in interface LDAPPropertiesMapper

getRoleMemberAttribute

public java.lang.String getRoleMemberAttribute()
Specified by:
getRoleMemberAttribute in interface LDAPPropertiesMapper

getPrincipalObject

public java.lang.String getPrincipalObject()
Specified by:
getPrincipalObject in interface LDAPPropertiesMapper

getPrincipalFirstnameAttribute

public java.lang.String getPrincipalFirstnameAttribute()
Specified by:
getPrincipalFirstnameAttribute in interface LDAPPropertiesMapper

getPrincipalLastnameAttribute

public java.lang.String getPrincipalLastnameAttribute()
Specified by:
getPrincipalLastnameAttribute in interface LDAPPropertiesMapper

getPrincipalDisplayNameAttribute

public java.lang.String getPrincipalDisplayNameAttribute()
Specified by:
getPrincipalDisplayNameAttribute in interface LDAPPropertiesMapper

getPrincipalPasswordAttribute

public java.lang.String getPrincipalPasswordAttribute()
Specified by:
getPrincipalPasswordAttribute in interface LDAPPropertiesMapper

getUserEncryptionMethod

public java.lang.String getUserEncryptionMethod()
Specified by:
getUserEncryptionMethod in interface LDAPPropertiesMapper

isPagedResultsControl

public boolean isPagedResultsControl()
Checks if the configuration of the LDAP directory server uses paged results.

Specified by:
isPagedResultsControl in interface LDAPPropertiesMapper
Returns:
true if and only if paged results is enabled for the LDAP server, otherwise false.

getPagedResultsSize

public int getPagedResultsSize()
Specified by:
getPagedResultsSize in interface LDAPPropertiesMapper

isNestedGroupsDisabled

public boolean isNestedGroupsDisabled()
Specified by:
isNestedGroupsDisabled in interface LDAPPropertiesMapper

isUsingUserMembershipAttribute

public boolean isUsingUserMembershipAttribute()
Description copied from interface: LDAPPropertiesMapper
Whether we should use the "memberOf" (or equivalent) attribute in LDAP queries.

Specified by:
isUsingUserMembershipAttribute in interface LDAPPropertiesMapper
Returns:

isUsingUserMembershipAttributeForGroupMembership

public boolean isUsingUserMembershipAttributeForGroupMembership()
Description copied from interface: LDAPPropertiesMapper
Whether we should use the "memberOf" (or equivalent) attribute when fetching the list of groups a user belongs to.

Specified by:
isUsingUserMembershipAttributeForGroupMembership in interface LDAPPropertiesMapper
Returns:

isRelaxedDnStandardisation

public boolean isRelaxedDnStandardisation()
Description copied from interface: LDAPPropertiesMapper
Whether we should use the more expensive but completely cross-directory compatible method for standardising DNs when mapping object DNs and and memberDNs (value = false); or if we can use a more efficient but relaxed form of standardisation (value = true). See DNStandardiser for more information.

Specified by:
isRelaxedDnStandardisation in interface LDAPPropertiesMapper
Returns:
false if proper standardisation is required.

isRolesDisabled

public boolean isRolesDisabled()
Description copied from interface: LDAPPropertiesMapper
Returns true if roles should be disabled, as in some caching setups. The grammatical atrocity that is the name of this method pains me more than you can imagine.

Specified by:
isRolesDisabled in interface LDAPPropertiesMapper
Returns:

getLdapPropertiesHelper

public LDAPPropertiesHelper getLdapPropertiesHelper()

setLdapPropertiesHelper

public void setLdapPropertiesHelper(LDAPPropertiesHelper ldapPropertiesHelper)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.