             LDAPConnection
             ResultCode
             LDAPConnectionPool
+            LDAPConnectionPoolStatistics
             LDAPException
             Attribute
             Entry


(ns clj-ldap.client
  "LDAP client"
  (:refer-clojure :exclude [get])

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

(defn connection-pool-stats
  [connection-pool]
  (let [statistics (.LDAPConnectionPoolStatistics connection-pool)]
  (.toString statistics)))

(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]
    (.bind connection (bind-request {:bind-dn bind-dn :password password})))

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