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/LocalBackendWorkflowElement.java |   20 +++++-----
 opends/src/server/org/opends/server/replication/server/ReplicationServer.java                     |    6 ++-
 opends/src/server/org/opends/server/tools/dsconfig/GetPropSubCommandHandler.java                  |    4 +-
 opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java                       |    2 
 opends/src/server/org/opends/server/tools/dsconfig/ListSubCommandHandler.java                     |   12 +++---
 opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java                  |   16 ++++----
 opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java                       |    4 +-
 opends/src/server/org/opends/server/core/ExtendedOperationBasis.java                              |    2 
 opends/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java                   |   14 +++---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java    |   12 +++---
 opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java                   |    4 +-
 11 files changed, 49 insertions(+), 47 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java b/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java
index 90df451..a82b00a 100644
--- a/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java
+++ b/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java
@@ -472,7 +472,7 @@
            DirectoryServer.getExtendedOperationHandler(requestOID);
       if (handler == null)
       {
-        setResultCode(ResultCode.UNAVAILABLE_CRITICAL_EXTENSION);
+        setResultCode(ResultCode.UNWILLING_TO_PERFORM);
         appendErrorMessage(ERR_EXTENDED_NO_HANDLER.get(
                 String.valueOf(requestOID)));
         break extendedProcessing;
diff --git a/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java b/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
index 8b54232..e2f2ffe 100644
--- a/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
+++ b/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -164,7 +164,7 @@
       }
       catch (RuntimeException e)
       {
-        resultCode = ResultCode.OPERATIONS_ERROR;
+        resultCode = DirectoryServer.getServerErrorResultCode();
         messages.add(Message.raw(e.getMessage()));
       }
     }
diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationServer.java b/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
index 118c352..7781781 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -656,13 +656,15 @@
       {
         Message message = ERR_COULD_NOT_CLOSE_THE_SOCKET.get(e.toString());
         logError(message);
-        new ConfigChangeResult(ResultCode.OPERATIONS_ERROR, false);
+        new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(),
+                               false);
       }
       catch (InterruptedException e)
       {
         Message message = ERR_COULD_NOT_STOP_LISTEN_THREAD.get(e.toString());
         logError(message);
-        new ConfigChangeResult(ResultCode.OPERATIONS_ERROR, false);
+        new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(),
+                               false);
       }
     }
 
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java b/opends/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java
index 1671991..b303f19 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java
@@ -497,16 +497,16 @@
                 LDAPResultCode.INSUFFICIENT_ACCESS_RIGHTS, msg);
           } catch (DefinitionDecodingException e) {
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_DDE.get(rufn, rufn, rufn);
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+            throw new ClientException(LDAPResultCode.OTHER, msg);
           } catch (ManagedObjectDecodingException e) {
             // FIXME: should not abort here. Instead, display the
             // errors (if verbose) and apply the changes to the
             // partial managed object.
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_MODE.get(rufn);
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+            throw new ClientException(LDAPResultCode.OTHER, msg, e);
           } catch (CommunicationException e) {
             Message msg = ERR_DSCFG_ERROR_CREATE_CE.get(ufn, e.getMessage());
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+            throw new ClientException(LDAPResultCode.OTHER, msg);
           } catch (ManagedObjectNotFoundException e) {
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_MONFE.get(rufn);
             throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg);
@@ -567,7 +567,7 @@
               } catch (CommunicationException e) {
                 Message msg = ERR_DSCFG_ERROR_CREATE_CE
                     .get(ufn, e.getMessage());
-                throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+                throw new ClientException(LDAPResultCode.OTHER, msg);
               } catch (ManagedObjectAlreadyExistsException e) {
                 // Should never happen.
                 throw new IllegalStateException(e);
@@ -696,7 +696,7 @@
         }
       } catch (CommunicationException e) {
         Message msg = ERR_DSCFG_ERROR_CREATE_CE.get(ufn, e.getMessage());
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+        throw new ClientException(LDAPResultCode.OTHER, msg);
       } catch (ManagedObjectAlreadyExistsException e) {
         Message msg = ERR_DSCFG_ERROR_CREATE_MOAEE.get(ufn);
         throw new ClientException(LDAPResultCode.ENTRY_ALREADY_EXISTS, msg);
@@ -1072,11 +1072,11 @@
     } catch (DefinitionDecodingException e) {
       Message pufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_DDE.get(pufn, pufn, pufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ManagedObjectDecodingException e) {
       Message pufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_MODE.get(pufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+      throw new ClientException(LDAPResultCode.OTHER, msg, e);
     } catch (CommunicationException e) {
       Message msg = ERR_DSCFG_ERROR_CREATE_CE.get(ufn, e
           .getMessage());
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java b/opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java
index 8c30ab6..db13760 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java
@@ -215,11 +215,11 @@
     } catch (DefinitionDecodingException e) {
       Message pufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_DDE.get(pufn, pufn, pufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ManagedObjectDecodingException e) {
       Message pufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_MODE.get(pufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+      throw new ClientException(LDAPResultCode.OTHER, msg, e);
     } catch (CommunicationException e) {
       Message msg = ERR_DSCFG_ERROR_DELETE_CE.get(ufn, e.getMessage());
       throw new ClientException(LDAPResultCode.CLIENT_SIDE_SERVER_DOWN, msg);
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/GetPropSubCommandHandler.java b/opends/src/server/org/opends/server/tools/dsconfig/GetPropSubCommandHandler.java
index 5ca84e8..5d2850c 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/GetPropSubCommandHandler.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/GetPropSubCommandHandler.java
@@ -232,10 +232,10 @@
       throw new ClientException(LDAPResultCode.INSUFFICIENT_ACCESS_RIGHTS, msg);
     } catch (DefinitionDecodingException e) {
       Message msg = ERR_DSCFG_ERROR_GET_CHILD_DDE.get(ufn, ufn, ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ManagedObjectDecodingException e) {
       Message msg = ERR_DSCFG_ERROR_GET_CHILD_MODE.get(ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+      throw new ClientException(LDAPResultCode.OTHER, msg, e);
     } catch (CommunicationException e) {
       Message msg = ERR_DSCFG_ERROR_GET_CHILD_CE.get(ufn, e.getMessage());
       throw new ClientException(LDAPResultCode.CLIENT_SIDE_SERVER_DOWN, msg);
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/ListSubCommandHandler.java b/opends/src/server/org/opends/server/tools/dsconfig/ListSubCommandHandler.java
index fb4f43a..20447fb 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/ListSubCommandHandler.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/ListSubCommandHandler.java
@@ -224,11 +224,11 @@
     } catch (DefinitionDecodingException e) {
       ufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_DDE.get(ufn, ufn, ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ManagedObjectDecodingException e) {
       ufn = path.getManagedObjectDefinition().getUserFriendlyName();
       Message msg = ERR_DSCFG_ERROR_GET_PARENT_MODE.get(ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+      throw new ClientException(LDAPResultCode.OTHER, msg, e);
     } catch (CommunicationException e) {
       Message msg = ERR_DSCFG_ERROR_LIST_CE.get(ufn, e.getMessage());
       throw new ClientException(LDAPResultCode.CLIENT_SIDE_SERVER_DOWN, msg);
@@ -265,12 +265,12 @@
         // FIXME: just output this as a warnings (incl. the name) but
         // continue.
         Message msg = ERR_DSCFG_ERROR_LIST_DDE.get(ufn, ufn, ufn);
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+        throw new ClientException(LDAPResultCode.OTHER, msg);
       } catch (ManagedObjectDecodingException e) {
         // FIXME: just output this as a warnings (incl. the name) but
         // continue.
         Message msg = ERR_DSCFG_ERROR_LIST_MODE.get(ufn);
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+        throw new ClientException(LDAPResultCode.OTHER, msg, e);
       } catch (AuthorizationException e) {
         Message msg = ERR_DSCFG_ERROR_LIST_AUTHZ.get(ufn);
         throw new ClientException(LDAPResultCode.INSUFFICIENT_ACCESS_RIGHTS,
@@ -300,10 +300,10 @@
             msg);
       } catch (DefinitionDecodingException e) {
         Message msg = ERR_DSCFG_ERROR_LIST_DDE.get(ufn, ufn, ufn);
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+        throw new ClientException(LDAPResultCode.OTHER, msg);
       } catch (ManagedObjectDecodingException e) {
         Message msg = ERR_DSCFG_ERROR_LIST_MODE.get(ufn);
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+        throw new ClientException(LDAPResultCode.OTHER, msg, e);
       } catch (ConcurrentModificationException e) {
         Message msg = ERR_DSCFG_ERROR_LIST_CME.get(ufn);
         throw new ClientException(LDAPResultCode.CONSTRAINT_VIOLATION, msg);
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java b/opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
index 0919530..e06a82c 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
@@ -137,12 +137,12 @@
           Message pufn = path.getManagedObjectDefinition()
               .getUserFriendlyName();
           Message msg = ERR_DSCFG_ERROR_GET_PARENT_DDE.get(pufn, pufn, pufn);
-          throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+          throw new ClientException(LDAPResultCode.OTHER, msg);
         } catch (ManagedObjectDecodingException e) {
           Message pufn = path.getManagedObjectDefinition()
               .getUserFriendlyName();
           Message msg = ERR_DSCFG_ERROR_GET_PARENT_MODE.get(pufn);
-          throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+          throw new ClientException(LDAPResultCode.OTHER, msg, e);
         } catch (CommunicationException e) {
           Message msg = ERR_DSCFG_ERROR_CREATE_CE.get(ufn, e.getMessage());
           throw new ClientException(LDAPResultCode.CLIENT_SIDE_SERVER_DOWN,
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java b/opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java
index c800122..ea75a75 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java
@@ -322,7 +322,7 @@
         }
       } catch (CommunicationException e) {
         Message msg = ERR_DSCFG_ERROR_MODIFY_CE.get(ufn, e.getMessage());
-        throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+        throw new ClientException(LDAPResultCode.OTHER, msg);
       } catch (ManagedObjectAlreadyExistsException e) {
         // Should never happen.
         throw new IllegalStateException(e);
@@ -383,16 +383,16 @@
                 LDAPResultCode.INSUFFICIENT_ACCESS_RIGHTS, msg);
           } catch (DefinitionDecodingException e) {
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_DDE.get(rufn, rufn, rufn);
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+            throw new ClientException(LDAPResultCode.OTHER, msg);
           } catch (ManagedObjectDecodingException e) {
             // FIXME: should not abort here. Instead, display the
             // errors (if verbose) and apply the changes to the
             // partial managed object.
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_MODE.get(rufn);
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+            throw new ClientException(LDAPResultCode.OTHER, msg, e);
           } catch (CommunicationException e) {
             Message msg = ERR_DSCFG_ERROR_MODIFY_CE.get(ufn, e.getMessage());
-            throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+            throw new ClientException(LDAPResultCode.OTHER, msg);
           } catch (ManagedObjectNotFoundException e) {
             Message msg = ERR_DSCFG_ERROR_GET_CHILD_MONFE.get(rufn);
             throw new ClientException(LDAPResultCode.NO_SUCH_OBJECT, msg);
@@ -453,7 +453,7 @@
               } catch (CommunicationException e) {
                 Message msg = ERR_DSCFG_ERROR_MODIFY_CE
                     .get(ufn, e.getMessage());
-                throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+                throw new ClientException(LDAPResultCode.OTHER, msg);
               } catch (ManagedObjectAlreadyExistsException e) {
                 // Should never happen.
                 throw new IllegalStateException(e);
@@ -607,15 +607,15 @@
       throw new ClientException(LDAPResultCode.INSUFFICIENT_ACCESS_RIGHTS, msg);
     } catch (DefinitionDecodingException e) {
       Message msg = ERR_DSCFG_ERROR_GET_CHILD_DDE.get(ufn, ufn, ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ManagedObjectDecodingException e) {
       // FIXME: should not abort here. Instead, display the errors (if
       // verbose) and apply the changes to the partial managed object.
       Message msg = ERR_DSCFG_ERROR_GET_CHILD_MODE.get(ufn);
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg, e);
+      throw new ClientException(LDAPResultCode.OTHER, msg, e);
     } catch (CommunicationException e) {
       Message msg = ERR_DSCFG_ERROR_MODIFY_CE.get(ufn, e.getMessage());
-      throw new ClientException(LDAPResultCode.OPERATIONS_ERROR, msg);
+      throw new ClientException(LDAPResultCode.OTHER, msg);
     } catch (ConcurrentModificationException e) {
       Message msg = ERR_DSCFG_ERROR_MODIFY_CME.get(ufn);
       throw new ClientException(LDAPResultCode.CONSTRAINT_VIOLATION, msg);
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);
           }
         }
diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
index 8200408..8e1b78d 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -962,7 +962,7 @@
                   localOp.isSynchronizationOperation() ||
                   m.isInternal()))
               {
-                localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
                 localOp.appendErrorMessage(
                     ERR_MODIFY_ATTR_IS_OBSOLETE.get(String.valueOf(entryDN),
                     a.getName()));
@@ -5052,7 +5052,7 @@
               }
               else
               {
-                localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
 
                 localOp.appendErrorMessage(ERR_ADD_MISSING_RDN_ATTRIBUTE.get(
                         String.valueOf(entryDN),
@@ -5094,7 +5094,7 @@
                 }
                 else
                 {
-                  localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                  localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
 
                   localOp.appendErrorMessage(
                       ERR_ADD_MISSING_RDN_ATTRIBUTE.get(
@@ -5124,7 +5124,7 @@
               }
               else
               {
-                localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
 
                 localOp.appendErrorMessage(
                     ERR_ADD_MISSING_RDN_ATTRIBUTE.get(
@@ -5166,7 +5166,7 @@
                 }
                 else
                 {
-                  localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                  localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
 
                   localOp.appendErrorMessage(
                       ERR_ADD_MISSING_RDN_ATTRIBUTE.get(
@@ -5277,7 +5277,7 @@
                     ERR_ADD_NO_SUCH_PWPOLICY.get(String.valueOf(entryDN),
                         String.valueOf(policyDN)));
 
-                localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+                localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
                 break addProcessing;
               }
             }
@@ -5450,7 +5450,7 @@
                       String.valueOf(entryDN),
                       at.getNameOrOID());
               localOp.appendErrorMessage(message);
-              localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+              localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
               break addProcessing;
             }
           }
@@ -5463,7 +5463,7 @@
                       String.valueOf(entryDN),
                       at.getNameOrOID());
               localOp.appendErrorMessage(message);
-              localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+              localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
               break addProcessing;
             }
           }
@@ -5476,7 +5476,7 @@
                       String.valueOf(entryDN),
                       oc.getNameOrOID());
               localOp.appendErrorMessage(message);
-              localOp.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+              localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
               break addProcessing;
             }
           }
@@ -8166,7 +8166,7 @@
             AttributeType at = newRDN.getAttributeType(i);
             if (at.isObsolete())
             {
-              op.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+              op.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
               op.appendErrorMessage(ERR_MODDN_NEWRDN_ATTR_IS_OBSOLETE.get(
                       String.valueOf(entryDN),
                       at.getNameOrOID()));

--
Gitblit v1.10.0