From 49f6afda44400d2ceb9125482638141e4ee6f496 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 23 Oct 2007 21:16:19 +0000
Subject: [PATCH] Fix for issue 2505 (Provide monitoring information about the number of entries on a given base DN)

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java
index bf58266..5ae217b 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java
@@ -56,6 +56,7 @@
     REPLICATED
   };
 
+  private int nEntries;
   private int missingChanges;
   private DatabaseDescriptor db;
   private int ageOfOldestMissingChange;
@@ -71,15 +72,17 @@
    * @param type the type of replication.
    * @param baseDn the base DN associated with the Replication.
    * @param db the database containing this base DN.
+   * @param nEntries the number of entries for the base DN.
    * @param ageOfOldestMissingChange the number of missing changes.
    * @param missingChanges the number of missing changes.
    */
   public BaseDNDescriptor(Type type, String baseDn, DatabaseDescriptor db,
-      int ageOfOldestMissingChange, int missingChanges)
+      int nEntries, int ageOfOldestMissingChange, int missingChanges)
   {
     this.baseDn = baseDn;
     this.db = db;
     this.type = type;
+    this.nEntries = nEntries;
     this.ageOfOldestMissingChange = ageOfOldestMissingChange;
     this.missingChanges = missingChanges;
     try
@@ -130,7 +133,7 @@
         (getMissingChanges() == desc.getMissingChanges()) &&
         getDatabase().getBackendID().equals(
             desc.getDatabase().getBackendID()) &&
-        (getDatabase().getEntries() == desc.getDatabase().getEntries());
+        (getEntries() == desc.getEntries());
       }
     }
     else
@@ -162,6 +165,14 @@
     return returnValue;
   }
 
+  /**
+   * Returns the number of entries in the database for this base DN.
+   * @return the number of entries in the database for this base DN.
+   */
+  public int getEntries()
+  {
+    return nEntries;
+  }
 
   /**
    * Returns the number of missing changes in the replication topology for
@@ -221,6 +232,15 @@
     this.db = db;
   }
 
+  /**
+   * Sets the number of entries for this base DN in this database.
+   * @param nEntries the number of entries.
+   */
+  void setEntries(int nEntries)
+  {
+    this.nEntries = nEntries;
+  }
+
   private String unescapeUtf8(String v) throws UnsupportedEncodingException
   {
     byte[] stringBytes = v.getBytes("UTF-8");

--
Gitblit v1.10.0