From a09e50d8d41c0f50c486742f4cc2343083c635e3 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Fri, 25 Jun 2010 09:25:49 +0000
Subject: [PATCH] Fixes issues #4552 #4557, making sure plugins and internal services are properly handling subtree move or delete. The changes particularly resolve problems raised by the community with the referential integrity and the isMemberOf plug-ins. Unit-tests have been updated to cover those cases

---
 opends/src/server/org/opends/server/backends/jeb/EntryContainer.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
index 8712bcb..f991b2c 100644
--- a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -1977,6 +1977,28 @@
            */
           EntryID entryID = new EntryID(data);
           DN subordinateDN = DN.decode(ByteString.wrap(key.getData()));
+
+          // Invoke any subordinate delete plugins on the entry.
+          if (!deleteOperation.isSynchronizationOperation())
+          {
+            Entry subordinateEntry = id2entry.get(
+                    txn, entryID, LockMode.DEFAULT);
+            PluginConfigManager pluginManager =
+              DirectoryServer.getPluginConfigManager();
+            PluginResult.SubordinateDelete pluginResult =
+              pluginManager.invokeSubordinateDeletePlugins(
+                  deleteOperation, subordinateEntry);
+
+            if (!pluginResult.continueProcessing())
+            {
+              Message message =
+                      ERR_JEB_DELETE_ABORTED_BY_SUBORDINATE_PLUGIN.get(
+                      subordinateDN.toString());
+              throw new DirectoryException(
+                  DirectoryServer.getServerErrorResultCode(), message);
+            }
+          }
+
           deleteEntry(txn, indexBuffer, true, entryDN, subordinateDN, entryID);
           subordinateEntriesDeleted++;
 

--
Gitblit v1.10.0