com.atlassian.crowd.directory.ldap
Class LDAPPropertiesMapperImpl

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

public class LDAPPropertiesMapperImpl
extends Object
implements LDAPPropertiesMapper


Field Summary
static String CONNECTION_BINARY_ATTRIBUTES
          LDAP binary attributes.
static String CONNECTION_FACTORY
          LDAP connection factory.
static String CONNECTION_FACTORY_SSL_IMPL
          LDAP secure connection factory.
static String CONNECTION_INITIAL_CONTEXT_FACTORY
          LDAP initial context factory.
static String CONNECTION_SECURITY_AUTHENTICATION
          LDAP connection method.
static String CONNECTION_SSL_SECURITY_PROTOCOL
          LDAP secure connection method.
 
Fields inherited from interface com.atlassian.crowd.directory.ldap.LDAPPropertiesMapper
GROUP_DESCRIPTION_KEY, GROUP_DN_ADDITION, GROUP_NAME_KEY, GROUP_OBJECTCLASS_KEY, GROUP_OBJECTFILTER_KEY, GROUP_USERNAMES_KEY, LDAP_BASEDN_KEY, LDAP_CONNECTION_TIMEOUT, LDAP_NESTED_GROUPS_DISABLED, LDAP_PAGEDRESULTS_KEY, LDAP_PAGEDRESULTS_SIZE, LDAP_PASSWORD_KEY, LDAP_POOL_INITSIZE, LDAP_POOL_MAXSIZE, LDAP_POOL_PREFSIZE, LDAP_POOL_TIMEOUT, LDAP_POOLING_KEY, LDAP_PROPOGATE_CHANGES, LDAP_READ_TIMEOUT, LDAP_REFERRAL_KEY, LDAP_RELAXED_DN_STANDARDISATION, LDAP_SEARCH_TIMELIMIT, 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, LOCAL_GROUPS, 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(LDAPPropertiesHelper ldapPropertiesHelper)
           
 
Method Summary
 String getAttribute(String key)
           
 Map<String,String> getAttributes()
           
 String getBaseDN()
           
protected  boolean getBooleanKey(String key)
           
protected  boolean getBooleanKey(String key, boolean defaultValue)
           
 int getCacheSynchroniseInterval()
          Returns the interval in seconds when the local Cache should be synchronized with LDAP.
 Map<String,Properties> getConfigurationDetails()
          Returns a map of the LDAP names as the keys and the properties associated with that LDAP connector.
protected  String getConnectionTimeout()
           
 String getConnectionURL()
           
 Map<String,String> getEnvironment()
           
 String getGroupBaseDN()
           
 String getGroupDescriptionAttribute()
           
 String getGroupFilter()
           
 String getGroupMemberAttribute()
           
 String getGroupNameAttribute()
           
 String getGroupObjectClass()
           
 Map<String,String> getImplementations()
          Returns a map of the LDAP names as the keys and the implementation class as Strings.
 List<LdapTypeConfig> getLdapTypeConfigurations()
          Get a list of Ldap Type Configuration objects.
 String getObjectClassAttribute()
           
 int getPagedResultsSize()
           
 String getPassword()
           
protected  String getPoolInitSize()
           
protected  String getPoolMaxSize()
           
protected  String getPoolPrefSize()
           
protected  String getPoolTimeout()
           
 String getPrincipalBaseDN()
           
protected  String getReadTimeout()
           
 String getRoleBaseDN()
           
 String getRoleDescriptionAttribute()
           
 String getRoleFilter()
           
 String getRoleMemberAttribute()
           
 String getRoleNameAttribute()
           
 String getRoleObjectClass()
           
 int getSearchTimeLimit()
           
 String getUserDisplayNameAttribute()
           
 String getUserEmailAttribute()
           
 String getUserEncryptionMethod()
           
 String getUserFilter()
           
 String getUserFirstNameAttribute()
           
 String getUserGroupMembershipsAttribute()
          The attribute on a principal that specifies their group memberships (usually "memberOf").
 String getUserLastNameAttribute()
           
 String getUsername()
           
 String getUserNameAttribute()
           
 String getUserNameRdnAttribute()
           
 String getUserObjectClass()
           
 String getUserPasswordAttribute()
           
 boolean isLocalGroupsEnabled()
          Returns true if groups and group memberships are to be mutated only (created, updated, deleted) in local storage, otherwise the mutations will be propagated to the underlying LDAP implementation (full read-write LDAP groups).
 boolean isNestedGroupsDisabled()
           
 boolean isPagedResultsControl()
          Checks if the configuration of the LDAP directory server uses paged results.
 boolean isReferral()
          Returns true if referrals should be followed.
 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.
 void setAttributes(Map<String,String> attributes)
           
 
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 String CONNECTION_INITIAL_CONTEXT_FACTORY
LDAP initial context factory.

See Also:
Constant Field Values

CONNECTION_SECURITY_AUTHENTICATION

public static final String CONNECTION_SECURITY_AUTHENTICATION
LDAP connection method.

See Also:
Constant Field Values

CONNECTION_SSL_SECURITY_PROTOCOL

public static final String CONNECTION_SSL_SECURITY_PROTOCOL
LDAP secure connection method.

See Also:
Constant Field Values

CONNECTION_FACTORY

public static final String CONNECTION_FACTORY
LDAP connection factory.

See Also:
Constant Field Values

CONNECTION_FACTORY_SSL_IMPL

public static final String CONNECTION_FACTORY_SSL_IMPL
LDAP secure connection factory.


CONNECTION_BINARY_ATTRIBUTES

public static final String CONNECTION_BINARY_ATTRIBUTES
LDAP binary attributes.

See Also:
Constant Field Values
Constructor Detail

LDAPPropertiesMapperImpl

public LDAPPropertiesMapperImpl(LDAPPropertiesHelper ldapPropertiesHelper)
Method Detail

getImplementations

public Map<String,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 Map<String,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 Map<String,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 secure, otherwise false.

isUsingConnectionPooling

protected boolean isUsingConnectionPooling()

getBooleanKey

protected boolean getBooleanKey(String key)

getBooleanKey

protected boolean getBooleanKey(String key,
                                boolean defaultValue)

getPoolInitSize

protected String getPoolInitSize()

getPoolPrefSize

protected String getPoolPrefSize()

getPoolMaxSize

protected String getPoolMaxSize()

getPoolTimeout

protected String getPoolTimeout()

getConnectionTimeout

protected String getConnectionTimeout()

getReadTimeout

protected String getReadTimeout()

getSearchTimeLimit

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

getAttributes

public Map<String,String> getAttributes()
Specified by:
getAttributes in interface LDAPPropertiesMapper

setAttributes

public void setAttributes(Map<String,String> attributes)
Specified by:
setAttributes in interface LDAPPropertiesMapper

getAttribute

public String getAttribute(String key)
Specified by:
getAttribute in interface LDAPPropertiesMapper

getBaseDN

public String getBaseDN()
                 throws InvalidNameException
Throws:
InvalidNameException

getGroupBaseDN

public String getGroupBaseDN()
                      throws InvalidNameException
Throws:
InvalidNameException

getGroupFilter

public String getGroupFilter()
Specified by:
getGroupFilter in interface LDAPPropertiesMapper

getConnectionURL

public String getConnectionURL()
Specified by:
getConnectionURL in interface LDAPPropertiesMapper

getUsername

public String getUsername()
Specified by:
getUsername in interface LDAPPropertiesMapper

getPassword

public String getPassword()
Specified by:
getPassword in interface LDAPPropertiesMapper

getGroupNameAttribute

public String getGroupNameAttribute()
Specified by:
getGroupNameAttribute in interface LDAPPropertiesMapper

getObjectClassAttribute

public String getObjectClassAttribute()
Specified by:
getObjectClassAttribute in interface LDAPPropertiesMapper

getRoleFilter

public String getRoleFilter()
Specified by:
getRoleFilter in interface LDAPPropertiesMapper

getRoleBaseDN

public String getRoleBaseDN()
                     throws InvalidNameException
Throws:
InvalidNameException

getRoleNameAttribute

public String getRoleNameAttribute()
Specified by:
getRoleNameAttribute in interface LDAPPropertiesMapper

getUserFilter

public String getUserFilter()
Specified by:
getUserFilter in interface LDAPPropertiesMapper

getPrincipalBaseDN

public String getPrincipalBaseDN()

getUserNameAttribute

public String getUserNameAttribute()
Specified by:
getUserNameAttribute in interface LDAPPropertiesMapper

getUserNameRdnAttribute

public String getUserNameRdnAttribute()
Specified by:
getUserNameRdnAttribute in interface LDAPPropertiesMapper

getUserEmailAttribute

public String getUserEmailAttribute()
Specified by:
getUserEmailAttribute in interface LDAPPropertiesMapper

getUserGroupMembershipsAttribute

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

Specified by:
getUserGroupMembershipsAttribute in interface LDAPPropertiesMapper
Returns:

getGroupObjectClass

public String getGroupObjectClass()
Specified by:
getGroupObjectClass in interface LDAPPropertiesMapper

getGroupDescriptionAttribute

public String getGroupDescriptionAttribute()
Specified by:
getGroupDescriptionAttribute in interface LDAPPropertiesMapper

getGroupMemberAttribute

public String getGroupMemberAttribute()
Specified by:
getGroupMemberAttribute in interface LDAPPropertiesMapper

getRoleObjectClass

public String getRoleObjectClass()
Specified by:
getRoleObjectClass in interface LDAPPropertiesMapper

getRoleDescriptionAttribute

public String getRoleDescriptionAttribute()
Specified by:
getRoleDescriptionAttribute in interface LDAPPropertiesMapper

getRoleMemberAttribute

public String getRoleMemberAttribute()
Specified by:
getRoleMemberAttribute in interface LDAPPropertiesMapper

getUserObjectClass

public String getUserObjectClass()
Specified by:
getUserObjectClass in interface LDAPPropertiesMapper

getUserFirstNameAttribute

public String getUserFirstNameAttribute()
Specified by:
getUserFirstNameAttribute in interface LDAPPropertiesMapper

getUserLastNameAttribute

public String getUserLastNameAttribute()
Specified by:
getUserLastNameAttribute in interface LDAPPropertiesMapper

getUserDisplayNameAttribute

public String getUserDisplayNameAttribute()
Specified by:
getUserDisplayNameAttribute in interface LDAPPropertiesMapper

getUserPasswordAttribute

public String getUserPasswordAttribute()
Specified by:
getUserPasswordAttribute in interface LDAPPropertiesMapper

getUserEncryptionMethod

public 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:

isReferral

public boolean isReferral()
Description copied from interface: LDAPPropertiesMapper
Returns true if referrals should be followed.

Specified by:
isReferral in interface LDAPPropertiesMapper
Returns:
true if referrals should be followed

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:

isLocalGroupsEnabled

public boolean isLocalGroupsEnabled()
Description copied from interface: LDAPPropertiesMapper
Returns true if groups and group memberships are to be mutated only (created, updated, deleted) in local storage, otherwise the mutations will be propagated to the underlying LDAP implementation (full read-write LDAP groups).

Specified by:
isLocalGroupsEnabled in interface LDAPPropertiesMapper
Returns:
true if using local storage for groups and memberships

getCacheSynchroniseInterval

public int getCacheSynchroniseInterval()
Description copied from interface: LDAPPropertiesMapper
Returns the interval in seconds when the local Cache should be synchronized with LDAP.

Specified by:
getCacheSynchroniseInterval in interface LDAPPropertiesMapper
Returns:
the interval in seconds when the local Cache should be synchronized with LDAP.

getLdapTypeConfigurations

public List<LdapTypeConfig> getLdapTypeConfigurations()
Description copied from interface: LDAPPropertiesMapper
Get a list of Ldap Type Configuration objects.

Specified by:
getLdapTypeConfigurations in interface LDAPPropertiesMapper
Returns:
List of LdapTypeConfigurations


Copyright © 2012 Atlassian. All Rights Reserved.