             EntrySourceException
             SearchScope])
   (:import [com.unboundid.ldap.sdk.extensions
-            PasswordModifyExtendedRequest])
+            PasswordModifyExtendedRequest
+            PasswordModifyExtendedResult])
   (:import [com.unboundid.ldap.sdk.controls
             PreReadRequestControl
             PostReadRequestControl

      (connect-to-hosts options)
      (connect-to-host options))))

(defn get-connection
  "Retrieves an LDAP connection from the pool."
  [connection-pool]
  (.getConnection connection-pool))

(defn release-connection
  "Releases the provided connection back to the pool."
  [connection-pool connection]
  (.releaseConnection connection-pool connection))

(defn bind-connection
  "Performs a bind operation using the provided connection and optional
   credentials. If called with a connection pool, the connection used
   for the bind request is returned to the pool after the server response.
   If called with an LDAP connection, and the bind request is successful,
   it will change the identity of that connection."
    [connection bind-dn password]
    (try 
      ((.bind connection bind-dn password) true)
      (catch Exception _ false)))

(defn get
  "If successful, returns a map containing the entry for the given DN.

    (let [request (PasswordModifyExtendedRequest. old new)]
      (.processExtendedOperation connection request)))

  ([connection old new dn]
    (let [request (PasswordModifyExtendedRequest. dn old new)]
      (.processExtendedOperation connection request))))

(defn delete
