Class LDAPConnector

All Implemented Interfaces:
LogEnabled, Component, Serviceable

public class LDAPConnector extends AbstractLDAPConnector implements Component
Connection stuff to read ldap
  • Field Details

    • ROLE

      public static final String ROLE
      The compoent role
  • Constructor Details

  • 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 id
      dn - 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 id
      dn - 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 page
      name - the name of the context or object to search
      filter - the filter expression to use for the search
      filterArgs - 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 page
      name - the name of the context or object to search
      filter - the filter expression to use for the search
      filterArgs - 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