Browse files

Documentation on which exceptions are thrown

  • Loading branch information...
alienscience committed Feb 9, 2011
1 parent 3ac3043 commit 13340cd7f011f06b8ef40018c411a8b5a9bdd892
Showing with 18 additions and 3 deletions.
  1. +18 −3
@@ -46,7 +46,9 @@ Options is a map with the following entries:
:timeout The timeout when waiting for a response from the server
(milliseconds), defaults to 5 minutes
-For example:
+Throws a [LDAPException]( if an error occurs establishing the connection pool or authenticating to any of the servers.
+An example:
(ldap/connect conn {:host "" :num-connections 10})
(ldap/connect conn {:host [{:address "" :port 8000}
@@ -61,21 +63,26 @@ For example:
## get [connection dn]
If successful, returns a map containing the entry for the given DN.
-Returns nil if the entry doesn't exist or cannot be read.
+Returns nil if the entry doesn't exist.
(ldap/get conn "cn=dude,ou=people,dc=example,dc=com")
+Throws a [LDAPException]( on error.
## add [connection dn entry]
Adds an entry to the connected ldap server. The entry is map of keywords to values which can be strings, sets or vectors.
(ldap/add conn "cn=dude,ou=people,dc=example,dc=com"
{:objectClass #{"top" "person"}
:cn "dude"
:sn "a"
:description "His dudeness"
:telephoneNumber ["1919191910" "4323324566"]})
+Throws a [LDAPException]( if there is an error with the request or the add failed.
## modify [connection dn modifications]
Modifies an entry in the connected ldap server. The modifications are
@@ -96,6 +103,9 @@ All the keys in the map are optional e.g:
(ldap/modify conn "cn=dude,ou=people,dc=example,dc=com"
{:add {:telephoneNumber "232546265"}})
+Throws a [LDAPException]( on error.
## search [connection base] [connection base options]
Runs a search on the connected ldap server, reads all the results into
@@ -114,6 +124,8 @@ e.g
(ldap/search conn "ou=people,dc=example,dc=com" {:attributes [:cn]})
+Throws a [LDAPSearchException]( on error.
## search! [connection base f] [connection base options f]
Runs a search on the connected ldap server and executes the given
@@ -137,10 +149,13 @@ e.g
{:filter "sn=dud*"}
(fn [x]
(println "Hello " (:cn x))))
+Throws a [LDAPSearchException]( if an error occurs during search. Throws an [EntrySourceException]( if there is an eror obtaining search results.
## delete [connection dn]
Deletes the entry with the given DN on the connected ldap server.
(ldap/delete conn "cn=dude,ou=people,dc=example,dc=com")
+Throws a [LDAPException]( if the object does not exist or an error occurs.

0 comments on commit 13340cd

Please sign in to comment.