From 44811bc0ac80b3decf81e72f0da0f05f5efdf979 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 14 Sep 2007 09:00:57 +0000
Subject: [PATCH] Fix bug in aggregation property change listener call-back which was incorrectly failing when any property was modified, not just when the "disabled" property was modified.

---
 opendj-sdk/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java b/opendj-sdk/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
index 62a7b38..2c7f1d0 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -321,8 +321,18 @@
      * {@inheritDoc}
      */
     public ConfigChangeResult applyConfigurationChange(S configuration) {
-      throw new IllegalStateException("Attempting to disable a referenced "
-          + configuration.definition().getUserFriendlyName());
+      PropertyProvider provider = configuration.properties();
+      Collection<Boolean> values = provider
+          .getPropertyValues(getTargetEnabledPropertyDefinition());
+      if (values.iterator().next() == false) {
+        // This should not happen - the
+        // isConfigurationChangeAcceptable() call-back should have
+        // trapped this.
+        throw new IllegalStateException("Attempting to disable a referenced "
+            + configuration.definition().getUserFriendlyName());
+      } else {
+        return new ConfigChangeResult(ResultCode.SUCCESS, false);
+      }
     }
 
 
@@ -383,6 +393,9 @@
      * {@inheritDoc}
      */
     public ConfigChangeResult applyConfigurationDelete(S configuration) {
+      // This should not happen - the
+      // isConfigurationDeleteAcceptable() call-back should have
+      // trapped this.
       if (configuration.dn().equals(dn)) {
         throw new IllegalStateException("Attempting to delete a referenced "
             + configuration.definition().getUserFriendlyName());

--
Gitblit v1.10.0