From aaee394b8c7fdcb653d09d35ea1a28e574632a22 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 08 May 2007 21:29:14 +0000
Subject: [PATCH] Do not display the replication monitoring information if there are no replicated suffixes.

---
 opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java b/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java
index 3f1a296..05a1af9 100644
--- a/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java
+++ b/opendj-sdk/opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java
@@ -27,7 +27,7 @@
 
 package org.opends.statuspanel;
 
-import java.util.Set;
+import java.util.SortedSet;
 
 /**
  * This class is used to represent a Database and is aimed to be used by the
@@ -36,7 +36,7 @@
 public class DatabaseDescriptor
 {
   private String backendID;
-  private Set<BaseDNDescriptor> baseDns;
+  private SortedSet<BaseDNDescriptor> baseDns;
   private int entries;
 
   /**
@@ -45,7 +45,8 @@
    * @param baseDns the base DNs associated with the Database.
    * @param entries the number of entries in the Database.
    */
-  public DatabaseDescriptor(String backendID, Set<BaseDNDescriptor> baseDns,
+  public DatabaseDescriptor(String backendID,
+      SortedSet<BaseDNDescriptor> baseDns,
       int entries)
   {
     this.backendID = backendID;
@@ -66,7 +67,7 @@
    * Returns the Base DN objects associated with the database.
    * @return the Base DN objects associated with the database.
    */
-  public Set<BaseDNDescriptor> getBaseDns()
+  public SortedSet<BaseDNDescriptor> getBaseDns()
   {
     return baseDns;
   }
@@ -97,7 +98,7 @@
 
         if (equals)
         {
-          equals = baseDns.equals(desc.getBaseDns());
+          equals = desc.getBaseDns().equals(getBaseDns());
         }
       }
     }
@@ -116,8 +117,10 @@
     StringBuilder buf = new StringBuilder();
     for (BaseDNDescriptor rep: getBaseDns())
     {
-      buf.append(rep.getDn());
+      buf.append(rep.hashCode()+";");
     }
-    return (getBackendID() + buf.toString() + getEntries()).hashCode();
+    buf.append(getBackendID() + getEntries());
+
+    return buf.toString().hashCode();
   }
 }

--
Gitblit v1.10.0