Class LdapManager
- Since:
- jcms-9.0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intDefault value used for the maximum number of operations to process per periodical sync.static final StringProperty name used to specify the maximum number of operations to process per periodical sync.static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck type of Member to create during LDAP synchronization.getGroupFromDN(String dn) Returns a LDAP group from its distinguish name.static final LdapManagerReturns the default LDAPConfiguration used by JCMS which you can give toLDAPMapper(LDAPConfiguration)to connect to your LDAP server.Retrieve the LDAPConfiguration for the specific DN.getLDAPConfigurationFromDomain(String domain) Retrieve the LDAPConfiguration for the specific domain.Retrieve the LDAPConfiguration to use based on the specified login.Returns all LDAPConfiguration configured in JCMS.Retrieve a new context map indicating operation is being processed for LDAP.voidImport all LDAP users (and their groups) in JCMS, updating existing data if any.voidinitLDAP()Initialize or Reinitialize LDAP configuration.booleanChecks if an import all operation is in progress.booleanChecks if LDAP is enabled.voidstartImportAllThread(javax.servlet.http.HttpSession session)
-
Field Details
-
PERIODIC_SYNC_ENABLED
- See Also:
-
PERIODIC_SYNC_SCHEDULE
- See Also:
-
LDAP_IMPORT_ALL_DONE
- See Also:
-
SYNCHRONIZE_CREATE_DBMEMBER_PROP
- See Also:
-
PERIODIC_SYNC_MAX_OP_PER_SYNC_PROP
Property name used to specify the maximum number of operations to process per periodical sync.- Since:
- 10.0.8 / JCMS-10654
- See Also:
-
PERIODIC_SYNC_MAX_OP_PER_SYNC_DEFAULT_VALUE
public static final int PERIODIC_SYNC_MAX_OP_PER_SYNC_DEFAULT_VALUEDefault value used for the maximum number of operations to process per periodical sync.- Since:
- 10.0.8 / JCMS-10654
- See Also:
-
-
Method Details
-
getInstance
-
initLDAP
public void initLDAP()Initialize or Reinitialize LDAP configuration. -
getLDAPConfiguration
Returns the default LDAPConfiguration used by JCMS which you can give toLDAPMapper(LDAPConfiguration)to connect to your LDAP server.- Returns:
- the current LDAPConfiguration used by JCMS
- Since:
- jcms-5.5.0
-
getLDAPConfigurationFromLogin
Retrieve the LDAPConfiguration to use based on the specified login.If the specified login is a mail, a Windows UPN (User Principal Name) format, or a down-level windows logon format (DOMAIN\sAMAccountName), the domain part is extracted and the LDAP configuration will be read from properties
ldap.server.{DOMAIN}.*(if available) instead of the defaultldap.server.*properties.
Configuration alias can also be defined with propertyldap.conf-aliases.{domain}: confnameallowing several domain to match on LDAP configuration.- Parameters:
login- the login used to determine which configuration to use- Returns:
- a LDAPConfiguration, never return null (default to
getLDAPConfiguration().
-
getLDAPConfigurationFromDomain
Retrieve the LDAPConfiguration for the specific domain.- Parameters:
domain- an optional configuration name or alias, as declared in ldap configuration propertiesldap.server.{domain}.*or through LDAP configuration alias declared in propertyldap.conf-aliases.{domain}: confname- Returns:
- an instance of LDAPConfiguration, never return null (default to
getLDAPConfiguration())
-
getLDAPConfigurationFromDN
Retrieve the LDAPConfiguration for the specific DN.Look for the first LDAPConfiguration which has a matching baseDN, tested on both user base DN (
LDAPConfiguration.getSuffix()) and group base DN (LDAPConfiguration.getGroupSuffix()).- Parameters:
dn- an LDAP distinguish name- Returns:
- an instance of LDAPConfiguration, never return null (default to
getLDAPConfiguration())
-
getLDAPConfigurations
Returns all LDAPConfiguration configured in JCMS.- Returns:
- a List of all LDAPConfigurations configured in JCMS, never return null
- Since:
- jcms-9.0.1
-
importAll
public void importAll()Import all LDAP users (and their groups) in JCMS, updating existing data if any.For each LDAP configuration declared, this method retrieves all users in the LDAP matching the current filters and then trigger the synchronisation operation impletemented in the
LdapAuthenticationHandler:
create or update operation of corresponding Member and Group(s).All existing LDAP Member not found during the LDAP search are also processed to disable them as needed.
-
isImportAllInProgress
public boolean isImportAllInProgress()Checks if an import all operation is in progress.- Returns:
- true if
importAll()is currently working, false otherwise
-
isLdapEnabled
public boolean isLdapEnabled()Checks if LDAP is enabled.- Returns:
- true if LDAP is enabled, false otherwise
-
getGroupFromDN
Returns a LDAP group from its distinguish name.- Parameters:
dn- the dn of the group- Returns:
- the group or null if not found
-
createDBMember
public boolean createDBMember()Check type of Member to create during LDAP synchronization.- Returns:
- false to create JStore Member, true to create DBMember
- Since:
- jcms-10.0.1 / JCMS-6340
-
getNewLdapContextMap
Retrieve a new context map indicating operation is being processed for LDAP.Implementation detail : the returned map will contain key {link DataController#CTXT_SYNC_LDAP} with value
Boolean.TRUE- Returns:
- a new Map
- Since:
- 10.0.8 / JCMS-10691
-
startImportAllThread
public void startImportAllThread(javax.servlet.http.HttpSession session)
-