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/types/operation/SubordinateModifyDNOperation.java | 156 ++++++
opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java | 10
opends/src/server/org/opends/server/api/plugin/SearchReferencePluginResult.java | 19
opends/src/server/org/opends/server/api/plugin/PluginType.java | 24
opends/src/server/org/opends/server/api/plugin/SubordinateModifyDNPluginResult.java | 181 +++++++
opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java | 9
opends/tests/unit-tests-testng/resource/config-changes.ldif | 1
opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java | 161 +++++++
opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml | 208 +++++---
opends/src/server/org/opends/server/api/plugin/StartupPluginResult.java | 13
opends/src/server/org/opends/server/api/plugin/PostDisconnectPluginResult.java | 6
opends/resource/schema/02-config.ldif | 5
opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml | 6
opends/src/server/org/opends/server/api/plugin/PreOperationPluginResult.java | 33
opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java | 42 +
opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java | 20
opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java | 21
opends/src/server/org/opends/server/core/PluginConfigManager.java | 100 ++++
opends/src/server/org/opends/server/messages/PluginMessages.java | 38 +
opends/src/server/org/opends/server/api/plugin/PostOperationPluginResult.java | 11
opends/src/server/org/opends/server/backends/jeb/EntryContainer.java | 120 ++++
opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java | 48 +-
opends/src/server/org/opends/server/messages/JebMessages.java | 29 +
opends/src/server/org/opends/server/core/ModifyDNOperation.java | 4
opends/src/server/org/opends/server/api/plugin/LDIFPluginResult.java | 10
opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java | 9
opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java | 48 ++
27 files changed, 1,124 insertions(+), 208 deletions(-)
diff --git a/opends/resource/schema/02-config.ldif b/opends/resource/schema/02-config.ldif
index 27319a6..6ddc2de 100644
--- a/opends/resource/schema/02-config.ldif
+++ b/opends/resource/schema/02-config.ldif
@@ -1557,6 +1557,10 @@
NAME 'ds-cfg-notification-sender-address'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE
X-ORIGIN 'OpenDS Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.26027.1.1.466
+ NAME 'ds-cfg-plugin-order-subordinate-modify-dn'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE
+ X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.1
NAME 'ds-cfg-access-control-handler' SUP top STRUCTURAL
MUST ( cn $ ds-cfg-acl-handler-class $ ds-cfg-acl-handler-enabled )
@@ -2161,6 +2165,7 @@
ds-cfg-plugin-order-post-response-search $
ds-cfg-plugin-order-search-result-entry $
ds-cfg-plugin-order-search-result-reference $
+ ds-cfg-plugin-order-subordinate-modify-dn $
ds-cfg-plugin-order-intermediate-response )
X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.115
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
index e876670..1194f54 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
@@ -318,6 +318,12 @@
Invoked before sending a search result reference to the client.
</adm:synopsis>
</adm:value>
+ <adm:value name="subordinatemodifydn">
+ <adm:synopsis>
+ Invoked in the course of moving or renaming an entry subordinate to
+ the target of a modify DN operation.
+ </adm:synopsis>
+ </adm:value>
<adm:value name="intermediateresponse">
<adm:synopsis>
Invoked before sending an intermediate repsonse message to the
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
index af834ca..7d2e93b 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
@@ -64,8 +64,8 @@
The value should be a comma-delimited list of plugin names (where the
plugin name is the RDN value from the plugin configuration entry DN).
The list may include at most one asterisk to indicate the position of any
- unnamed plugin (and the relative order of those unnamed plugins will be
- undefined).
+ unspecified plugin (and the relative order of those unspecified plugins
+ will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -92,8 +92,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -120,8 +120,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -148,8 +148,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -176,8 +176,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -204,8 +204,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -232,8 +232,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -260,8 +260,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -288,8 +288,8 @@
invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -316,8 +316,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -344,8 +344,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -372,8 +372,8 @@
be loaded and invoked. The value should be a comma-delimited list of
plugin names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -400,8 +400,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -428,8 +428,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -456,8 +456,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -484,8 +484,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -512,8 +512,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -540,8 +540,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -568,8 +568,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -596,8 +596,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -624,8 +624,8 @@
should be loaded and invoked. The value should be a comma-delimited list
of plugin names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -652,8 +652,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -680,8 +680,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -708,8 +708,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -736,8 +736,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -764,8 +764,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -792,8 +792,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -820,8 +820,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -848,8 +848,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -876,8 +876,8 @@
should be loaded and invoked. The value should be a comma-delimited list
of plugin names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -904,8 +904,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -932,8 +932,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -960,8 +960,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -988,8 +988,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1016,8 +1016,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1044,8 +1044,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1072,8 +1072,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1100,8 +1100,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1128,8 +1128,8 @@
should be loaded and invoked. The value should be a comma-delimited list
of plugin names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1156,8 +1156,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1184,8 +1184,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1212,8 +1212,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1240,8 +1240,8 @@
and invoked. The value should be a comma-delimited list of plugin names
(where the plugin name is the RDN value from the plugin configuration
entry DN). The list may include at most one asterisk to indicate the
- position of any unnamed plugin (and the relative order of those unnamed
- plugins will be undefined).
+ position of any unspecified plugin (and the relative order of those
+ unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1268,8 +1268,8 @@
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
@@ -1290,14 +1290,42 @@
</adm:profile>
</adm:property>
+ <adm:property name="plugin-order-subordinate-modify-dn" mandatory="false">
+ <adm:synopsis>
+ Specifies the order in which subordinate modify DN plugins should be
+ loaded and invoked. The value should be a comma-delimited list of plugin
+ names (where the plugin name is the RDN value from the plugin
+ configuration entry DN). The list may include at most one asterisk to
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
+ </adm:synopsis>
+ <adm:default-behavior>
+ <adm:alias>
+ <adm:synopsis>
+ The order in which subordinate modify DN plugins are loaded and
+ invoked will be undefined.
+ </adm:synopsis>
+ </adm:alias>
+ </adm:default-behavior>
+ <adm:syntax>
+ <adm:string />
+ </adm:syntax>
+ <adm:profile name="ldap">
+ <ldap:attribute>
+ <ldap:oid>1.3.6.1.4.1.26027.1.1.466</ldap:oid>
+ <ldap:name>ds-cfg-plugin-order-subordinate-modify-dn</ldap:name>
+ </ldap:attribute>
+ </adm:profile>
+ </adm:property>
+
<adm:property name="plugin-order-intermediate-response" mandatory="false">
<adm:synopsis>
Specifies the order in which intermediate response plugins should be
loaded and invoked. The value should be a comma-delimited list of plugin
names (where the plugin name is the RDN value from the plugin
configuration entry DN). The list may include at most one asterisk to
- indicate the position of any unnamed plugin (and the relative order of
- those unnamed plugins will be undefined).
+ indicate the position of any unspecified plugin (and the relative order of
+ those unspecified plugins will be undefined).
</adm:synopsis>
<adm:default-behavior>
<adm:alias>
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.
diff --git a/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java b/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
index 4564159..36a660c 100644
--- a/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
@@ -113,9 +113,9 @@
* Indicates whether the intermediate response plugin terminated the
* client connection.
*
- * @return <CODE>true</CODE> if the intermediate response plugin
- * terminated the client connection, or <CODE>false</CODE>
- * if not.
+ * @return {@code true} if the intermediate response plugin
+ * terminated the client connection, or {@code false} if
+ * not.
*/
public boolean connectionTerminated()
{
@@ -128,9 +128,9 @@
* Indicates whether any further intermediate response plugins
* should be invoked for this operation.
*
- * @return <CODE>true</CODE> if any further intermediate response
+ * @return {@code true} if any further intermediate response
* plugins should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -143,9 +143,9 @@
* Indicates whether the associated intermediate response message
* should be sent to the client.
*
- * @return <CODE>true</CODE> if the associated intermediate
- * response message should be sent to the client, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if the associated intermediate response
+ * message should be sent to the client, or {@code false}
+ * if not.
*/
public boolean sendIntermediateResponse()
{
@@ -158,8 +158,8 @@
* Indicates whether processing should continue for the associated
* operation.
*
- * @return <CODE>true</CODE> if processing on the operation should
- * continue, or <CODE>false</CODE> if not.
+ * @return {@code true} if processing on the operation should
+ * continue, or {@code false} if not.
*/
public boolean continueOperation()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/LDIFPluginResult.java b/opends/src/server/org/opends/server/api/plugin/LDIFPluginResult.java
index f94972e..95d6570 100644
--- a/opends/src/server/org/opends/server/api/plugin/LDIFPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/LDIFPluginResult.java
@@ -90,9 +90,9 @@
* Indicates whether any further LDIF import/export plugins should
* be invoked for the associated entry.
*
- * @return <CODE>true</CODE> if any further LDIF import/export
- * plugins should be invoked for the associated entry, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further LDIF import/export plugins
+ * should be invoked for the associated entry, or
+ * {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -105,8 +105,8 @@
* Indicates whether the associated entry should still be
* imported/exported.
*
- * @return <CODE>true</CODE> if the associated entry should still
- * be imported/exported, or <CODE>false</CODE> if not.
+ * @return {@code true} if the associated entry should still be
+ * imported/exported, or {@code false} if not.
*/
public boolean continueEntryProcessing()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/PluginType.java b/opends/src/server/org/opends/server/api/plugin/PluginType.java
index ccf61c1..347fe67 100644
--- a/opends/src/server/org/opends/server/api/plugin/PluginType.java
+++ b/opends/src/server/org/opends/server/api/plugin/PluginType.java
@@ -394,6 +394,15 @@
/**
+ * The plugin type for plugins that are to be invoked on each
+ * subordinate entry that is moved or renamed as part of a modify DN
+ * operation.
+ */
+ SUBORDINATE_MODIFY_DN(PluginType.NAME_SUBORDINATE_MODIFY_DN),
+
+
+
+ /**
* The plugin type for plugins that are to be invoked before each
* intermediate response message is sent to a client.
*/
@@ -745,6 +754,14 @@
/**
+ * The name that will be used for subordinate modify DN plugins.
+ */
+ private static final String NAME_SUBORDINATE_MODIFY_DN =
+ "subordinatemodifydn";
+
+
+
+ /**
* The name that will be used for intermediate response plugins.
*/
private static final String NAME_INTERMEDIATE_RESPONSE =
@@ -757,7 +774,7 @@
* types.
*/
private static final Set<String> PLUGIN_TYPE_NAMES =
- new HashSet<String>(45);
+ new HashSet<String>(46);
@@ -766,7 +783,7 @@
* corresponding plugin type.
*/
private static final Map<String,PluginType> PLUGIN_TYPE_MAP =
- new HashMap<String,PluginType>(45);
+ new HashMap<String,PluginType>(46);
@@ -816,6 +833,7 @@
PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_SEARCH);
PLUGIN_TYPE_NAMES.add(PluginType.NAME_SEARCH_ENTRY);
PLUGIN_TYPE_NAMES.add(PluginType.NAME_SEARCH_REFERENCE);
+ PLUGIN_TYPE_NAMES.add(PluginType.NAME_SUBORDINATE_MODIFY_DN);
PLUGIN_TYPE_NAMES.add(PluginType.NAME_INTERMEDIATE_RESPONSE);
PLUGIN_TYPE_MAP.put(PluginType.NAME_STARTUP, PluginType.STARTUP);
@@ -905,6 +923,8 @@
PluginType.SEARCH_RESULT_ENTRY);
PLUGIN_TYPE_MAP.put(PluginType.NAME_SEARCH_REFERENCE,
PluginType.SEARCH_RESULT_REFERENCE);
+ PLUGIN_TYPE_MAP.put(PluginType.NAME_SUBORDINATE_MODIFY_DN,
+ PluginType.SUBORDINATE_MODIFY_DN);
PLUGIN_TYPE_MAP.put(PluginType.NAME_INTERMEDIATE_RESPONSE,
PluginType.INTERMEDIATE_RESPONSE);
}
diff --git a/opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java b/opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java
index 9944c21..b38102d 100644
--- a/opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java
@@ -90,8 +90,8 @@
* Indicates whether the post-connect plugin terminated the client
* connection.
*
- * @return <CODE>true</CODE> if the post-connect plugin terminated
- * the client connection, or <CODE>false</CODE> if not.
+ * @return {@code true} if the post-connect plugin terminated the
+ * client connection, or {@code false} if not.
*/
public boolean connectionTerminated()
{
@@ -104,9 +104,8 @@
* Indicates whether any further post-connect plugins should be
* invoked for this connection.
*
- * @return <CODE>true</CODE> if any further post-connect plugins
- * should be invoked for this connection, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further post-connect plugins should
+ * be invoked for this connection, or {@code false} if not.
*/
public boolean continuePluginProcessing()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/PostDisconnectPluginResult.java b/opends/src/server/org/opends/server/api/plugin/PostDisconnectPluginResult.java
index 05cb867..04dc21f 100644
--- a/opends/src/server/org/opends/server/api/plugin/PostDisconnectPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PostDisconnectPluginResult.java
@@ -80,9 +80,9 @@
* Indicates whether any further post-disconnect plugins should be
* invoked for this connection.
*
- * @return <CODE>true</CODE> if any further post-disconnect plugins
- * should be invoked for this connection, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further post-disconnect plugins
+ * should be invoked for this connection, or {@code false}
+ * if not.
*/
public boolean continuePluginProcessing()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/PostOperationPluginResult.java b/opends/src/server/org/opends/server/api/plugin/PostOperationPluginResult.java
index 465011e..1564220 100644
--- a/opends/src/server/org/opends/server/api/plugin/PostOperationPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PostOperationPluginResult.java
@@ -91,9 +91,8 @@
* Indicates whether the post-operation plugin terminated the client
* connection.
*
- * @return <CODE>true</CODE> if the post-operation plugin
- * terminated the client connection, or <CODE>false</CODE>
- * if not.
+ * @return {@code true} if the post-operation plugin terminated the
+ * client connection, or {@code false} if not.
*/
public boolean connectionTerminated()
{
@@ -106,9 +105,9 @@
* Indicates whether any further post-operation plugins should be
* invoked for this operation.
*
- * @return <CODE>true</CODE> if any further post-operation plugins
- * should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further post-operation plugins
+ * should be invoked for this operation, or {@code false}
+ * if not.
*/
public boolean continuePluginProcessing()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java b/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
index f824e71..f8d669b 100644
--- a/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
@@ -90,9 +90,8 @@
* Indicates whether any further post-response plugins should be
* invoked for this operation.
*
- * @return <CODE>true</CODE> if any further post-response plugins
- * should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further post-response plugins should
+ * be invoked for this operation, or {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -105,8 +104,8 @@
* Indicates whether the post-response plugin terminated the client
* connection.
*
- * @return <CODE>true</CODE> if the post-response plugin terminated
- * the client connection, or <CODE>false</CODE> if not.
+ * @return {@code true} if the post-response plugin terminated the
+ * client connection, or {@code false} if not.
*/
public boolean connectionTerminated()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/PreOperationPluginResult.java b/opends/src/server/org/opends/server/api/plugin/PreOperationPluginResult.java
index 628e325..99af89a 100644
--- a/opends/src/server/org/opends/server/api/plugin/PreOperationPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PreOperationPluginResult.java
@@ -81,7 +81,7 @@
* information.
*
* @param connectionTerminated Indicates whether the
- * post-response plugin terminated
+ * pre-operation plugin terminated
* the client connection.
* @param continuePluginProcessing Indicates whether any further
* pre-operation plugins should be
@@ -107,7 +107,7 @@
* information.
*
* @param connectionTerminated Indicates whether the
- * post-response plugin terminated
+ * pre-operation plugin terminated
* the client connection.
* @param continuePluginProcessing Indicates whether any further
* pre-operation plugins should be
@@ -139,11 +139,11 @@
/**
- * Indicates whether the post-response plugin terminated the client
+ * Indicates whether the pre-operation plugin terminated the client
* connection.
*
- * @return <CODE>true</CODE> if the post-response plugin terminated
- * the client connection, or <CODE>false</CODE> if not.
+ * @return {@code true} if the pre-operation plugin terminated the
+ * client connection, or {@code false} if not.
*/
public boolean connectionTerminated()
{
@@ -153,12 +153,11 @@
/**
- * Indicates whether any further post-response plugins should be
+ * Indicates whether any further pre-operation plugins should be
* invoked for this operation.
*
- * @return <CODE>true</CODE> if any further post-response plugins
- * should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further pre-operation plugins should
+ * be invoked for this operation, or {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -172,10 +171,10 @@
* plugin to the client immediately with no further processing on
* the operation.
*
- * @return <CODE>true</CODE> if the server should send the response
- * set by this plugin to the client immediately, or
- * <CODE>false</CODE> if further processing should be
- * performed on the operation.
+ * @return {@code true} if the server should send the response set
+ * by this plugin to the client immediately, or
+ * {@code false} if further processing should be performed
+ * on the operation.
*/
public boolean sendResponseImmediately()
{
@@ -201,10 +200,10 @@
/**
- * Retrieves a string representation of this post-response plugin
+ * Retrieves a string representation of this pre-operation plugin
* result.
*
- * @return A string representation of this post-response plugin
+ * @return A string representation of this pre-operation plugin
* result.
*/
public String toString()
@@ -217,7 +216,7 @@
/**
- * Appends a string representation of this post-response plugin
+ * Appends a string representation of this pre-operation plugin
* result to the provided buffer.
*
* @param buffer The buffer to which the information should be
@@ -225,7 +224,7 @@
*/
public void toString(StringBuilder buffer)
{
- buffer.append("PostResponsePluginResult(connectionTerminated=");
+ buffer.append("PreOperationPluginResult(connectionTerminated=");
buffer.append(connectionTerminated);
buffer.append(", continuePluginProcessing=");
buffer.append(continuePluginProcessing);
diff --git a/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java b/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
index 449720c..251dbb2 100644
--- a/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
@@ -47,7 +47,7 @@
// invoked for this operation.
private final boolean continuePluginProcessing;
- // Indicates whether the pre-operation plugin terminated the client
+ // Indicates whether the pre-parse plugin terminated the client
// connection.
private final boolean connectionTerminated;
@@ -77,14 +77,14 @@
/**
- * Creates a new pre-operation plugin result with the provided
+ * Creates a new pre-parse plugin result with the provided
* information.
*
* @param connectionTerminated Indicates whether the
- * post-response plugin terminated
+ * pre-parse plugin terminated
* the client connection.
* @param continuePluginProcessing Indicates whether any further
- * pre-operation plugins should be
+ * pre-parse plugins should be
* invoked for this operation.
* @param sendResponseImmediately Indicates whether the server
* should send the response set by
@@ -103,14 +103,14 @@
/**
- * Creates a new pre-operation plugin result with the provided
+ * Creates a new pre-parse plugin result with the provided
* information.
*
* @param connectionTerminated Indicates whether the
- * post-response plugin terminated
+ * pre-parse plugin terminated
* the client connection.
* @param continuePluginProcessing Indicates whether any further
- * pre-operation plugins should be
+ * pre-parse plugins should be
* invoked for this operation.
* @param sendResponseImmediately Indicates whether the server
* should send the response set by
@@ -139,11 +139,11 @@
/**
- * Indicates whether the post-response plugin terminated the client
+ * Indicates whether the pre-parse plugin terminated the client
* connection.
*
- * @return <CODE>true</CODE> if the post-response plugin terminated
- * the client connection, or <CODE>false</CODE> if not.
+ * @return {@code true} if the pre-parse plugin terminated the
+ * client connection, or {@code false} if not.
*/
public boolean connectionTerminated()
{
@@ -153,12 +153,11 @@
/**
- * Indicates whether any further post-response plugins should be
- * invoked for this operation.
+ * Indicates whether any further pre-parse plugins should be invoked
+ * for this operation.
*
- * @return <CODE>true</CODE> if any further post-response plugins
- * should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further pre-parse plugins should be
+ * invoked for this operation, or {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -172,10 +171,10 @@
* plugin to the client immediately with no further processing on
* the operation.
*
- * @return <CODE>true</CODE> if the server should send the response
- * set by this plugin to the client immediately, or
- * <CODE>false</CODE> if further processing should be
- * performed on the operation.
+ * @return {@code true} if the server should send the response set
+ * by this plugin to the client immediately, or
+ * {@code false} if further processing should be performed
+ * on the operation.
*/
public boolean sendResponseImmediately()
{
@@ -201,11 +200,10 @@
/**
- * Retrieves a string representation of this post-response plugin
+ * Retrieves a string representation of this pre-parse plugin
* result.
*
- * @return A string representation of this post-response plugin
- * result.
+ * @return A string representation of this pre-parse plugin result.
*/
public String toString()
{
@@ -217,15 +215,15 @@
/**
- * Appends a string representation of this post-response plugin
- * result to the provided buffer.
+ * Appends a string representation of this pre-parse plugin result
+ * to the provided buffer.
*
* @param buffer The buffer to which the information should be
* appended.
*/
public void toString(StringBuilder buffer)
{
- buffer.append("PostResponsePluginResult(connectionTerminated=");
+ buffer.append("PreParsePluginResult(connectionTerminated=");
buffer.append(connectionTerminated);
buffer.append(", continuePluginProcessing=");
buffer.append(continuePluginProcessing);
diff --git a/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java b/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
index 93a2666..231c024 100644
--- a/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
@@ -108,9 +108,9 @@
* Indicates whether the search result entry plugin terminated the
* client connection.
*
- * @return <CODE>true</CODE> if the search result entry plugin
- * terminated the client connection, or <CODE>false</CODE>
- * if not.
+ * @return {@code true} if the search result entry plugin
+ * terminated the client connection, or {@code false} if
+ * not.
*/
public boolean connectionTerminated()
{
@@ -123,9 +123,9 @@
* Indicates whether any further search result entry plugins should
* be invoked for this operation.
*
- * @return <CODE>true</CODE> if any further search result entry
- * plugins should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if any further search result entry plugins
+ * should be invoked for this operation, or {@code false}
+ * if not.
*/
public boolean continuePluginProcessing()
{
@@ -138,9 +138,8 @@
* Indicates whether the associated search result entry should be
* sent to the client.
*
- * @return <CODE>true</CODE> if the associated search result entry
- * should be sent to the client, or <CODE>false</CODE> if
- * not.
+ * @return {@code true} if the associated search result entry
+ * should be sent to the client, or {@code false} if not.
*/
public boolean sendEntry()
{
@@ -154,8 +153,8 @@
* search operation (i.e., if it should continue looking for more
* matching entries).
*
- * @return <CODE>true</CODE> if processing on the search operation
- * should continue, or <CODE>false</CODE> if not.
+ * @return {@code true} if processing on the search operation
+ * should continue, or {@code false} if not.
*/
public boolean continueSearch()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/SearchReferencePluginResult.java b/opends/src/server/org/opends/server/api/plugin/SearchReferencePluginResult.java
index 7fb2349..ff49d40 100644
--- a/opends/src/server/org/opends/server/api/plugin/SearchReferencePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/SearchReferencePluginResult.java
@@ -109,9 +109,9 @@
* Indicates whether the search result reference plugin terminated
* the client connection.
*
- * @return <CODE>true</CODE> if the search result reference plugin
- * terminated the client connection, or <CODE>false</CODE>
- * if not.
+ * @return {@code true} if the search result reference plugin
+ * terminated the client connection, or {@code false} if
+ * not.
*/
public boolean connectionTerminated()
{
@@ -124,9 +124,9 @@
* Indicates whether any further search result reference plugins
* should be invoked for this operation.
*
- * @return <CODE>true</CODE> if any further search result reference
+ * @return {@code true} if any further search result reference
* plugins should be invoked for this operation, or
- * <CODE>false</CODE> if not.
+ * {@code false} if not.
*/
public boolean continuePluginProcessing()
{
@@ -139,9 +139,8 @@
* Indicates whether the associated search result reference should
* be sent to the client.
*
- * @return <CODE>true</CODE> if the associated search result
- * reference should be sent to the client, or
- * <CODE>false</CODE> if not.
+ * @return {@code true} if the associated search result reference
+ * should be sent to the client, or {@code false} if not.
*/
public boolean sendReference()
{
@@ -155,8 +154,8 @@
* search operation (i.e., if it should continue looking for more
* matching entries).
*
- * @return <CODE>true</CODE> if processing on the search operation
- * should continue, or <CODE>false</CODE> if not.
+ * @return {@code true} if processing on the search operation
+ * continue, or {@code false} if not.
*/
public boolean continueSearch()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/StartupPluginResult.java b/opends/src/server/org/opends/server/api/plugin/StartupPluginResult.java
index 477a7eb..842be70 100644
--- a/opends/src/server/org/opends/server/api/plugin/StartupPluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/StartupPluginResult.java
@@ -107,8 +107,8 @@
* Indicates whether the startup plugin completed its processing
* successfully.
*
- * @return <CODE>true</CODE> if the startup plugin completed its
- * processing successfully, or <CODE>false</CODE> if not.
+ * @return {@code true} if the startup plugin completed its
+ * processing successfully, or {@code false} if not.
*/
public boolean completedSuccessfully()
{
@@ -121,9 +121,8 @@
* Indicates whether the Directory Server should continue with its
* startup process.
*
- * @return <CODE>true</CODE> if the Directory Server should
- * continue with its startup process, or <CODE>false</CODE>
- * if not.
+ * @return {@code true} if the Directory Server should continue
+ * with its startup process, or {@code false} if not.
*/
public boolean continueStartup()
{
@@ -151,8 +150,8 @@
* startup plugin.
*
* @return The human-readable error message generated by the
- * startup plugin, or <CODE>null</CODE> if there is no
- * error message.
+ * startup plugin, or {@code null} if there is no error
+ * message.
*/
public String getErrorMessage()
{
diff --git a/opends/src/server/org/opends/server/api/plugin/SubordinateModifyDNPluginResult.java b/opends/src/server/org/opends/server/api/plugin/SubordinateModifyDNPluginResult.java
new file mode 100644
index 0000000..55604aa
--- /dev/null
+++ b/opends/src/server/org/opends/server/api/plugin/SubordinateModifyDNPluginResult.java
@@ -0,0 +1,181 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Portions Copyright 2007 Sun Microsystems, Inc.
+ */
+package org.opends.server.api.plugin;
+
+
+
+/**
+ * This class defines a data structure that holds information about
+ * the result of processing by a subordinate modify DN plugin.
+ */
+public class SubordinateModifyDNPluginResult
+{
+ /**
+ * A pre-operation plugin result instance that indicates all
+ * processing was successful.
+ */
+ public static final SubordinateModifyDNPluginResult SUCCESS =
+ new SubordinateModifyDNPluginResult();
+
+
+
+ // Indicates whether to abort the modify DN operation without making
+ // any changes.
+ private final boolean abortModifyDNOperation;
+
+ // Indicates whether any further subordinate modify DN plugins
+ // should be invoked for this operation.
+ private final boolean continuePluginProcessing;
+
+ // Indicates whether the subordinate modify DN plugin terminated the
+ // client connection.
+ private final boolean connectionTerminated;
+
+
+
+ /**
+ * Creates a new subordinate modify DN plugin result with the
+ * default settings. In this case, it will indicate that the
+ * connection has not been terminated, that further subordinate
+ * modify DN processing should continue, and that the modify DN
+ * operation should not be aborted.
+ */
+ private SubordinateModifyDNPluginResult()
+ {
+ this(false, true, false);
+ }
+
+
+
+ /**
+ * Creates a new subordinate modify DN plugin result with the
+ * provided information.
+ *
+ * @param connectionTerminated Indicates whether the
+ * subordinate modify DN plugin
+ * terminated the client
+ * connection.
+ * @param continuePluginProcessing Indicates whether any further
+ * subordinate modify DN plugins
+ * should be invoked for this
+ * operation.
+ * @param abortModifyDNOperation Indicates whether the modify DN
+ * operation should be aborted and
+ * all associated changes
+ * discarded.
+ */
+ public SubordinateModifyDNPluginResult(boolean connectionTerminated,
+ boolean continuePluginProcessing,
+ boolean abortModifyDNOperation)
+ {
+ this.connectionTerminated = connectionTerminated;
+ this.continuePluginProcessing = continuePluginProcessing;
+ this.abortModifyDNOperation = abortModifyDNOperation;
+ }
+
+
+
+ /**
+ * Indicates whether the subordinate modify DN plugin terminated the
+ * client connection.
+ *
+ * @return {@code true} if the subordinate modify DN plugin
+ * terminated the client connection, or {@code false} if
+ * not.
+ */
+ public boolean connectionTerminated()
+ {
+ return connectionTerminated;
+ }
+
+
+
+ /**
+ * Indicates whether any further subordinate modify DN plugins
+ * should be invoked for this operation.
+ *
+ * @return {@code true} if any further subordinate modify DN
+ * plugins should be invoked for this operation, or
+ * {@code false} if not.
+ */
+ public boolean continuePluginProcessing()
+ {
+ return continuePluginProcessing;
+ }
+
+
+
+ /**
+ * Indicates whether the modify DN operation should be aborted and
+ * all associated changes discarded.
+ *
+ * @return {@code true} if the modify DN operation should be
+ * aborted, or {@code false} if not.
+ */
+ public boolean abortModifyDNOperation()
+ {
+ return abortModifyDNOperation;
+ }
+
+
+
+ /**
+ * Retrieves a string representation of this post-response plugin
+ * result.
+ *
+ * @return A string representation of this post-response plugin
+ * result.
+ */
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ toString(buffer);
+ return buffer.toString();
+ }
+
+
+
+ /**
+ * Appends a string representation of this subordinate modify DN
+ * plugin result to the provided buffer.
+ *
+ * @param buffer The buffer to which the information should be
+ * appended.
+ */
+ public void toString(StringBuilder buffer)
+ {
+ buffer.append("SubordinateModifyDNPluginResult(");
+ buffer.append("connectionTerminated=");
+ buffer.append(connectionTerminated);
+ buffer.append(", continuePluginProcessing=");
+ buffer.append(continuePluginProcessing);
+ buffer.append(", abortModifyDNOperation=");
+ buffer.append(abortModifyDNOperation);
+ buffer.append(")");
+ }
+}
+
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 8113b85..6e9bfe8 100644
--- a/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -32,9 +32,11 @@
import org.opends.server.api.Backend;
import org.opends.server.api.EntryCache;
import org.opends.server.api.ClientConnection;
+import org.opends.server.api.plugin.SubordinateModifyDNPluginResult;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DeleteOperation;
import org.opends.server.core.DirectoryServer;
+import org.opends.server.core.PluginConfigManager;
import org.opends.server.core.ModifyOperation;
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.SearchOperation;
@@ -3391,14 +3393,64 @@
}
- // Change the entry DN.
- oldEntry.setDN(newDN);
+
+ // Create a new entry that is a copy of the old entry but with the new DN.
+ // Also invoke any subordinate modify DN plugins on the entry.
+ // FIXME -- At the present time, we don't support subordinate modify DN
+ // plugins that make changes to subordinate entries and therefore
+ // provide an unmodifiable list for the modifications element.
+ // FIXME -- This will need to be updated appropriately if we decided that
+ // these plugins should be invoked for synchronization
+ // operations.
+ Entry newEntry = oldEntry.duplicate(false);
+ newEntry.setDN(newDN);
+
+ if (! modifyDNOperation.isSynchronizationOperation())
+ {
+ PluginConfigManager pluginManager =
+ DirectoryServer.getPluginConfigManager();
+ List<Modification> modifications =
+ Collections.unmodifiableList(new ArrayList<Modification>(0));
+ SubordinateModifyDNPluginResult pluginResult =
+ pluginManager.invokeSubordinateModifyDNPlugins(
+ modifyDNOperation, oldEntry, newEntry, modifications);
+
+ if (pluginResult.connectionTerminated() ||
+ pluginResult.abortModifyDNOperation())
+ {
+ int msgID = MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_PLUGIN;
+ String message = getMessage(msgID, oldDN.toString(),
+ newDN.toString());
+ throw new DirectoryException(
+ DirectoryServer.getServerErrorResultCode(), message,
+ msgID);
+ }
+
+ if (! modifications.isEmpty())
+ {
+ indexModifications(txn, oldEntry, newEntry, newID, modifications);
+
+ StringBuilder invalidReason = new StringBuilder();
+ if (! newEntry.conformsToSchema(null, false, false, false,
+ invalidReason))
+ {
+ int msgID = MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_SCHEMA_ERROR;
+ String message = getMessage(msgID, oldDN.toString(),
+ newDN.toString(),
+ invalidReason.toString());
+ throw new DirectoryException(
+ DirectoryServer.getServerErrorResultCode(), message,
+ msgID);
+ }
+ }
+ }
+
// Add any referral records for the new DN.
- dn2uri.addEntry(txn, oldEntry);
+ dn2uri.addEntry(txn, newEntry);
// Put the new entry (old entry with new DN) in id2entry.
- id2entry.put(txn, newID, oldEntry);
+ id2entry.put(txn, newID, newEntry);
if (!newID.equals(oldID))
{
@@ -3456,7 +3508,7 @@
*/
private void renameSubordinateEntry(Transaction txn, EntryID entryID,
Entry oldEntry, DN newDN)
- throws DirectoryException, DatabaseException
+ throws DirectoryException, JebException, DatabaseException
{
DN oldDN = oldEntry.getDN();
@@ -3475,14 +3527,64 @@
// Delete any existing referral records for the old DN.
dn2uri.deleteEntry(txn, oldEntry);
- // Change the entry DN.
- oldEntry.setDN(newDN);
+
+ // Create a new entry that is a copy of the old entry but with the new DN.
+ // Also invoke any subordinate modify DN plugins on the entry.
+ // FIXME -- At the present time, we don't support subordinate modify DN
+ // plugins that make changes to subordinate entries and therefore
+ // provide an unmodifiable list for the modifications element.
+ // FIXME -- This will need to be updated appropriately if we decided that
+ // these plugins should be invoked for synchronization
+ // operations.
+ Entry newEntry = oldEntry.duplicate(false);
+ newEntry.setDN(newDN);
+
+ if (! modifyDNOperation.isSynchronizationOperation())
+ {
+ PluginConfigManager pluginManager =
+ DirectoryServer.getPluginConfigManager();
+ List<Modification> modifications =
+ Collections.unmodifiableList(new ArrayList<Modification>(0));
+ SubordinateModifyDNPluginResult pluginResult =
+ pluginManager.invokeSubordinateModifyDNPlugins(
+ modifyDNOperation, oldEntry, newEntry, modifications);
+
+ if (pluginResult.connectionTerminated() ||
+ pluginResult.abortModifyDNOperation())
+ {
+ int msgID = MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_PLUGIN;
+ String message = getMessage(msgID, oldDN.toString(),
+ newDN.toString());
+ throw new DirectoryException(
+ DirectoryServer.getServerErrorResultCode(),
+ message, msgID);
+ }
+
+ if (! modifications.isEmpty())
+ {
+ indexModifications(txn, oldEntry, newEntry, entryID, modifications);
+
+ StringBuilder invalidReason = new StringBuilder();
+ if (! newEntry.conformsToSchema(null, false, false, false,
+ invalidReason))
+ {
+ int msgID = MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_SCHEMA_ERROR;
+ String message = getMessage(msgID, oldDN.toString(),
+ newDN.toString(),
+ invalidReason.toString());
+ throw new DirectoryException(
+ DirectoryServer.getServerErrorResultCode(), message,
+ msgID);
+ }
+ }
+ }
+
// Add any referral records for the new DN.
- dn2uri.addEntry(txn, oldEntry);
+ dn2uri.addEntry(txn, newEntry);
// Replace the entry in id2entry.
- id2entry.put(txn, entryID, oldEntry);
+ id2entry.put(txn, entryID, newEntry);
// Remove the entry from the entry cache.
EntryCache entryCache = DirectoryServer.getEntryCache();
diff --git a/opends/src/server/org/opends/server/core/ModifyDNOperation.java b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
index d7b6e3b..fa1f0ba 100644
--- a/opends/src/server/org/opends/server/core/ModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -33,12 +33,14 @@
import org.opends.server.types.Modification;
import org.opends.server.types.Operation;
import org.opends.server.types.RDN;
+import org.opends.server.types.operation.SubordinateModifyDNOperation;
/**
* This interface defines an operation used to move an entry in
* the Directory Server.
*/
-public interface ModifyDNOperation extends Operation
+public interface ModifyDNOperation
+ extends Operation, SubordinateModifyDNOperation
{
/**
diff --git a/opends/src/server/org/opends/server/core/PluginConfigManager.java b/opends/src/server/org/opends/server/core/PluginConfigManager.java
index ab2476a..f27d52c 100644
--- a/opends/src/server/org/opends/server/core/PluginConfigManager.java
+++ b/opends/src/server/org/opends/server/core/PluginConfigManager.java
@@ -63,6 +63,7 @@
import org.opends.server.api.plugin.SearchEntryPluginResult;
import org.opends.server.api.plugin.SearchReferencePluginResult;
import org.opends.server.api.plugin.StartupPluginResult;
+import org.opends.server.api.plugin.SubordinateModifyDNPluginResult;
import org.opends.server.config.ConfigException;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.DisconnectReason;
@@ -80,6 +81,7 @@
import org.opends.server.types.SearchResultReference;
import org.opends.server.types.DebugLogLevel;
+import org.opends.server.types.Modification;
import org.opends.server.types.operation.PostOperationAbandonOperation;
import org.opends.server.types.operation.PostOperationAddOperation;
import org.opends.server.types.operation.PostOperationBindOperation;
@@ -118,6 +120,7 @@
import org.opends.server.types.operation.PreParseUnbindOperation;
import org.opends.server.types.operation.SearchEntrySearchOperation;
import org.opends.server.types.operation.SearchReferenceSearchOperation;
+import org.opends.server.types.operation.SubordinateModifyDNOperation;
import org.opends.server.workflowelement.localbackend.*;
import static org.opends.server.loggers.ErrorLogger.*;
@@ -192,6 +195,7 @@
private DirectoryServerPlugin[] postResponseSearchPlugins;
private DirectoryServerPlugin[] searchResultEntryPlugins;
private DirectoryServerPlugin[] searchResultReferencePlugins;
+ private DirectoryServerPlugin[] subordinateModifyDNPlugins;
private DirectoryServerPlugin[] intermediateResponsePlugins;
@@ -261,6 +265,7 @@
postResponseSearchPlugins = new DirectoryServerPlugin[0];
searchResultEntryPlugins = new DirectoryServerPlugin[0];
searchResultReferencePlugins = new DirectoryServerPlugin[0];
+ subordinateModifyDNPlugins = new DirectoryServerPlugin[0];
intermediateResponsePlugins = new DirectoryServerPlugin[0];
registeredPlugins =
new ConcurrentHashMap<DN,
@@ -313,6 +318,7 @@
for (String pluginName : pluginRootConfig.listPlugins())
{
PluginCfg pluginConfiguration = pluginRootConfig.getPlugin(pluginName);
+ pluginConfiguration.addChangeListener(this);
if (! pluginConfiguration.isEnabled())
{
@@ -336,8 +342,6 @@
continue;
}
- pluginConfiguration.addChangeListener(this);
-
try
{
DirectoryServerPlugin<? extends PluginCfg> plugin =
@@ -506,6 +510,7 @@
case POSTRESPONSESEARCH: return PluginType.POST_RESPONSE_SEARCH;
case SEARCHRESULTENTRY: return PluginType.SEARCH_RESULT_ENTRY;
case SEARCHRESULTREFERENCE: return PluginType.SEARCH_RESULT_REFERENCE;
+ case SUBORDINATEMODIFYDN: return PluginType.SUBORDINATE_MODIFY_DN;
case INTERMEDIATERESPONSE: return PluginType.INTERMEDIATE_RESPONSE;
default: return null;
}
@@ -825,6 +830,11 @@
addPlugin(searchResultReferencePlugins, plugin, t,
pluginRootConfig.getPluginOrderSearchResultReference());
break;
+ case SUBORDINATE_MODIFY_DN:
+ subordinateModifyDNPlugins =
+ addPlugin(subordinateModifyDNPlugins, plugin, t,
+ pluginRootConfig.getPluginOrderSubordinateModifyDN());
+ break;
case INTERMEDIATE_RESPONSE:
intermediateResponsePlugins =
addPlugin(intermediateResponsePlugins, plugin, t,
@@ -1248,6 +1258,10 @@
searchResultReferencePlugins =
removePlugin(searchResultReferencePlugins, plugin);
break;
+ case SUBORDINATE_MODIFY_DN:
+ subordinateModifyDNPlugins =
+ removePlugin(subordinateModifyDNPlugins, plugin);
+ break;
case INTERMEDIATE_RESPONSE:
intermediateResponsePlugins =
removePlugin(intermediateResponsePlugins, plugin);
@@ -4894,6 +4908,88 @@
/**
+ * Invokes the set of subordinate modify DN plugins that have been configured
+ * in the Directory Server.
+ *
+ * @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 The result of processing the subordinate modify DN plugins.
+ */
+ public SubordinateModifyDNPluginResult invokeSubordinateModifyDNPlugins(
+ SubordinateModifyDNOperation modifyDNOperation, Entry oldEntry,
+ Entry newEntry, List<Modification> modifications)
+ {
+ SubordinateModifyDNPluginResult result = null;
+
+ for (DirectoryServerPlugin p : subordinateModifyDNPlugins)
+ {
+ try
+ {
+ DirectoryServerPlugin<? extends PluginCfg> gp =
+ (DirectoryServerPlugin<? extends PluginCfg>) p;
+ result = gp.processSubordinateModifyDN(modifyDNOperation, oldEntry,
+ newEntry, modifications);
+ }
+ catch (Exception e)
+ {
+ if (debugEnabled())
+ {
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
+ }
+
+ int msgID = MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_EXCEPTION;
+ String message =
+ getMessage(msgID,
+ String.valueOf(p.getPluginEntryDN()),
+ modifyDNOperation.getConnectionID(),
+ modifyDNOperation.getOperationID(),
+ stackTraceToSingleLineString(e));
+ logError(ErrorLogCategory.PLUGIN, ErrorLogSeverity.SEVERE_ERROR,
+ message, msgID);
+
+ return new SubordinateModifyDNPluginResult(false, false, true);
+ }
+
+ if (result == null)
+ {
+ int msgID = MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_RETURNED_NULL;
+ String message =
+ getMessage(msgID,
+ String.valueOf(p.getPluginEntryDN()),
+ modifyDNOperation.getConnectionID(),
+ modifyDNOperation.getOperationID());
+ logError(ErrorLogCategory.PLUGIN, ErrorLogSeverity.SEVERE_ERROR,
+ message, msgID);
+
+ return new SubordinateModifyDNPluginResult(false, false, true);
+ }
+ else if (result.connectionTerminated() ||
+ (! result.continuePluginProcessing()))
+ {
+ return result;
+ }
+ }
+
+ if (result == null)
+ {
+ // This should only happen if there were no subordinate modify DN plugins
+ // registered, which is fine.
+ result = SubordinateModifyDNPluginResult.SUCCESS;
+ }
+
+ return result;
+ }
+
+
+
+ /**
* Invokes the set of intermediate response plugins that have been configured
* in the Directory Server.
*
diff --git a/opends/src/server/org/opends/server/messages/JebMessages.java b/opends/src/server/org/opends/server/messages/JebMessages.java
index 008a97e..cfd3c89 100644
--- a/opends/src/server/org/opends/server/messages/JebMessages.java
+++ b/opends/src/server/org/opends/server/messages/JebMessages.java
@@ -1262,6 +1262,27 @@
CATEGORY_MASK_JEB | SEVERITY_MASK_MILD_ERROR | 162;
/**
+ * The message ID for the message that is used to indicate that the modify DN
+ * operation has been aborted by a subordinate modify DN plugin. This takes
+ * two arguments, which are the old DN and new DN for the subordinate entry
+ * that caused the operation to be aborted.
+ */
+ public static final int MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_PLUGIN =
+ CATEGORY_MASK_JEB | SEVERITY_MASK_MILD_ERROR | 163;
+
+ /**
+ * The message ID for the message that is used to indicate that the modify DN
+ * operation has been aborted because subordinate modify DN plugin has altered
+ * an entry in a manner than violates the server schema. This takes three
+ * arguments, which are the old DN and new DN for the subordinate entry that
+ * caused the operation to be aborted, and a message explaining the schema
+ * violation.
+ */
+ public static final int
+ MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_SCHEMA_ERROR =
+ CATEGORY_MASK_JEB | SEVERITY_MASK_MILD_ERROR | 164;
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -1396,6 +1417,14 @@
registerMessage(MSGID_JEB_MODIFYDN_ALREADY_EXISTS,
"The entry cannot be renamed to '%s' because an entry " +
"with that name already exists");
+ registerMessage(MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_PLUGIN,
+ "A plugin caused the modify DN operation to be aborted " +
+ "while moving and/or renaming an entry from %s to %s");
+ registerMessage(MSGID_JEB_MODIFYDN_ABORTED_BY_SUBORDINATE_SCHEMA_ERROR,
+ "A plugin caused the modify DN operation to be aborted " +
+ "while moving and/or renaming an entry from %s to %s " +
+ "because the change to that entry violated the server " +
+ "schema configuration: %s");
registerMessage(MSGID_JEB_NEW_SUPERIOR_NO_SUCH_OBJECT,
"The entry cannot be moved because the new parent " +
"entry '%s' does not exist");
diff --git a/opends/src/server/org/opends/server/messages/PluginMessages.java b/opends/src/server/org/opends/server/messages/PluginMessages.java
index ce1b4b0..a5acffe 100644
--- a/opends/src/server/org/opends/server/messages/PluginMessages.java
+++ b/opends/src/server/org/opends/server/messages/PluginMessages.java
@@ -852,6 +852,31 @@
/**
+ * The message ID for the message that will be used if an exception is thrown
+ * by one of the Directory Server subordinate modify DN plugins. This takes
+ * four arguments, which are the DN of the plugin configuration entry, the
+ * connection ID for the client, the operation ID for the operation, and a
+ * string representation of the exception that was caught.
+ */
+ public static final int MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_EXCEPTION =
+ CATEGORY_MASK_PLUGIN | SEVERITY_MASK_SEVERE_ERROR | 75;
+
+
+
+ /**
+ * The message ID for the message that will be used if one of the Directory
+ * Server subordinate modify DN plugins returns null rather than a valid
+ * result. This takes three arguments, which are the DN of the plugin
+ * configuration entry, the connection ID for the client connection, and the
+ * operation ID for the operation.
+ */
+ public static final int
+ MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_RETURNED_NULL =
+ CATEGORY_MASK_PLUGIN | SEVERITY_MASK_SEVERE_ERROR | 76;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -1149,6 +1174,19 @@
"search operation will be terminated");
+ registerMessage(MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_EXCEPTION,
+ "The subordinate modify DN plugin defined in " +
+ "configuration entry %s threw an exception when it was " +
+ "invoked for connection %d operation %d: %s. " +
+ "Processing on this operation will be terminated");
+ registerMessage(MSGID_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_RETURNED_NULL,
+ "The subordinate modify DN plugin defined in " +
+ "configuration entry %s returned null when invoked for " +
+ "connection %d operation %s. This is an illegal " +
+ "response, and processing on this operation will be " +
+ "terminated");
+
+
registerMessage(MSGID_PLUGIN_INTERMEDIATE_RESPONSE_PLUGIN_EXCEPTION,
"The intermediate response plugin defined in " +
"configuration entry %s threw an exception when it was " +
diff --git a/opends/src/server/org/opends/server/types/operation/SubordinateModifyDNOperation.java b/opends/src/server/org/opends/server/types/operation/SubordinateModifyDNOperation.java
new file mode 100644
index 0000000..c151ecd
--- /dev/null
+++ b/opends/src/server/org/opends/server/types/operation/SubordinateModifyDNOperation.java
@@ -0,0 +1,156 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Portions Copyright 2007 Sun Microsystems, Inc.
+ */
+package org.opends.server.types.operation;
+
+
+
+import org.opends.server.types.ByteString;
+import org.opends.server.types.DN;
+import org.opends.server.types.Entry;
+import org.opends.server.types.RDN;
+
+
+
+/**
+ * This class defines a set of methods that are available for use by
+ * subordinate modify DN operation plugins. Note that this interface
+ * is intended only to define an API for use by plugins and is not
+ * intended to be implemented by any custom classes.
+ */
+public interface SubordinateModifyDNOperation
+ extends InProgressOperation
+{
+ /**
+ * Retrieves the raw, unprocessed entry DN as included in the client
+ * request. The DN that is returned may or may not be a valid DN,
+ * since no validation will have been performed upon it.
+ *
+ * @return The raw, unprocessed entry DN as included in the client
+ * request.
+ */
+ public ByteString getRawEntryDN();
+
+
+
+ /**
+ * Retrieves the DN of the entry to rename. This should not be
+ * called by pre-parse plugins because the processed DN will not be
+ * available yet. Instead, they should call the
+ * {@code getRawEntryDN} method.
+ *
+ * @return The DN of the entry to rename, or {@code null} if the
+ * raw entry DN has not yet been processed.
+ */
+ public DN getEntryDN();
+
+
+
+ /**
+ * Retrieves the raw, unprocessed newRDN as included in the request
+ * from the client. This may or may not contain a valid RDN, as no
+ * validation will have been performed on it.
+ *
+ * @return The raw, unprocessed newRDN as included in the request
+ * from the client.
+ */
+ public ByteString getRawNewRDN();
+
+
+
+ /**
+ * Retrieves the new RDN to use for the entry. This should not be
+ * called by pre-parse plugins, because the processed newRDN will
+ * not yet be available. Pre-parse plugins should instead use the
+ * {@code getRawNewRDN} method.
+ *
+ * @return The new RDN to use for the entry, or {@code null} if the
+ * raw newRDN has not yet been processed.
+ */
+ public RDN getNewRDN();
+
+
+
+ /**
+ * Indicates whether the current RDN value should be removed from
+ * the entry.
+ *
+ * @return {@code true} if the current RDN value should be removed
+ * from the entry, or {@code false} if not.
+ */
+ public boolean deleteOldRDN();
+
+
+
+ /**
+ * Retrieves the raw, unprocessed newSuperior from the client
+ * request. This may or may not contain a valid DN, as no
+ * validation will have been performed on it.
+ *
+ * @return The raw, unprocessed newSuperior from the client
+ * request, or {@code null} if there is none.
+ */
+ public ByteString getRawNewSuperior();
+
+
+
+ /**
+ * Retrieves the newSuperior DN for the entry. This should not be
+ * called by pre-parse plugins, because the processed DN will not
+ * yet be available at that time. Instead, they should use the
+ * {@code getRawNewSuperior} method.
+ *
+ * @return The newSuperior DN for the entry, or {@code null} if
+ * there is no newSuperior DN for this request or if the
+ * raw newSuperior has not yet been processed.
+ */
+ public DN getNewSuperior();
+
+
+
+ /**
+ * 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} if it is not yet
+ * available.
+ */
+ public Entry getOriginalEntry();
+
+
+
+ /**
+ * 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} if it is not yet
+ * available.
+ */
+ public Entry getUpdatedEntry();
+}
+
diff --git a/opends/tests/unit-tests-testng/resource/config-changes.ldif b/opends/tests/unit-tests-testng/resource/config-changes.ldif
index 3a30756..d7dda3e 100644
--- a/opends/tests/unit-tests-testng/resource/config-changes.ldif
+++ b/opends/tests/unit-tests-testng/resource/config-changes.ldif
@@ -256,6 +256,7 @@
ds-cfg-plugin-type: postResponseSearch
ds-cfg-plugin-type: searchResultEntry
ds-cfg-plugin-type: searchResultReference
+ds-cfg-plugin-type: subordinateModifyDN
ds-cfg-plugin-type: intermediateResponse
ds-cfg-plugin-type: postConnect
ds-cfg-plugin-type: postDisconnect
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
index 6f76570..6724a4f 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
@@ -480,6 +480,16 @@
expectedPublicMethods.add(sigList);
sigList = new LinkedList<String>();
+ sigList.add("processSubordinateModifyDN");
+ sigList.add("org.opends.server.api.plugin.SubordinateModifyDNPluginResult");
+ sigList.add("org.opends.server.types.operation." +
+ "SubordinateModifyDNOperation");
+ sigList.add("org.opends.server.types.Entry");
+ sigList.add("org.opends.server.types.Entry");
+ sigList.add("java.util.List");
+ expectedPublicMethods.add(sigList);
+
+ sigList = new LinkedList<String>();
sigList.add("processIntermediateResponse");
sigList.add("org.opends.server.api.plugin." +
"IntermediateResponsePluginResult");
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java
index 73898f7..55fc448 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java
@@ -1298,5 +1298,166 @@
assertFalse(LDAPModify.mainModify(args, false, null, null) == 0);
}
+
+
+
+ /**
+ * Tests a subtree rename operation to ensure that subordinate modify DN
+ * plugins will be invoked as expected.
+ *
+ * @throws Exception If an unexpected problem occurs.
+ */
+ @Test()
+ public void testSubordinateModifyDNPluginsForSubtreeRename()
+ throws Exception
+ {
+ try
+ {
+ InvocationCounterPlugin.resetAllCounters();
+ TestCaseUtils.clearJEBackend(true, "userRoot", "dc=example,dc=com");
+
+ TestCaseUtils.addEntries(
+ "dn: ou=People,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: organizationalUnit",
+ "ou: People",
+ "",
+ "dn: uid=first.test,ou=People,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "uid: first.test",
+ "givenName: First",
+ "sn: Test",
+ "cn: First Test",
+ "userPassword: Password",
+ "ou: People",
+ "",
+ "dn: uid=second.test,ou=People,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "uid: second.test",
+ "givenName: Second",
+ "sn: Test",
+ "cn: Second Test",
+ "userPassword: Password");
+
+ assertTrue(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=People,dc=example,dc=com")));
+ assertFalse(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Users,dc=example,dc=com")));
+
+
+ InternalClientConnection conn =
+ InternalClientConnection.getRootConnection();
+ ModifyDNOperation modifyDNOperation =
+ conn.processModifyDN("ou=People,dc=example,dc=com", "ou=Users",
+ true);
+ assertEquals(modifyDNOperation.getResultCode(), ResultCode.SUCCESS);
+ assertEquals(InvocationCounterPlugin.getSubordinateModifyDNCount(), 2);
+
+
+ assertFalse(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=People,dc=example,dc=com")));
+ assertTrue(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Users,dc=example,dc=com")));
+ }
+ finally
+ {
+ // Other tests in this class rely on a predefined structure, so we need to
+ // make sure to put it back to the way it should be.
+ setUp();
+ InvocationCounterPlugin.resetAllCounters();
+ }
+ }
+
+
+
+ /**
+ * Tests a subtree move operation to ensure that subordinate modify DN
+ * plugins will be invoked as expected.
+ *
+ * @throws Exception If an unexpected problem occurs.
+ */
+ @Test()
+ public void testSubordinateModifyDNPluginsForSubtreeMove()
+ throws Exception
+ {
+ try
+ {
+ InvocationCounterPlugin.resetAllCounters();
+ TestCaseUtils.clearJEBackend(true, "userRoot", "dc=example,dc=com");
+
+ TestCaseUtils.addEntries(
+ "dn: ou=Org 1,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: organizationalUnit",
+ "ou: Org 1",
+ "",
+ "dn: ou=Org 2,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: organizationalUnit",
+ "ou: Org 2",
+ "",
+ "dn: ou=Org 1.1,ou=Org 1,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: organizationalUnit",
+ "ou: Org 1.1",
+ "",
+ "dn: uid=first.test,ou=Org 1.1,ou=Org 1,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "uid: first.test",
+ "givenName: First",
+ "sn: Test",
+ "cn: First Test",
+ "userPassword: Password",
+ "ou: Org 1.1",
+ "",
+ "dn: uid=second.test,ou=Org 1.1,ou=Org 1,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "uid: second.test",
+ "givenName: Second",
+ "sn: Test",
+ "cn: Second Test",
+ "userPassword: Password");
+
+ assertTrue(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Org 1.1,ou=Org 1,dc=example,dc=com")));
+ assertFalse(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Org 2.1,ou=Org 2,dc=example,dc=com")));
+
+
+ InternalClientConnection conn =
+ InternalClientConnection.getRootConnection();
+ ModifyDNOperation modifyDNOperation =
+ conn.processModifyDN("ou=Org 1.1,ou=Org 1,dc=example,dc=com",
+ "ou=Org 2.1", true,
+ "ou=Org 2,dc=example,dc=com");
+ assertEquals(modifyDNOperation.getResultCode(), ResultCode.SUCCESS);
+ assertEquals(InvocationCounterPlugin.getSubordinateModifyDNCount(), 2);
+
+
+ assertFalse(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Org 1.1,ou=Org 1,dc=example,dc=com")));
+ assertTrue(DirectoryServer.entryExists(
+ DN.decode("uid=first.test,ou=Org 2.1,ou=Org 2,dc=example,dc=com")));
+ }
+ finally
+ {
+ // Other tests in this class rely on a predefined structure, so we need to
+ // make sure to put it back to the way it should be.
+ setUp();
+ InvocationCounterPlugin.resetAllCounters();
+ }
+ }
}
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
index a2f4ce8..4308d4a 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
@@ -28,6 +28,7 @@
+import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@@ -46,11 +47,13 @@
import org.opends.server.api.plugin.SearchEntryPluginResult;
import org.opends.server.api.plugin.SearchReferencePluginResult;
import org.opends.server.api.plugin.StartupPluginResult;
+import org.opends.server.api.plugin.SubordinateModifyDNPluginResult;
import org.opends.server.types.DisconnectReason;
import org.opends.server.types.Entry;
import org.opends.server.types.IntermediateResponse;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
+import org.opends.server.types.Modification;
import org.opends.server.types.SearchResultEntry;
import org.opends.server.types.SearchResultReference;
import org.opends.server.types.operation.*;
@@ -88,6 +91,8 @@
private static AtomicInteger postResponseCounter = new AtomicInteger(0);
private static AtomicInteger searchEntryCounter = new AtomicInteger(0);
private static AtomicInteger searchReferenceCounter = new AtomicInteger(0);
+ private static AtomicInteger subordinateModifyDNCounter =
+ new AtomicInteger(0);
private static AtomicInteger intermediateResponseCounter =
new AtomicInteger(0);
private static AtomicInteger postConnectCounter = new AtomicInteger(0);
@@ -781,6 +786,48 @@
* {@inheritDoc}
*/
@Override()
+ public SubordinateModifyDNPluginResult processSubordinateModifyDN(
+ SubordinateModifyDNOperation modifyDNOperation, Entry oldEntry,
+ Entry newEntry, List<Modification> modifications)
+ {
+ subordinateModifyDNCounter.incrementAndGet();
+ return SubordinateModifyDNPluginResult.SUCCESS;
+ }
+
+
+
+
+ /**
+ * Retrieves the number of times the subordinate modify DN plugins have been
+ * called since the last reset.
+ *
+ * @return The number of times the subordinate modify DN plugins have been
+ * called since the last reset.
+ */
+ public static int getSubordinateModifyDNCount()
+ {
+ return subordinateModifyDNCounter.get();
+ }
+
+
+
+ /**
+ * Resets the subordinate modify DN plugin invocation count to zero.
+ *
+ * @return The subordinate modify DN plugin invocation count before it was
+ * reset.
+ */
+ public static int resetSubordinateModifyDNCount()
+ {
+ return subordinateModifyDNCounter.getAndSet(0);
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
public IntermediateResponsePluginResult processIntermediateResponse(
IntermediateResponse intermediateResponse)
{
@@ -986,6 +1033,7 @@
resetPostResponseCount();
resetSearchEntryCount();
resetSearchReferenceCount();
+ resetSubordinateModifyDNCount();
resetIntermediateResponseCount();
resetPostConnectCount();
resetPostDisconnectCount();
--
Gitblit v1.10.0