From 887d477fa8daf523b8411461451968d2c58274f4 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 14 Jan 2008 10:43:58 +0000
Subject: [PATCH] Partial fix for issue 2661 - public APIs must not reference private classes.

---
 opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
index 5736802..2661aa0 100644
--- a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
+++ b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -51,10 +51,10 @@
 import org.opends.server.admin.client.ManagementContext;
 import org.opends.server.admin.condition.Condition;
 import org.opends.server.admin.condition.Conditions;
-import org.opends.server.admin.server.ConfigurationChangeListener;
 import org.opends.server.admin.server.ConfigurationDeleteListener;
 import org.opends.server.admin.server.ServerConstraintHandler;
 import org.opends.server.admin.server.ServerManagedObject;
+import org.opends.server.admin.server.ServerManagedObjectChangeListener;
 import org.opends.server.admin.server.ServerManagementContext;
 import org.opends.server.admin.std.meta.RootCfgDefn;
 import org.opends.server.config.ConfigException;
@@ -250,7 +250,7 @@
    * disabled.
    */
   private class ReferentialIntegrityChangeListener implements
-      ConfigurationChangeListener<S> {
+      ServerManagedObjectChangeListener<S> {
 
     // The error message which should be returned if an attempt is
     // made to disable the referenced component.
@@ -273,8 +273,8 @@
     /**
      * {@inheritDoc}
      */
-    public ConfigChangeResult applyConfigurationChange(S configuration) {
-      ServerManagedObject<?> mo = configuration.managedObject();
+    public ConfigChangeResult applyConfigurationChange(
+        ServerManagedObject<? extends S> mo) {
       try {
         if (targetIsEnabledCondition.evaluate(mo)) {
           return new ConfigChangeResult(ResultCode.SUCCESS, false);
@@ -287,7 +287,7 @@
       // This should not happen - the previous call-back should have
       // trapped this.
       throw new IllegalStateException("Attempting to disable a referenced "
-          + configuration.definition().getUserFriendlyName());
+          + relationDefinition.getChildDefinition().getUserFriendlyName());
     }
 
 
@@ -295,11 +295,11 @@
     /**
      * {@inheritDoc}
      */
-    public boolean isConfigurationChangeAcceptable(S configuration,
+    public boolean isConfigurationChangeAcceptable(
+        ServerManagedObject<? extends S> mo,
         List<Message> unacceptableReasons) {
       // Always prevent the referenced component from being
       // disabled.
-      ServerManagedObject<?> mo = configuration.managedObject();
       try {
         if (!targetIsEnabledCondition.evaluate(mo)) {
           unacceptableReasons.add(message);
@@ -315,7 +315,7 @@
 
         Message message = ERR_REFINT_UNABLE_TO_EVALUATE_TARGET_CONDITION.get(mo
             .getManagedObjectDefinition().getUserFriendlyName(), String
-            .valueOf(configuration.dn()), StaticUtils.getExceptionMessage(e));
+            .valueOf(mo.getDN()), StaticUtils.getExceptionMessage(e));
         ErrorLogger.logError(message);
         unacceptableReasons.add(message);
         return false;
@@ -369,7 +369,7 @@
         // isConfigurationDeleteAcceptable() call-back should have
         // trapped this.
         throw new IllegalStateException("Attempting to delete a referenced "
-            + configuration.definition().getUserFriendlyName());
+            + relationDefinition.getChildDefinition().getUserFriendlyName());
       } else {
         return new ConfigChangeResult(ResultCode.SUCCESS, false);
       }

--
Gitblit v1.10.0