From 74be925257cd0df68cfde1a77f77cbb930c7832f Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Wed, 24 Oct 2007 14:04:25 +0000
Subject: [PATCH] Fix 2425 - dsreplication initialize-all fails - fix ConcurrentModificationException in the Initialize task by using methods that lock the entry - fix unroutable message, by forwarding message only to the replication servers that have   replica connected Miscellaneous improvements in error or debug traces

---
 opends/src/server/org/opends/server/replication/plugin/ReplLDIFOutputStream.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/plugin/ReplLDIFOutputStream.java b/opends/src/server/org/opends/server/replication/plugin/ReplLDIFOutputStream.java
index bed228e..af5f16e 100644
--- a/opends/src/server/org/opends/server/replication/plugin/ReplLDIFOutputStream.java
+++ b/opends/src/server/org/opends/server/replication/plugin/ReplLDIFOutputStream.java
@@ -45,7 +45,7 @@
   long numEntries;
 
   // The current number of entries exported
-  long numExportedEntries;
+  private long numExportedEntries;
   String entryBuffer = "";
 
   /**
@@ -92,11 +92,11 @@
         entryBuffer = entryBuffer + ebytes.substring(0, endOfEntryIndex);
 
         // Send the entry
-        if ((numEntries>0) && (numExportedEntries > numEntries))
+        if ((numEntries>0) && (getNumExportedEntries() > numEntries))
         {
           // This outputstream has reached the total number
           // of entries to export.
-          return;
+          throw(new IOException());
         }
         domain.exportLDIFEntry(entryBuffer);
         numExportedEntries++;
@@ -114,4 +114,12 @@
       }
     }
   }
+
+  /**
+   * Return the number of exported entries.
+   * @return the numExportedEntries
+   */
+  public long getNumExportedEntries() {
+    return numExportedEntries;
+  }
 }

--
Gitblit v1.10.0