From 1f3592b4ab0a329ed8e54e311b89d2bca68efb81 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 21 Sep 2007 00:49:05 +0000
Subject: [PATCH] Update a number of result codes to make the values more consistent across operations.  Also, eliminate a number of incorrect uses of the OPERATIONS_ERROR result and replace them with the more correct OTHER result.

---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
index 5d0df11..89e40ea 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -145,7 +145,7 @@
       // passwords.
       Message message = ERR_PWPOLICY_ATTRIBUTE_OPTIONS_NOT_ALLOWED.get(
           passwordAttribute.getNameOrOID());
-      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
+      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
     }
 
     Attribute passwordAttr = attrList.get(0);
@@ -153,7 +153,7 @@
     {
       Message message = ERR_PWPOLICY_ATTRIBUTE_OPTIONS_NOT_ALLOWED.get(
           passwordAttribute.getNameOrOID());
-      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
+      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
     }
 
     LinkedHashSet<AttributeValue> values = passwordAttr.getValues();
@@ -170,7 +170,7 @@
 
       Message message = ERR_PWPOLICY_MULTIPLE_PW_VALUES_NOT_ALLOWED.get(
           passwordAttribute.getNameOrOID());
-      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
+      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
     }
 
     CopyOnWriteArrayList<PasswordStorageScheme> defaultStorageSchemes =
@@ -198,7 +198,7 @@
 
             Message message = ERR_PWPOLICY_PREENCODED_NOT_ALLOWED.get(
                 passwordAttribute.getNameOrOID());
-            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
+            throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
                                          message);
           }
         }
@@ -219,7 +219,7 @@
 
             Message message = ERR_PWPOLICY_PREENCODED_NOT_ALLOWED.get(
                 passwordAttribute.getNameOrOID());
-            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
+            throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
                                          message);
           }
         }
@@ -245,7 +245,7 @@
             Message message = ERR_PWPOLICY_VALIDATION_FAILED.
                 get(passwordAttribute.getNameOrOID(),
                     String.valueOf(invalidReason));
-            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
+            throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
                                          message);
           }
         }

--
Gitblit v1.10.0