QPID-8259: [Broker-J] REST requests returning inherited context should be able to... master
authorAlex Rudyy <orudyy@apache.org>
Fri, 21 Dec 2018 15:04:32 +0000 (15:04 +0000)
committerAlex Rudyy <orudyy@apache.org>
Fri, 21 Dec 2018 15:13:02 +0000 (15:13 +0000)
broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/BrokerController.java
broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/LegacyCategoryControllerFactory.java
broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java

index 28005df..5cdc76a 100644 (file)
@@ -62,7 +62,7 @@ public class BrokerController extends LegacyCategoryController
     {
         super(legacyManagementController,
               TYPE,
-              new String[0],
+              new String[]{LegacyCategoryControllerFactory.CATEGORY_SYSTEM_CONFIG},
               "Broker",
               typeControllers);
     }
@@ -208,5 +208,18 @@ public class BrokerController extends LegacyCategoryController
         {
             return !BROKER_ATTRIBUTES_MOVED_INTO_CONTEXT.containsKey(name) && super.isOversizedAttribute(name);
         }
+
+        @Override
+        public LegacyConfiguredObject getParent(final String category)
+        {
+            if (LegacyCategoryControllerFactory.CATEGORY_SYSTEM_CONFIG.equals(category))
+            {
+                LegacyConfiguredObject nextVersionParent = getNextVersionLegacyConfiguredObject().getParent(category);
+                return new GenericLegacyConfiguredObject(getManagementController(),
+                                                         nextVersionParent,
+                                                         category);
+            }
+            return super.getParent(category);
+        }
     }
 }
index 9f49dab..5878851 100644 (file)
@@ -63,6 +63,7 @@ public class LegacyCategoryControllerFactory implements CategoryControllerFactor
     static final String CATEGORY_CONSUMER = ConsumerController.TYPE;
     static final String CATEGORY_CONNECTION = "Connection";
     static final String CATEGORY_SESSION = SessionController.TYPE;
+    static final String CATEGORY_SYSTEM_CONFIG = "SystemConfig";
     static final Set<String> SUPPORTED_CATEGORIES =
             Collections.unmodifiableSet(new HashSet<>(Arrays.asList(CATEGORY_BROKER,
                                                                     CATEGORY_BROKER_LOGGER,
index 44a34e5..0c39f8f 100644 (file)
@@ -76,5 +76,19 @@ class ContainerController extends LegacyCategoryController
             }
             return super.getActualAttribute(name);
         }
+
+        @Override
+        public LegacyConfiguredObject getParent(final String category)
+        {
+            if (LegacyCategoryControllerFactory.CATEGORY_BROKER.equals(getCategory())
+                && LegacyCategoryControllerFactory.CATEGORY_SYSTEM_CONFIG.equals(category))
+            {
+                LegacyConfiguredObject nextVersionParent = getNextVersionLegacyConfiguredObject().getParent(category);
+                return new GenericLegacyConfiguredObject(getManagementController(),
+                                                         nextVersionParent,
+                                                         category);
+            }
+            return super.getParent(category);
+        }
     }
 }
index 3f07cc3..92373b9 100644 (file)
@@ -59,7 +59,7 @@ public class LegacyCategoryControllerFactory implements CategoryControllerFactor
     private static final String CATEGORY_CONSUMER = "Consumer";
     private static final String CATEGORY_CONNECTION = "Connection";
     private static final String CATEGORY_SESSION = "Session";
-    private static final String CATEGORY_SYSTEM_CONFIG = "SystemConfig";
+    static final String CATEGORY_SYSTEM_CONFIG = "SystemConfig";
     static final Map<String, String> SUPPORTED_CATEGORIES =
             Collections.unmodifiableMap(new HashMap<String, String>()
             {