Package com.jalios.ldap
Class LDAPConfiguration
- java.lang.Object
-
- com.jalios.ldap.LDAPConfiguration
-
public class LDAPConfiguration extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclientCertificateEnabledprotected booleanenabledprotected java.lang.StringgroupFilterprotected java.lang.StringgroupMappingUUIDprotected java.lang.StringgroupObjectClassprotected java.lang.StringgroupSuffixprotected java.lang.Stringhostnameprotected booleanisSSLprotected booleanisUsingPosixGroupstatic java.lang.StringLDAP_ENABLEDstatic java.lang.StringLDAP_SERVER_CLIENT_CERTIFICATE_ENABLEDstatic java.lang.StringLDAP_SERVER_GROUP_FILTERstatic java.lang.StringLDAP_SERVER_GROUP_MAPPING_UUIDstatic java.lang.StringLDAP_SERVER_GROUP_OBJECTCLASSstatic java.lang.StringLDAP_SERVER_GROUP_SUFFIXstatic java.lang.StringLDAP_SERVER_HOSTNAMEstatic java.lang.StringLDAP_SERVER_LOGINstatic java.lang.StringLDAP_SERVER_PASSWORDstatic java.lang.StringLDAP_SERVER_PORTstatic java.lang.StringLDAP_SERVER_SIZE_LIMITstatic java.lang.StringLDAP_SERVER_SSLstatic java.lang.StringLDAP_SERVER_SUFFIXstatic java.lang.StringLDAP_SERVER_TIME_LIMITstatic java.lang.StringLDAP_SERVER_USER_FILTERstatic java.lang.StringLDAP_SERVER_USER_OBJECTCLASSstatic java.lang.StringLDAP_SERVER_VERSIONstatic java.lang.StringLDAP_SYNCHRONIZEstatic java.lang.StringLDAP_SYNCHRONIZE_AUTHstatic java.lang.StringLDAP_SYNCHRONIZE_GROUPSprotected java.lang.Stringloginprotected java.lang.Stringpasswordprotected intportprotected intsizeLimitprotected java.lang.Stringsuffixprotected booleansynchronizeprotected booleansynchronizeAuthprotected booleansynchronizeGroupsprotected inttimeLimitprotected java.lang.StringuserFilterprotected java.lang.StringuserObjectClassprotected intversion
-
Constructor Summary
Constructors Constructor Description LDAPConfiguration(JProperties props)Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties.LDAPConfiguration(JProperties props, java.lang.String serverConf)Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties, trying to retrieve custom properties from the specified configuration prior to using default properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetGroupFilter()java.lang.StringgetGroupMappingUUID()java.lang.StringgetGroupObjectClass()java.lang.StringgetGroupSuffix()java.lang.StringgetHostname()java.lang.StringgetLogin()java.lang.StringgetPassword()intgetPort()intgetSizeLimit()java.lang.StringgetSuffix()booleangetSynchronize()Check if synchronization of user is enabled for this configuration.booleangetSynchronizeDuringAuthentication()Check if synchronization of user (and their groups if enabled) is to be performed during authentication.booleangetSynchronizeGroups()Check if synchronization of groups is enabled for this configuration.intgetTimeLimit()java.lang.StringgetUserFilter()java.lang.StringgetUserObjectClass()intgetVersion()booleanisEnabled()booleanisSSL()booleanisUsingPosixGroup()protected voidreadProperties(JProperties prop, java.lang.String serverConf)voidsetGroupFilter(java.lang.String groupFilter)voidsetGroupMappingUUID(java.lang.String groupMappingUUID)voidsetGroupObjectClass(java.lang.String groupObjectClass)voidsetLogin(java.lang.String login)voidsetPassword(java.lang.String password)voidsetUserFilter(java.lang.String userFilter)voidsetUserObjectClass(java.lang.String userObjectClass)
-
-
-
Field Detail
-
LDAP_ENABLED
public static final java.lang.String LDAP_ENABLED
- See Also:
- Constant Field Values
-
LDAP_SYNCHRONIZE
public static final java.lang.String LDAP_SYNCHRONIZE
- See Also:
- Constant Field Values
-
LDAP_SYNCHRONIZE_AUTH
public static final java.lang.String LDAP_SYNCHRONIZE_AUTH
- See Also:
- Constant Field Values
-
LDAP_SYNCHRONIZE_GROUPS
public static final java.lang.String LDAP_SYNCHRONIZE_GROUPS
- See Also:
- Constant Field Values
-
LDAP_SERVER_SSL
public static final java.lang.String LDAP_SERVER_SSL
- See Also:
- Constant Field Values
-
LDAP_SERVER_HOSTNAME
public static final java.lang.String LDAP_SERVER_HOSTNAME
- See Also:
- Constant Field Values
-
LDAP_SERVER_LOGIN
public static final java.lang.String LDAP_SERVER_LOGIN
- See Also:
- Constant Field Values
-
LDAP_SERVER_PORT
public static final java.lang.String LDAP_SERVER_PORT
- See Also:
- Constant Field Values
-
LDAP_SERVER_SIZE_LIMIT
public static final java.lang.String LDAP_SERVER_SIZE_LIMIT
- See Also:
- Constant Field Values
-
LDAP_SERVER_TIME_LIMIT
public static final java.lang.String LDAP_SERVER_TIME_LIMIT
- See Also:
- Constant Field Values
-
LDAP_SERVER_VERSION
public static final java.lang.String LDAP_SERVER_VERSION
- See Also:
- Constant Field Values
-
LDAP_SERVER_PASSWORD
public static final java.lang.String LDAP_SERVER_PASSWORD
- See Also:
- Constant Field Values
-
LDAP_SERVER_CLIENT_CERTIFICATE_ENABLED
public static final java.lang.String LDAP_SERVER_CLIENT_CERTIFICATE_ENABLED
- See Also:
- Constant Field Values
-
LDAP_SERVER_SUFFIX
public static final java.lang.String LDAP_SERVER_SUFFIX
- See Also:
- Constant Field Values
-
LDAP_SERVER_USER_FILTER
public static final java.lang.String LDAP_SERVER_USER_FILTER
- See Also:
- Constant Field Values
-
LDAP_SERVER_USER_OBJECTCLASS
public static final java.lang.String LDAP_SERVER_USER_OBJECTCLASS
- See Also:
- Constant Field Values
-
LDAP_SERVER_GROUP_SUFFIX
public static final java.lang.String LDAP_SERVER_GROUP_SUFFIX
- See Also:
- Constant Field Values
-
LDAP_SERVER_GROUP_FILTER
public static final java.lang.String LDAP_SERVER_GROUP_FILTER
- See Also:
- Constant Field Values
-
LDAP_SERVER_GROUP_OBJECTCLASS
public static final java.lang.String LDAP_SERVER_GROUP_OBJECTCLASS
- See Also:
- Constant Field Values
-
LDAP_SERVER_GROUP_MAPPING_UUID
public static final java.lang.String LDAP_SERVER_GROUP_MAPPING_UUID
- See Also:
- Constant Field Values
-
enabled
protected boolean enabled
-
synchronize
protected boolean synchronize
-
synchronizeAuth
protected boolean synchronizeAuth
-
synchronizeGroups
protected boolean synchronizeGroups
-
hostname
protected java.lang.String hostname
-
login
protected java.lang.String login
-
password
protected java.lang.String password
-
port
protected int port
-
sizeLimit
protected int sizeLimit
-
timeLimit
protected int timeLimit
-
version
protected int version
-
isSSL
protected boolean isSSL
-
clientCertificateEnabled
protected boolean clientCertificateEnabled
-
suffix
protected java.lang.String suffix
-
userFilter
protected java.lang.String userFilter
-
userObjectClass
protected java.lang.String userObjectClass
-
groupSuffix
protected java.lang.String groupSuffix
-
groupFilter
protected java.lang.String groupFilter
-
groupObjectClass
protected java.lang.String groupObjectClass
-
isUsingPosixGroup
protected boolean isUsingPosixGroup
-
groupMappingUUID
protected java.lang.String groupMappingUUID
-
-
Constructor Detail
-
LDAPConfiguration
public LDAPConfiguration(JProperties props)
Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties.- Parameters:
props- the properties from which LDAPConfiguration is being built
-
LDAPConfiguration
public LDAPConfiguration(JProperties props, java.lang.String serverConf)
Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties, trying to retrieve custom properties from the specified configuration prior to using default properties.For example, given the following properties :
ldap.server.hostname: ldap.example.com ldap.server.login: foo ldap.server.password: bar ldap.server.conf2.hostname: other-domain-ldap.example.com
Invoking this constructorLDAPConfiguration conf = new LDAPConfiguration(channel.getProperties("ldap"), "conf2"); assertEquals("other-domain-ldap.example.com", conf.getHostname()); assertEquals("foo", conf.getLogin()); assertEquals("bar", conf.getPassword());- Parameters:
props- the properties from which LDAPConfiguration is being builtserverConf- an optional subconfiguration to use after "ldap.server." default prefix, to retrieve Server configuration options
-
-
Method Detail
-
readProperties
protected void readProperties(JProperties prop, java.lang.String serverConf)
-
isEnabled
public boolean isEnabled()
- Returns:
- true if LDAP is enabled for this configuration.
-
getSynchronize
public boolean getSynchronize()
Check if synchronization of user is enabled for this configuration.- Returns:
- true if the user being retrieve from ldap should be synchronized in JCMS.
-
getSynchronizeDuringAuthentication
public boolean getSynchronizeDuringAuthentication()
Check if synchronization of user (and their groups if enabled) is to be performed during authentication.- Returns:
- true if the synchronisation should occurs during authentication, false otherwise
- Since:
- jcms-10.0.3 / JCMS-6382
-
getSynchronizeGroups
public boolean getSynchronizeGroups()
Check if synchronization of groups is enabled for this configuration.- Returns:
- true if the LDAP groups of the user being retrieve from LDAP should be synchronized in JCMS.
-
isSSL
public boolean isSSL()
- Returns:
- true if SSL in enabled for this configuration
-
getHostname
public java.lang.String getHostname()
- Returns:
- the hostname of the LDAP Server for this configuration
-
getLogin
public java.lang.String getLogin()
- Returns:
- the DN that should be used to connect/bind/authenticated to the LDAP server.
-
getPassword
public java.lang.String getPassword()
- Returns:
- the password that should be used to connect/bind/authenticated to the LDAP server.
-
setPassword
public void setPassword(java.lang.String password)
-
setLogin
public void setLogin(java.lang.String login)
-
getPort
public int getPort()
- Returns:
- the port number that should be used to connect to the LDAP server.
-
getSizeLimit
public int getSizeLimit()
- Returns:
- the size limit value that should be used during connection to the LDAP server, it defines the maximum number of result that can be retrieved during a search.
-
getTimeLimit
public int getTimeLimit()
- Returns:
- the time limit value that should be used during connection to the LDAP server, it defines the maximum number of milliseconds to wait for an operation to complete.
-
getVersion
public int getVersion()
- Returns:
- the protocol version to use to connect to the LDAP server.
-
getSuffix
public java.lang.String getSuffix()
- Returns:
- the base DN that should be used when searching users in the LDAP.
-
getUserFilter
public java.lang.String getUserFilter()
- Returns:
- a String that should be processed by the method
MessageFormat.format(java.lang.String, java.lang.Object[])and used to search for users in the LDAP.
-
setUserFilter
public void setUserFilter(java.lang.String userFilter)
-
getUserObjectClass
public java.lang.String getUserObjectClass()
- Returns:
- the objectClass value which defines that a LDAPEntry is a user.
- Since:
- jcms-5.7
-
setUserObjectClass
public void setUserObjectClass(java.lang.String userObjectClass)
-
getGroupSuffix
public java.lang.String getGroupSuffix()
- Returns:
- the base DN that should be used when searching groups in the LDAP.
- Since:
- jcms-5.7
-
getGroupFilter
public java.lang.String getGroupFilter()
- Returns:
- a String that should be processed by the method
MessageFormat.format(java.lang.String, java.lang.Object[])and used to search for groups in the LDAP. - Since:
- jcms-5.7
-
setGroupFilter
public void setGroupFilter(java.lang.String groupFilter)
-
getGroupObjectClass
public java.lang.String getGroupObjectClass()
- Returns:
- the objectClass value which defines that a LDAPEntry is a group.
- Since:
- jcms-5.7
-
setGroupObjectClass
public void setGroupObjectClass(java.lang.String groupObjectClass)
-
getGroupMappingUUID
public java.lang.String getGroupMappingUUID()
- Returns:
- the name of the LDAP attribute used as UUID for group mapping.
- Since:
- jcms-10.0.3 - JCMS-7454
-
setGroupMappingUUID
public void setGroupMappingUUID(java.lang.String groupMappingUUID)
-
isUsingPosixGroup
public boolean isUsingPosixGroup()
- Returns:
- true if the settings of this LDAPConfiguration define that the group being used is a posixGroup (groupObjectClass is "posixGroup" and groupFilter contains "memberUid").
- Since:
- jcms-5.7
-
-