summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/management-http/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/broker-plugins/management-http/src/main')
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
index 2947cfb85b..01dd873aa5 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
+++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
@@ -24,6 +24,7 @@ import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -101,9 +102,24 @@ public class MetaDataServlet extends AbstractServlet
Map<String,Object> typeDetails = new LinkedHashMap<>();
typeDetails.put("attributes", processAttributes(type));
typeDetails.put("managedInterfaces", getManagedInterfaces(type));
+ typeDetails.put("validChildTypes", getValidChildTypes(type));
return typeDetails;
}
+ private Map<String, Collection<String>> getValidChildTypes(final Class<? extends ConfiguredObject> type)
+ {
+ Map<String, Collection<String>> validChildTypes = new HashMap<>();
+ for(Class<? extends ConfiguredObject> childType : _instance.getChildTypes(ConfiguredObjectTypeRegistry.getCategory(type)))
+ {
+ Collection<String> validValues = _instance.getTypeRegistry().getValidChildTypes(type, childType);
+ if(validValues != null)
+ {
+ validChildTypes.put(childType.getSimpleName(), validValues);
+ }
+ }
+ return validChildTypes;
+ }
+
private Set<String> getManagedInterfaces(Class<? extends ConfiguredObject> type)
{
Set<String> interfaces = new HashSet<>();