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
Connection stuff to read ldap
-
Nested Class Summary
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 resultsgetAttributes
(String ldapDatasourceId, String dn) Get the ldap attributes of a nodegetChildren
(String ldapDatasourceId, String dn) Get children DNMethods inherited from class org.ametys.core.util.ldap.AbstractLDAPConnector
_cleanup, _delayedInitialize, _getConfigParameter, _getContextEnv, _getFilter, _getRootContextEnv, _getSearchScope, _hasMoreEntries, _isPagingSupported, _search, _search, _search, _search, _setResultsControls, _testConnectionsPooled, _testPagingSupported, getSortByFields, service
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The compoent role
-
-
Constructor Details
-
LDAPConnector
public LDAPConnector()
-
-
Method Details
-
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
-