From aaff8bbe83e02bba861c5cf1c6645dedc4e0ac1d Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 07 Aug 2007 21:45:40 +0000
Subject: [PATCH] Add support for a new type of plugin which can be used to detect changes and take some action whenever a subordinate entry is modified as a result of a modify DN operation that targets an entry that has one or more children (i.e., a subtree move or subtree rename operation). At present, subordinate modify DN plugins are not allowed to change the contents of the entry as it is being moved/renamed, but an appropriate API is in place if we decide to add this functionality in the future.
---
opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java b/opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java
index fa0c712..c71331d 100644
--- a/opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java
+++ b/opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java
@@ -41,6 +41,7 @@
import org.opends.server.types.IntermediateResponse;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.LDIFExportConfig;
+import org.opends.server.types.Modification;
import org.opends.server.types.SearchResultEntry;
import org.opends.server.types.SearchResultReference;
import org.opends.server.types.operation.*;
@@ -923,6 +924,47 @@
/**
+ * Performs any necessary processing that should be done whenever a
+ * subordinate entry is moved or renamed as part of a modify DN
+ * operation. Note that if the entry is to be changed in any way,
+ * the new entry should be directly modified, and the changes made
+ * should also be added to the provided list of modifications.
+ * <BR><BR>
+ * NOTE: At the present time, OpenDS does not provide support for
+ * altering entries subordinate to the target of a modify DN
+ * operation. While this may be available in the future, current
+ * plugins should not attempt to alter the new or old entries in any
+ * way, nor should they attempt to add any modifications to the
+ * provided list.
+ *
+ * @param modifyDNOperation The modify DN operation with which the
+ * subordinate entry is associated.
+ * @param oldEntry The subordinate entry prior to the
+ * move/rename operation.
+ * @param newEntry The subordinate enry after the
+ * move/rename operation.
+ * @param modifications A list into which any modifications
+ * made to the target entry should be
+ * placed.
+ *
+ * @return Information about the result of the plugin processing.
+ */
+ public SubordinateModifyDNPluginResult
+ processSubordinateModifyDN(SubordinateModifyDNOperation
+ modifyDNOperation,
+ Entry oldEntry, Entry newEntry,
+ List<Modification> modifications)
+ {
+ int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED;
+ String message =
+ getMessage(msgID, String.valueOf(pluginDN),
+ PluginType.SUBORDINATE_MODIFY_DN.getName());
+ throw new UnsupportedOperationException(message);
+ }
+
+
+
+ /**
* Performs any necessary processing that should be done after the
* Directory Server has completed the core processing for a modify
* DN operation but before the response has been sent to the client.
--
Gitblit v1.10.0