Class LdapUserDirectoryChecker
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.checker.LdapUserDirectoryChecker
-
- All Implemented Interfaces:
ItemChecker
,LogEnabled
,Serviceable
public class LdapUserDirectoryChecker extends AbstractLogEnabled implements ItemChecker, Serviceable
Tests the LDAP user directory is not empty
-
-
Field Summary
Fields Modifier and Type Field Description private LDAPDataSourceManager
_ldapDataSourceManager
The LDAP data source managerprivate ServiceManager
_manager
The service manager
-
Constructor Summary
Constructors Constructor Description LdapUserDirectoryChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_cleanup(Context context, NamingEnumeration result)
private Map<String,Object>
_getAttributes(SearchResult entry, String usersLoginAttribute, String usersFirstnameAttribute, String usersLastnameAttribute, String usersEmailAttribute, boolean userEmailIsMandatory)
private Hashtable<String,String>
_getContextEnv(AbstractDataSourceManager.DataSourceDefinition ldapDefinition)
private SearchControls
_getSearchConstraint(int maxResults, String usersFirstnameAttribute, String usersLoginAttribute, String usersLastnameAttribute, String usersEmailAttribute, int usersSearchScope)
void
check(List<String> values)
Checks the validity of the parameters.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_manager
private ServiceManager _manager
The service manager
-
_ldapDataSourceManager
private LDAPDataSourceManager _ldapDataSourceManager
The LDAP data source manager
-
-
Constructor Detail
-
LdapUserDirectoryChecker
public LdapUserDirectoryChecker()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
check
public void check(List<String> values) throws ItemCheckerTestFailureException
Description copied from interface:ItemChecker
Checks the validity of the parameters.- Specified by:
check
in interfaceItemChecker
- Parameters:
values
- the values to test- Throws:
ItemCheckerTestFailureException
- if the test failed
-
_getContextEnv
private Hashtable<String,String> _getContextEnv(AbstractDataSourceManager.DataSourceDefinition ldapDefinition)
-
_getSearchConstraint
private SearchControls _getSearchConstraint(int maxResults, String usersFirstnameAttribute, String usersLoginAttribute, String usersLastnameAttribute, String usersEmailAttribute, int usersSearchScope)
-
_getAttributes
private Map<String,Object> _getAttributes(SearchResult entry, String usersLoginAttribute, String usersFirstnameAttribute, String usersLastnameAttribute, String usersEmailAttribute, boolean userEmailIsMandatory) throws NamingException
- Throws:
NamingException
-
_cleanup
private void _cleanup(Context context, NamingEnumeration result) throws NamingException
- Throws:
NamingException
-
-