Class LDAPConnector
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.util.ldap.AbstractLDAPConnector
-
- org.ametys.plugins.datasourcesexplorer.LDAPConnector
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class LDAPConnector extends AbstractLDAPConnector implements Component
Connection stuff to read ldap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LDAPConnector.DN
A DN
-
Field Summary
Fields Modifier and Type Field Description static String
ROLE
The compoent role-
Fields inherited from class org.ametys.core.util.ldap.AbstractLDAPConnector
__DEFAULT_PAGE_SIZE, _ldapAdminPassword, _ldapAdminRelativeDN, _ldapAliasDerefMode, _ldapAuthenticationMethod, _ldapBaseDN, _ldapFollowReferrals, _ldapUrl, _ldapUseSSL, _pagingSupported, _serverSideSorting
-
-
Constructor Summary
Constructors Constructor Description LDAPConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
_count(int pageSize, String name, String filter, Object[] filterArgs, SearchControls searchControls)
Count the number of resultsprotected boolean
_hasResults(int pageSize, String name, String filter, Object[] filterArgs, SearchControls searchControls)
Count the number of resultsList<Map<String,String>>
getAttributes(String ldapDatasourceId, String dn)
Get the ldap attributes of a nodeCollection<LDAPConnector.DN>
getChildren(String ldapDatasourceId, String dn)
Get children DN-
Methods inherited from class org.ametys.core.util.ldap.AbstractLDAPConnector
_cleanup, _delayedInitialize, _getConfigParameter, _getContextEnv, _getFilter, _getRootContextEnv, _getSearchScope, _hasMoreEntries, _search, _search, _search, _search, _setResultsControls, _testConnectionsPooled, _testPagingSupported, getSortByFields, isPagingSupported, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
LDAPConnector
public LDAPConnector()
-
-
Method Detail
-
getAttributes
public List<Map<String,String>> getAttributes(String ldapDatasourceId, String dn) throws ProcessingException
Get the ldap attributes of a node- Parameters:
ldapDatasourceId
- The ldap datasource iddn
- The dn of the ldap node to get- Returns:
- The attributes
- Throws:
ProcessingException
- If an error occurred with ldap
-
getChildren
public Collection<LDAPConnector.DN> getChildren(String ldapDatasourceId, String dn) throws ProcessingException
Get children DN- Parameters:
ldapDatasourceId
- The ldap datasource iddn
- The parent DN. Can be empty to get root DN.- Returns:
- The children DNs
- Throws:
ProcessingException
- If an exception occurred while reading the ldap
-
_hasResults
protected boolean _hasResults(int pageSize, String name, String filter, Object[] filterArgs, SearchControls searchControls) throws NamingException
Count the number of results- Parameters:
pageSize
- The number of entries in a pagename
- the name of the context or object to searchfilter
- the filter expression to use for the searchfilterArgs
- the array of arguments to substitute for the variables in filter. Can be null.searchControls
- the search controls that control the search.- Returns:
- The number of results
- Throws:
NamingException
- If an error occurred
-
_count
protected int _count(int pageSize, String name, String filter, Object[] filterArgs, SearchControls searchControls) throws NamingException
Count the number of results- Parameters:
pageSize
- The number of entries in a pagename
- the name of the context or object to searchfilter
- the filter expression to use for the searchfilterArgs
- the array of arguments to substitute for the variables in filter. Can be null.searchControls
- the search controls that control the search.- Returns:
- The number of results
- Throws:
NamingException
- If an error occurred
-
-