You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/12/21 15:13:11 UTC

[qpid-broker-j] 03/03: QPID-8259: [Broker-J] REST requests returning inherited context should be able to return the inherited context from SystemConfig in REST API for versions 6.1 and 7.0

This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 11f3052dcf847bed781236dda46fe0b72839fe3b
Author: Alex Rudyy <or...@apache.org>
AuthorDate: Fri Dec 21 15:04:32 2018 +0000

    QPID-8259: [Broker-J] REST requests returning inherited context should be able to return the inherited context from SystemConfig in REST API for versions 6.1 and 7.0
---
 .../plugin/controller/v6_1/category/BrokerController.java | 15 ++++++++++++++-
 .../v6_1/category/LegacyCategoryControllerFactory.java    |  1 +
 .../controller/v7_0/category/ContainerController.java     | 14 ++++++++++++++
 .../v7_0/category/LegacyCategoryControllerFactory.java    |  2 +-
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/BrokerController.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/BrokerController.java
index 28005df..5cdc76a 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/BrokerController.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/BrokerController.java
@@ -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);
+        }
     }
 }
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/LegacyCategoryControllerFactory.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/LegacyCategoryControllerFactory.java
index 9f49dab..5878851 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/LegacyCategoryControllerFactory.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v6_1/category/LegacyCategoryControllerFactory.java
@@ -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,
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
index 44a34e5..0c39f8f 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
@@ -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);
+        }
     }
 }
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
index 3f07cc3..92373b9 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
@@ -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>()
             {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org