From fb7bab895bca6c06521b4371ff67523d4b1941ba Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 23 Jun 2016 00:21:25 +0000
Subject: [PATCH] OPENDJ-3036 Fix inconsistent field naming in Rest2Ldap config files

---
 opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/WritabilityPolicy.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/WritabilityPolicy.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/WritabilityPolicy.java
index 4b46b45..ef8e06d 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/WritabilityPolicy.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/WritabilityPolicy.java
@@ -25,39 +25,41 @@
      * modified afterwards. Attempts to update the attribute will result in an
      * error.
      */
-    READ_ONLY(false),
+    READ_ONLY("readOnly", false),
 
     /**
      * The attribute cannot be provided when creating a new resource, nor
      * modified afterwards. Attempts to update the attribute will not result in
      * an error (the new values will be ignored).
      */
-    READ_ONLY_DISCARD_WRITES(true),
+    READ_ONLY_DISCARD_WRITES("readOnlyDiscardWrites", true),
 
     /**
      * The attribute may be provided when creating a new resource, but cannot be
      * modified afterwards. Attempts to update the attribute will result in an
      * error.
      */
-    CREATE_ONLY(false),
+    CREATE_ONLY("createOnly", false),
 
     /**
      * The attribute may be provided when creating a new resource, but cannot be
      * modified afterwards. Attempts to update the attribute will not result in
      * an error (the new values will be ignored).
      */
-    CREATE_ONLY_DISCARD_WRITES(true),
+    CREATE_ONLY_DISCARD_WRITES("createOnlyDiscardWrites", true),
 
     /**
      * The attribute may be provided when creating a new resource, and modified
      * afterwards.
      */
-    READ_WRITE(false);
+    READ_WRITE("readWrite", false);
     // @formatter:on
 
+    private final String name;
     private final boolean discardWrites;
 
-    private WritabilityPolicy(final boolean discardWrites) {
+    WritabilityPolicy(final String name, final boolean discardWrites) {
+        this.name = name;
         this.discardWrites = discardWrites;
     }
 
@@ -72,4 +74,9 @@
     boolean discardWrites() {
         return discardWrites;
     }
+
+    @Override
+    public String toString() {
+        return name;
+    }
 }

--
Gitblit v1.10.0