From a0529331739624e3197fc2d4b6fb98a82fc9883a Mon Sep 17 00:00:00 2001
From: dugan <dugan@localhost>
Date: Wed, 16 Apr 2008 21:43:18 +0000
Subject: [PATCH] Rejection of entries when doing a dsreplication initialize.Issue 3135.
---
opends/src/server/org/opends/server/backends/jeb/importLDIF/WorkThread.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/importLDIF/WorkThread.java b/opends/src/server/org/opends/server/backends/jeb/importLDIF/WorkThread.java
index 4d092a0..e600889 100644
--- a/opends/src/server/org/opends/server/backends/jeb/importLDIF/WorkThread.java
+++ b/opends/src/server/org/opends/server/backends/jeb/importLDIF/WorkThread.java
@@ -154,8 +154,6 @@
EntryID entryID;
if((entryID = processDN2ID(element, txn)) == null)
return;
- if(!processParent(element, entryID, txn))
- return;
if(!processID2Entry(element, entryID, txn))
return;
procesID2SCEntry(element, entryID, txn);
@@ -351,13 +349,12 @@
* Process entry from work element checking if it's parent exists.
*
* @param element The work element containing the entry.
- * @param entryID The entry ID to use as the key.
* @param txn A transaction.
* @return <CODE>True</CODE> If the insert succeeded.
* @throws DatabaseException If a database error occurs.
*/
private boolean
- processParent(WorkElement element, EntryID entryID, Transaction txn)
+ processParent(WorkElement element, Transaction txn)
throws DatabaseException {
Entry entry = element.getEntry();
DNContext context = element.getContext();
@@ -380,13 +377,13 @@
return false;
}
}
+ EntryID entryID = rootContainer.getNextEntryID();
ArrayList<EntryID> IDs;
if (parentDN != null && context.getParentDN() != null &&
parentDN.equals(context.getParentDN())) {
IDs = new ArrayList<EntryID>(context.getIDs());
IDs.set(0, entryID);
- }
- else {
+ } else {
EntryID nodeID;
IDs = new ArrayList<EntryID>(entryDN.getNumComponents());
IDs.add(entryID);
@@ -460,7 +457,10 @@
entryID = null;
}
} else {
- entryID = rootContainer.getNextEntryID();
+ if(!processParent(element, txn))
+ return null;
+ ArrayList IDs = (ArrayList)entry.getAttachment();
+ entryID = (EntryID)IDs.get(0);
dn2id.insert(txn, entryDN, entryID);
}
context.removePending(entryDN);
--
Gitblit v1.10.0