Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed increment operation

  • Loading branch information...
commit a201fa6bb4d2eab4e66bb4785535e8079fd2b6dc 1 parent 4116017
@alienscience authored
Showing with 4 additions and 15 deletions.
  1. +1 −2  README.md
  2. +3 −13 src/clj_ldap/client.clj
View
3  README.md
@@ -89,8 +89,7 @@ a map in the form:
:attribute-e [value1 value2]}
:replace
{:attibute-d value
- :attribute-e [value1 value2]}
- :increment [:attribute-f attribute-g]}
+ :attribute-e [value1 value2]}}
All the keys in the map are optional e.g:
View
16 src/clj_ldap/client.clj
@@ -155,14 +155,6 @@
(for [[k v] modify-map]
(create-modification modify-op (name k) v)))
-(defn- modify-incs
- "Returns a sequence of Modification objects that increment the given
- attribute(s)"
- [attributes]
- (if attributes
- (if (coll? attributes)
- (map #(Modification. ModificationType/INCREMENT %) attributes)
- [(Modification. ModificationType/INCREMENT attributes)])))
(defn- get-modify-request
"Sets up a ModifyRequest object using the contents of the given map"
@@ -170,9 +162,8 @@
(let [adds (modify-ops ModificationType/ADD (modifications :add))
deletes (modify-ops ModificationType/DELETE (modifications :delete))
replacements (modify-ops ModificationType/REPLACE
- (modifications :replace))
- incs (modify-incs (modifications :increment))]
- (ModifyRequest. dn (into-array (concat adds deletes replacements incs)))))
+ (modifications :replace))]
+ (ModifyRequest. dn (into-array (concat adds deletes replacements)))))
;;=========== API ==============================================================
@@ -234,8 +225,7 @@
:attribute-e [value1 value2]}
:replace
{:attibute-d value
- :attribute-e [value1 value2]}
- :increment [:attribute-f attribute-g]}
+ :attribute-e [value1 value2]}}
"
[connection dn modifications]
(let [modify-obj (get-modify-request dn modifications)]
Please sign in to comment.
Something went wrong with that request. Please try again.