From 20396bec93ad0de9b6cefee7c7b1ad628d6ea1ae Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 18 Sep 2013 15:17:14 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB

---
 opendj-sdk/opends/src/server/org/opends/server/replication/server/MessageHandler.java |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/MessageHandler.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/MessageHandler.java
index 9df5c26..a4c73a8 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/MessageHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/MessageHandler.java
@@ -76,11 +76,11 @@
   /**
    * Local hosting RS.
    */
-  protected ReplicationServer replicationServer = null;
+  protected ReplicationServer replicationServer;
   /**
-   * Specifies the related replication server domain based on baseDn.
+   * Specifies the related replication server domain based on baseDN.
    */
-  protected ReplicationServerDomain replicationServerDomain = null;
+  protected ReplicationServerDomain replicationServerDomain;
   /**
    * Number of update sent to the server.
    */
@@ -106,9 +106,9 @@
    */
   private ServerState serverState;
   /**
-   * Specifies the baseDn of the domain.
+   * Specifies the baseDN of the domain.
    */
-  private String baseDN = null;
+  private DN baseDN;
   /**
    * Specifies whether the consumer is still active or not.
    * If not active, the handler will not return any message.
@@ -563,7 +563,7 @@
    */
   protected String getBaseDN()
   {
-    return baseDN;
+    return baseDN.toNormalizedString();
   }
 
   /**
@@ -628,21 +628,22 @@
    * @exception DirectoryException
    *              raised when a problem occurs.
    */
-  protected void setBaseDNAndDomain(String baseDN, boolean isDataServer)
-  throws DirectoryException
+  protected void setBaseDNAndDomain(DN baseDN, boolean isDataServer)
+      throws DirectoryException
   {
     if (this.baseDN != null)
     {
-      if (!this.baseDN.equalsIgnoreCase(baseDN))
+      if (!this.baseDN.equals(baseDN))
       {
-        Message message = ERR_RS_DN_DOES_NOT_MATCH.get(this.baseDN, baseDN);
+        Message message = ERR_RS_DN_DOES_NOT_MATCH.get(
+            this.baseDN.toNormalizedString(), baseDN.toNormalizedString());
         throw new DirectoryException(ResultCode.OTHER, message, null);
       }
     }
     else
     {
       this.baseDN = baseDN;
-      if (!baseDN.equalsIgnoreCase("cn=changelog"))
+      if (!baseDN.toNormalizedString().equals("cn=changelog"))
         this.replicationServerDomain = getDomain(isDataServer);
     }
   }

--
Gitblit v1.10.0