From 8dd4c87972373e0eb1c074905819ae51187f98ad Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 21 Oct 2016 09:55:23 +0000
Subject: [PATCH] OPENDJ-3414 Support deep querying of LDAP attributes having JSON syntax

---
 opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2Ldap.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2Ldap.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2Ldap.java
index ae42e86..114b0de 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2Ldap.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2Ldap.java
@@ -295,6 +295,28 @@
     }
 
     /**
+     * Returns a property mapper which provides a mapping from a JSON value to a LDAP attribute having the JSON syntax.
+     *
+     * @param attribute
+     *         The LDAP attribute to be mapped.
+     * @return The property mapper.
+     */
+    public static JsonPropertyMapper json(final AttributeDescription attribute) {
+        return new JsonPropertyMapper(attribute);
+    }
+
+    /**
+     * Returns a property mapper which provides a mapping from a JSON value to a LDAP attribute having the JSON syntax.
+     *
+     * @param attribute
+     *         The LDAP attribute to be mapped.
+     * @return The property mapper.
+     */
+    public static JsonPropertyMapper json(final String attribute) {
+        return json(AttributeDescription.valueOf(attribute));
+    }
+
+    /**
      * Adapts a {@code Throwable} to a {@code ResourceException}. If the {@code Throwable} is an LDAP
      * {@link LdapException} then an appropriate {@code ResourceException} is returned, otherwise an {@code
      * InternalServerErrorException} is returned.

--
Gitblit v1.10.0