From 1c9161da82b4128644d12f9df1812960ec48b395 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Tue, 15 Jun 2010 14:43:34 +0000
Subject: [PATCH] Enhance replication conflict attributes comparator, enable/disable replication domain, and some error message for diagnostic

---
 opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index 513e014..e406d54 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -2538,7 +2538,7 @@
        AttributeType attrType =
          DirectoryServer.getAttributeType(DS_SYNC_CONFLICT, true);
        Attribute attr = Attributes.create(attrType, AttributeValues.create(
-           attrType, targetDN.toString()));
+           attrType, targetDN.toNormalizedString()));
        Modification mod = new Modification(ModificationType.REPLACE, attr);
        newOp.addModification(mod);
      }
@@ -3413,7 +3413,7 @@
     AttributeType attrType = DirectoryServer.getAttributeType(DS_SYNC_CONFLICT,
         true);
     Attribute attr = Attributes.create(attrType, AttributeValues.create(
-        attrType, conflictDN.toString()));
+        attrType, conflictDN.toNormalizedString()));
     List<Modification> mods = new ArrayList<Modification>();
     Modification mod = new Modification(ModificationType.REPLACE, attr);
     mods.add(mod);
@@ -3458,14 +3458,23 @@
    */
   private void addConflict(AddMsg msg) throws ASN1Exception
   {
+    String normalizedDN;
+    try
+    {
+      normalizedDN = DN.decode(msg.getDn()).toNormalizedString();
+    } catch (DirectoryException e)
+    {
+      normalizedDN = msg.getDn();
+    }
+
     // Generate an alert to let the administrator know that some
     // conflict could not be solved.
-    Message alertMessage = NOTE_UNRESOLVED_CONFLICT.get(msg.getDn());
+    Message alertMessage = NOTE_UNRESOLVED_CONFLICT.get(normalizedDN);
     DirectoryServer.sendAlertNotification(this,
         ALERT_TYPE_REPLICATION_UNRESOLVED_CONFLICT, alertMessage);
 
     // Add the conflict attribute
-    msg.addAttribute(DS_SYNC_CONFLICT, msg.getDn());
+    msg.addAttribute(DS_SYNC_CONFLICT, normalizedDN);
   }
 
   /**

--
Gitblit v1.10.0