diff options
| author | Keith Wall <kwall@apache.org> | 2014-12-27 08:55:28 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-12-27 08:55:28 +0000 |
| commit | f8f58ec7e1e5517ff0a3ecc25248fa636b67a393 (patch) | |
| tree | c294063b6f6b7f1418f7032d49330ead40f6ad00 /qpid/java/broker-plugins/management-http/src/main | |
| parent | ef98f2d05fabd0cf8dceb5f02394be00345bf30c (diff) | |
| download | qpid-python-f8f58ec7e1e5517ff0a3ecc25248fa636b67a393.tar.gz | |
QPID-6289: [Java Broker] Extend Java Broker model to encapsulate permitted child types
Work of Robert Godfrey <rgodfrey@apache.org>
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1648039 13f79535-47bb-0310-9956-ffa450edef68
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.java | 16 |
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<>(); |
