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/ModifyOperation.java | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/ModifyOperation.java b/opends/src/server/org/opends/server/core/ModifyOperation.java
index 75d9b59..f48d289 100644
--- a/opends/src/server/org/opends/server/core/ModifyOperation.java
+++ b/opends/src/server/org/opends/server/core/ModifyOperation.java
@@ -106,6 +106,9 @@
// The DN of the entry for the modify operation.
private DN entryDN;
+ // The current entry, before any changes are applied.
+ private Entry currentEntry;
+
// The modified entry that will be stored in the backend.
private Entry modifiedEntry;
@@ -168,6 +171,7 @@
entryDN = null;
modifications = null;
+ currentEntry = null;
modifiedEntry = null;
responseControls = new ArrayList<Control>();
cancelRequest = null;
@@ -218,6 +222,7 @@
new LDAPAttribute(m.getAttribute())));
}
+ currentEntry = null;
modifiedEntry = null;
responseControls = new ArrayList<Control>();
cancelRequest = null;
@@ -368,6 +373,22 @@
/**
+ * Retrieves the current entry before any modifications are applied. This
+ * will not be available to pre-parse plugins.
+ *
+ * @return The current entry, or <CODE>null</CODE> if it is not yet
+ * available.
+ */
+ public Entry getCurrentEntry()
+ {
+ assert debugEnter(CLASS_NAME, "getCurrentEntry");
+
+ return currentEntry;
+ }
+
+
+
+ /**
* Retrieves the modified entry that is to be written to the backend. This
* will be available to pre-operation plugins, and if such a plugin does make
* a change to this entry, then it is also necessary to add that change to
@@ -605,7 +626,6 @@
assert debugEnter(CLASS_NAME, "run");
setResultCode(ResultCode.UNDEFINED);
- Entry currentEntry = null;
// Get the plugin config manager that will be used for invoking plugins.
--
Gitblit v1.10.0