Interface LDAPConnection

All Known Implementing Classes:
ActiveDirectoryConnectionImpl, EDirectoryConnectionImpl, JNDIConnectionImpl

public interface LDAPConnection
Provides ldap services.

The different implementations are responsible for providing support for server failover or other failure recovery features.

  • Method Details

    • close

      void close()
      Close the connection to the directory. All other methods of this interface should throw an exception if called after this method, but it is not guarenteed.
    • searchBaseEntry

      Collection searchBaseEntry(String searchbase, String filter, int limit, int timeout) throws LDAPOperationException, LDAPUnavailableException, NamingException
      Performs a base object search (i.e. just a search of the current entry, nothing below it), returning no attributes (i.e. just DNs);
      Parameters:
      searchbase - the domain name (relative to initial context in ldap) to seach from.
      filter - the non-null filter to use for the search
      limit - the maximum number of results to return
      timeout - the maximum time to wait before abandoning the search
      Returns:
      list of search results ('SearchResult's); entries matching the search filter.
      Throws:
      LDAPOperationException
      LDAPUnavailableException
      NamingException
    • searchBaseEntry

      Collection searchBaseEntry(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) throws LDAPOperationException, LDAPUnavailableException, NamingException
      Performs a base object search (i.e. just a search of the current entry, nothing below it).
      Parameters:
      searchbase - the domain name (relative to initial context in ldap) to seach from.
      filter - the non-null filter to use for the search
      limit - the maximum number of results to return
      timeout - the maximum time to wait before abandoning the search
      returnAttributes - an array of strings containing the names of attributes to search. (null = all, empty array = none)
      Returns:
      list of search results ('SearchResult's); entries matching the search filter.
      Throws:
      LDAPOperationException
      LDAPUnavailableException
      NamingException
    • searchSubTree

      Collection searchSubTree(String searchbase, String filter, int limit, int timeout) throws LDAPOperationException, LDAPUnavailableException, NamingException
      Performs a directory sub tree search (i.e. of the next level and all subsequent levels below), returning just dns);
      Parameters:
      searchbase - the domain name (relative to initial context in ldap) to seach from.
      filter - the non-null filter to use for the search
      limit - the maximum number of results to return
      timeout - the maximum time to wait before abandoning the search
      Returns:
      list of search results ('SearchResult's); entries matching the search filter. WARNING - these may be RELATIVE to the seachbase.
      Throws:
      LDAPOperationException
      LDAPUnavailableException
      NamingException
    • searchSubTree

      Collection<LDAPGenericObject> searchSubTree(String searchbase, String filter, int limit, int timeout, String[] returnAttributes) throws LDAPOperationException, LDAPUnavailableException, NamingException
      Performs a directory sub tree search (i.e. of the next level and all subsequent levels below).
      Parameters:
      searchbase - the domain name (relative to initial context in ldap) to seach from.
      filter - the non-null filter to use for the search
      limit - the maximum number of results to return
      timeout - the maximum time to wait before abandoning the search
      returnAttributes - an array of strings containing the names of attributes to search. (null = all, empty array = none)
      Returns:
      list of search results ('SearchResult's); entries matching the search filter. WARNING - these may be RELATIVE to the seachbase.
      Throws:
      LDAPOperationException
      LDAPUnavailableException
      NamingException
    • read

      Reads all the attribute type and values for the given entry.
      Parameters:
      distinguishedName - the ldap string distinguished name of entry to be read
      Returns:
      an 'Attributes' object containing a list of all Attribute objects.
      Throws:
      LDAPOperationException
      LDAPUnavailableException
      NamingException
    • checkPassword

      boolean checkPassword(String searchbase, String login, char[] plainPassword)
    • changePassword

      void changePassword(DirContext ctx, String argRDN, String oldPassword, String newPassword) throws NamingException
      Throws:
      NamingException