From 9f7e54f54e452973cd947137118321672f5ecb65 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 02 Aug 2006 06:30:27 +0000
Subject: [PATCH] Add methods to various operations in order to get the target entry (or, in the case of modify and modify DN operations, both the before and after entries). The entries will not be available for use in pre-parse plugins, and in some cases they may not be available for conflict resolution synchronization processing.

---
 opends/src/server/org/opends/server/core/ModifyDNOperation.java |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/ModifyDNOperation.java b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
index 7307842..2a91f81 100644
--- a/opends/src/server/org/opends/server/core/ModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -117,6 +117,12 @@
   // The new parent for the entry.
   private DN newSuperior;
 
+  // The current entry, before it is renamed.
+  private Entry currentEntry;
+
+  // The new entry, as it will appear after it has been renamed.
+  private Entry newEntry;
+
   // The set of response controls for this modify DN operation.
   private List<Control> responseControls;
 
@@ -188,6 +194,8 @@
     cancelRequest    = null;
     modifications    = null;
     changeNumber     = -1;
+    currentEntry     = null;
+    newEntry         = null;
   }
 
 
@@ -249,6 +257,8 @@
     cancelRequest    = null;
     modifications    = null;
     changeNumber     = -1;
+    currentEntry     = null;
+    newEntry         = null;
   }
 
 
@@ -523,6 +533,40 @@
 
 
   /**
+   * Retrieves the current entry, before it is renamed.  This will not be
+   * available to pre-parse plugins or during the conflict resolution portion of
+   * the synchronization processing.
+   *
+   * @return  The current entry, or <CODE>null</CODE> if it is not yet
+   *           available.
+   */
+  public Entry getOriginalEntry()
+  {
+    assert debugEnter(CLASS_NAME, "getOriginalEntry");
+
+    return currentEntry;
+  }
+
+
+
+  /**
+   * Retrieves the new entry, as it will appear after it is renamed.  This will
+   * not be  available to pre-parse plugins or during the conflict resolution
+   * portion of the synchronization processing.
+   *
+   * @return  The updated entry, or <CODE>null</CODE> if it is not yet
+   *           available.
+   */
+  public Entry getUpdatedEntry()
+  {
+    assert debugEnter(CLASS_NAME, "getUpdatedEntry");
+
+    return newEntry;
+  }
+
+
+
+  /**
    * Retrieves the time that processing started for this operation.
    *
    * @return  The time that processing started for this operation.
@@ -755,8 +799,6 @@
     assert debugEnter(CLASS_NAME, "run");
 
     setResultCode(ResultCode.UNDEFINED);
-    Entry currentEntry = null;
-    Entry newEntry     = null;
 
 
     // Get the plugin config manager that will be used for invoking plugins.

--
Gitblit v1.10.0