Interface LDAPConnection

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void changePassword​(javax.naming.directory.DirContext ctx, java.lang.String argRDN, java.lang.String oldPassword, java.lang.String newPassword)  
      boolean checkPassword​(java.lang.String searchbase, java.lang.String login, char[] plainPassword)  
      void close()
      Close the connection to the directory.
      javax.naming.directory.Attributes read​(java.lang.String distinguishedName)
      Reads all the attribute type and values for the given entry.
      java.util.Collection searchBaseEntry​(java.lang.String searchbase, java.lang.String filter, int limit, int timeout)
      Performs a base object search (i.e.
      java.util.Collection searchBaseEntry​(java.lang.String searchbase, java.lang.String filter, int limit, int timeout, java.lang.String[] returnAttributes)
      Performs a base object search (i.e.
      java.util.Collection searchSubTree​(java.lang.String searchbase, java.lang.String filter, int limit, int timeout)
      Performs a directory sub tree search (i.e.
      java.util.Collection<LDAPGenericObject> searchSubTree​(java.lang.String searchbase, java.lang.String filter, int limit, int timeout, java.lang.String[] returnAttributes)
      Performs a directory sub tree search (i.e.
    • Method Detail

      • 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

        java.util.Collection searchBaseEntry​(java.lang.String searchbase,
                                             java.lang.String filter,
                                             int limit,
                                             int timeout)
                                      throws LDAPOperationException,
                                             LDAPUnavailableException,
                                             javax.naming.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
        javax.naming.NamingException
      • searchBaseEntry

        java.util.Collection searchBaseEntry​(java.lang.String searchbase,
                                             java.lang.String filter,
                                             int limit,
                                             int timeout,
                                             java.lang.String[] returnAttributes)
                                      throws LDAPOperationException,
                                             LDAPUnavailableException,
                                             javax.naming.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
        javax.naming.NamingException
      • searchSubTree

        java.util.Collection searchSubTree​(java.lang.String searchbase,
                                           java.lang.String filter,
                                           int limit,
                                           int timeout)
                                    throws LDAPOperationException,
                                           LDAPUnavailableException,
                                           javax.naming.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
        javax.naming.NamingException
      • searchSubTree

        java.util.Collection<LDAPGenericObject> searchSubTree​(java.lang.String searchbase,
                                                              java.lang.String filter,
                                                              int limit,
                                                              int timeout,
                                                              java.lang.String[] returnAttributes)
                                                       throws LDAPOperationException,
                                                              LDAPUnavailableException,
                                                              javax.naming.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
        javax.naming.NamingException
      • read

        javax.naming.directory.Attributes read​(java.lang.String distinguishedName)
                                        throws LDAPOperationException,
                                               LDAPUnavailableException,
                                               javax.naming.NamingException
        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
        javax.naming.NamingException
      • checkPassword

        boolean checkPassword​(java.lang.String searchbase,
                              java.lang.String login,
                              char[] plainPassword)
      • changePassword

        void changePassword​(javax.naming.directory.DirContext ctx,
                            java.lang.String argRDN,
                            java.lang.String oldPassword,
                            java.lang.String newPassword)
                     throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException