qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1775768 [1/2] - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/ broker-core/src/main/java/org/apache/qpid/server/configuration/store/ broker-core/src/main/java/org/apache/qpid/server/model/ br...
Date Thu, 22 Dec 2016 22:57:59 GMT
Author: rgodfrey
Date: Thu Dec 22 22:57:59 2016
New Revision: 1775768

URL: http://svn.apache.org/viewvc?rev=1775768&view=rev
Log:
QPID-6028 : Change the Model to prevent multiple parents

Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AncestorAttributeResolver.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationExtractor.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfigBootstrapModel.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecordConverter.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/AbstractAMQPConnection.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractNonConnectionAcceptingVirtualHost.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNode.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCarImpl.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestModel.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCarImpl.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/lifecycle/TestConfiguredObject.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java
    qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AbstractLogger.java
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostQueryServlet.java
    qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java Thu Dec 22 22:57:59 2016
@@ -287,14 +287,13 @@ public class BDBHAVirtualHostNodeImpl ex
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
     @Override
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes,
-            ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes)
     {
         if(childClass == VirtualHost.class)
         {
             return getObjectFactory().createAsync(childClass, attributes, this);
         }
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java Thu Dec 22 22:57:59 2016
@@ -60,9 +60,9 @@ public class StoreConfigurationChangeLis
             if(object.isDurable() && child.isDurable())
             {
                 Model model = child.getModel();
-                Collection<Class<? extends ConfiguredObject>> parentTypes =
-                        model.getParentTypes(child.getCategoryClass());
-                if(parentTypes.size() == 1 || parentTypes.iterator().next().equals(object.getCategoryClass()))
+                Class<? extends ConfiguredObject> parentType =
+                        model.getParentType(child.getCategoryClass());
+                if(parentType.equals(object.getCategoryClass()))
                 {
                     child.addChangeListener(this);
                     _store.update(true, child.asObjectRecord());

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Thu Dec 22 22:57:59 2016
@@ -2091,14 +2091,14 @@ public abstract class AbstractConfigured
             public Map<String, UUID> getParents()
             {
                 Map<String, UUID> parents = new LinkedHashMap<>();
-                for(Class<? extends ConfiguredObject> parentClass : getModel().getParentTypes(getCategoryClass()))
+                Class<? extends ConfiguredObject> parentClass = getModel().getParentType(getCategoryClass());
+
+                ConfiguredObject parent = getParent(parentClass);
+                if(parent != null)
                 {
-                    ConfiguredObject parent = getParent(parentClass);
-                    if(parent != null)
-                    {
-                        parents.put(parentClass.getSimpleName(), parent.getId());
-                    }
+                    parents.put(parentClass.getSimpleName(), parent.getId());
                 }
+
                 return parents;
             }
 
@@ -2113,24 +2113,22 @@ public abstract class AbstractConfigured
 
     @SuppressWarnings("unchecked")
     @Override
-    public <C extends ConfiguredObject> C createChild(final Class<C> childClass, final Map<String, Object> attributes,
-                                                      final ConfiguredObject... otherParents)
+    public <C extends ConfiguredObject> C createChild(final Class<C> childClass, final Map<String, Object> attributes)
     {
-        return doSync(createChildAsync(childClass, attributes, otherParents));
+        return doSync(createChildAsync(childClass, attributes));
     }
 
     @SuppressWarnings("unchecked")
     @Override
-    public <C extends ConfiguredObject> ListenableFuture<C> createChildAsync(final Class<C> childClass, final Map<String, Object> attributes,
-                                                      final ConfiguredObject... otherParents)
+    public <C extends ConfiguredObject> ListenableFuture<C> createChildAsync(final Class<C> childClass, final Map<String, Object> attributes)
     {
         return doOnConfigThread(new Task<ListenableFuture<C>, RuntimeException>()
         {
             @Override
             public ListenableFuture<C> execute()
             {
-                authoriseCreateChild(childClass, attributes, otherParents);
-                return doAfter(addChildAsync(childClass, attributes, otherParents),
+                authoriseCreateChild(childClass, attributes);
+                return doAfter(addChildAsync(childClass, attributes),
                                 new CallableWithArgument<ListenableFuture<C>, C>()
                                 {
 
@@ -2171,7 +2169,8 @@ public abstract class AbstractConfigured
     }
 
 
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                             Map<String, Object> attributes)
     {
         throw new UnsupportedOperationException();
     }
@@ -2188,15 +2187,12 @@ public abstract class AbstractConfigured
             {
                 throw new DuplicateIdException(existingWithSameId);
             }
-            if(getModel().getParentTypes(categoryClass).size() == 1)
+            ConfiguredObject<?> existingWithSameName = _childrenByName.get(categoryClass).putIfAbsent(name, child);
+            if (existingWithSameName != null)
             {
-                ConfiguredObject<?> existingWithSameName = _childrenByName.get(categoryClass).putIfAbsent(name, child);
-                if (existingWithSameName != null)
-                {
-                    throw new DuplicateNameException(existingWithSameName);
-                }
-                _childrenByName.get(categoryClass).put(name, child);
+                throw new DuplicateNameException(existingWithSameName);
             }
+            _childrenByName.get(categoryClass).put(name, child);
             _children.get(categoryClass).add(child);
             _childrenById.get(categoryClass).put(childId,child);
         }
@@ -2346,11 +2342,6 @@ public abstract class AbstractConfigured
     public final <C extends ConfiguredObject> C getChildByName(final Class<C> clazz, final String name)
     {
         Class<? extends ConfiguredObject> categoryClass = ConfiguredObjectTypeRegistry.getCategory(clazz);
-        if(getModel().getParentTypes(categoryClass).size() != 1)
-        {
-            throw new UnsupportedOperationException("Cannot use getChildByName for objects of category "
-                                                    + categoryClass.getSimpleName() + " as it has more than one parent");
-        }
         return (C) _childrenByName.get(categoryClass).get(name);
     }
 
@@ -2936,19 +2927,18 @@ public abstract class AbstractConfigured
 
     private ConfiguredObject<?> createProxyForAuthorisation(final Class<? extends ConfiguredObject> category,
                                                             final Map<String, Object> attributes,
-                                                            final ConfiguredObject<?> parent,
-                                                            final ConfiguredObject<?>... otherParents)
+                                                            final ConfiguredObject<?> parent)
     {
         return (ConfiguredObject<?>) Proxy.newProxyInstance(getClass().getClassLoader(),
                                                             new Class<?>[]{category},
                                                             new AuthorisationProxyInvocationHandler(attributes,
                                                                                                     getTypeRegistry().getAttributeTypes(category),
-                                                                                                    category, parent, otherParents));
+                                                                                                    category, parent));
     }
 
-    protected final <C extends ConfiguredObject<?>> void authoriseCreateChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents) throws AccessControlException
+    protected final <C extends ConfiguredObject<?>> void authoriseCreateChild(Class<C> childClass, Map<String, Object> attributes) throws AccessControlException
     {
-        ConfiguredObject<?> configuredObject = createProxyForAuthorisation(childClass, attributes, this, otherParents);
+        ConfiguredObject<?> configuredObject = createProxyForAuthorisation(childClass, attributes, this);
         authorise(configuredObject, null, Operation.CREATE, Collections.<String,Object>emptyMap());
     }
 
@@ -3006,22 +2996,20 @@ public abstract class AbstractConfigured
                                                         operationName, categoryClass.getSimpleName(), objectName));
                 Model model = configuredObject.getModel();
 
-                Collection<Class<? extends ConfiguredObject>> parentClasses = model.getParentTypes(categoryClass);
-                if (parentClasses != null)
+                Class<? extends ConfiguredObject> parentClass = model.getParentType(categoryClass);
+                if (parentClass != null)
                 {
                     exceptionMessage.append(" on");
-                    for (Class<? extends ConfiguredObject> parentClass : parentClasses)
+                    String objectCategory = parentClass.getSimpleName();
+                    ConfiguredObject<?> parent = configuredObject.getParent(parentClass);
+                    exceptionMessage.append(" ").append(objectCategory);
+                    if (parent != null)
                     {
-                        String objectCategory = parentClass.getSimpleName();
-                        ConfiguredObject<?> parent = configuredObject.getParent(parentClass);
-                        exceptionMessage.append(" ").append(objectCategory);
-                        if (parent != null)
-                        {
-                            exceptionMessage.append(" '")
-                                    .append(parent.getAttribute(ConfiguredObject.NAME))
-                                    .append("'");
-                        }
+                        exceptionMessage.append(" '")
+                                .append(parent.getAttribute(ConfiguredObject.NAME))
+                                .append("'");
                     }
+
                 }
                 throw new AccessControlException(exceptionMessage.toString());
             }
@@ -3414,11 +3402,11 @@ public abstract class AbstractConfigured
     static void generateInheritedContext(final Model model, final ConfiguredObject<?> object,
                                          final Map<String, String> inheritedContext)
     {
-        Collection<Class<? extends ConfiguredObject>> parents =
-                model.getParentTypes(object.getCategoryClass());
-        if(parents != null && !parents.isEmpty())
+        Class<? extends ConfiguredObject> parentClass =
+                model.getParentType(object.getCategoryClass());
+        if(parentClass != null)
         {
-            ConfiguredObject parent = object.getParent(parents.iterator().next());
+            ConfiguredObject parent = object.getParent(parentClass);
             if(parent != null)
             {
                 generateInheritedContext(model, parent, inheritedContext);
@@ -3602,21 +3590,13 @@ public abstract class AbstractConfigured
         AuthorisationProxyInvocationHandler(Map<String, Object> attributes,
                                             Map<String, ConfiguredObjectAttribute<?, ?>> attributeTypes,
                                             Class<? extends ConfiguredObject> categoryClass,
-                                            ConfiguredObject<?> parent,
-                                            ConfiguredObject<?>... parents)
+                                            ConfiguredObject<?> parent)
         {
             super(attributes, attributeTypes, null);
             _parent = parent;
             _category = categoryClass;
             _parents = new HashMap<>();
             _attributes = attributes;
-            if (parents != null)
-            {
-                for (ConfiguredObject<?> parentObject : parents)
-                {
-                    _parents.put(parentObject.getCategoryClass(), parentObject);
-                }
-            }
             _parents.put(parent.getCategoryClass(), parent);
         }
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AncestorAttributeResolver.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AncestorAttributeResolver.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AncestorAttributeResolver.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AncestorAttributeResolver.java Thu Dec 22 22:57:59 2016
@@ -152,15 +152,15 @@ public class AncestorAttributeResolver i
         }
 
 
-        Collection<Class<? extends ConfiguredObject>> parentCategories = _object.getModel().getParentTypes(objectCategory);
-        for (Class<? extends ConfiguredObject> parentCategory: parentCategories)
+        Class<? extends ConfiguredObject> parentCategory = _object.getModel().getParentType(objectCategory);
+        if(parentCategory != null)
         {
-            Class<? extends ConfiguredObject> targetCategoryClass = findAncestorCategoryBySimpleClassName(targetCategorySimpleClassName,parentCategory );
+            Class<? extends ConfiguredObject> targetCategoryClass =
+                    findAncestorCategoryBySimpleClassName(targetCategorySimpleClassName, parentCategory);
             if (targetCategoryClass != null)
             {
                 return targetCategoryClass;
             }
-
         }
 
         return null;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java Thu Dec 22 22:57:59 2016
@@ -652,7 +652,8 @@ public class BrokerImpl extends Abstract
 
     @SuppressWarnings("unchecked")
     @Override
-    public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass, final Map<String, Object> attributes, final ConfiguredObject... otherParents)
+    public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
+                                                                          final Map<String, Object> attributes)
     {
         if (childClass == VirtualHostNode.class)
         {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java Thu Dec 22 22:57:59 2016
@@ -59,8 +59,8 @@ public final class BrokerModel extends M
     public static final int MODEL_MINOR_VERSION = 0;
     public static final String MODEL_VERSION = MODEL_MAJOR_VERSION + "." + MODEL_MINOR_VERSION;
     private static final Model MODEL_INSTANCE = new BrokerModel();
-    private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>> _parents =
-            new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
+    private final Map<Class<? extends ConfiguredObject>, Class<? extends ConfiguredObject>> _parents =
+            new HashMap<>();
 
     private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>> _children =
             new HashMap<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>>();
@@ -136,11 +136,10 @@ public final class BrokerModel extends M
         return _rootCategory;
     }
 
-    public Collection<Class<? extends ConfiguredObject>> getParentTypes(Class<? extends ConfiguredObject> child)
+    @Override
+    public Class<? extends ConfiguredObject> getParentType(final Class<? extends ConfiguredObject> child)
     {
-        Collection<Class<? extends ConfiguredObject>> parentTypes = _parents.get(child);
-        return parentTypes == null ? Collections.<Class<? extends ConfiguredObject>>emptyList()
-                : Collections.unmodifiableCollection(parentTypes);
+        return _parents.get(child);
     }
 
     @Override
@@ -181,13 +180,14 @@ public final class BrokerModel extends M
 
     private void addRelationship(Class<? extends ConfiguredObject> parent, Class<? extends ConfiguredObject> child)
     {
-        Collection<Class<? extends ConfiguredObject>> parents = _parents.get(child);
-        if (parents == null)
+        if(!_parents.containsKey(child))
+        {
+            _parents.put(child,parent);
+        }
+        else
         {
-            parents = new ArrayList<Class<? extends ConfiguredObject>>();
-            _parents.put(child, parents);
+            throw new IllegalArgumentException("Child class " + child.getSimpleName() + " already has parent " + _parents.get(child).getSimpleName());
         }
-        parents.add(parent);
 
         Collection<Class<? extends ConfiguredObject>> children = _children.get(parent);
         if (children == null)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationExtractor.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationExtractor.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationExtractor.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfigurationExtractor.java Thu Dec 22 22:57:59 2016
@@ -48,8 +48,6 @@ public class ConfigurationExtractor
 
         results.putAll(extractAttributeValues(object, includeSecure));
 
-        results.putAll(extractNonPrimaryParentsAsAttributes(object));
-
         results.putAll(extractChildren(object, includeSecure));
 
         return results;
@@ -230,32 +228,6 @@ public class ConfigurationExtractor
         return argType instanceof Class ? (Class) argType : (Class) ((ParameterizedType)argType).getRawType();
     }
 
-    private Map<String, Object> extractNonPrimaryParentsAsAttributes(final ConfiguredObject<?> object)
-    {
-        final Model model = object.getModel();
-        Map<String, Object> results = new LinkedHashMap<>();
-
-        Collection<Class<? extends ConfiguredObject>> parentTypes = model.getParentTypes(object.getCategoryClass());
-
-        if(parentTypes.size() > 1)
-        {
-            Iterator<Class<? extends ConfiguredObject>>
-                    parentClassIter = parentTypes.iterator();
-
-            for(int i = 1; i < parentTypes.size(); i++)
-            {
-                Class<? extends ConfiguredObject> parentClass = parentClassIter.next();
-                ConfiguredObject parent = object.getParent(parentClass);
-                if(parent != null)
-                {
-                    results.put(parentClass.getSimpleName().toLowerCase(), parent.getName());
-                }
-            }
-        }
-
-        return results;
-    }
-
 
     private Map<String, Object> extractChildren(final ConfiguredObject<?> object,
                                                 final boolean includeSecure)
@@ -271,9 +243,8 @@ public class ConfigurationExtractor
             for (Class<? extends ConfiguredObject> childClass : model
                     .getChildTypes(object.getCategoryClass()))
             {
-                ArrayList<Class<? extends ConfiguredObject>> parentClasses =
-                        new ArrayList<>(model.getParentTypes(childClass));
-                if (parentClasses.get(parentClasses.size() - 1).equals(object.getCategoryClass()))
+                Class<? extends ConfiguredObject> parentClass = model.getParentType(childClass);
+                if (parentClass.equals(object.getCategoryClass()))
                 {
                     List<Map<String, Object>> children = new ArrayList<>();
                     for (ConfiguredObject child : object.getChildren(childClass))

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java Thu Dec 22 22:57:59 2016
@@ -231,8 +231,7 @@ public interface ConfiguredObject<X exte
 
 
     <C extends ConfiguredObject> C createChild(Class<C> childClass,
-                                               Map<String, Object> attributes,
-                                               ConfiguredObject... otherParents);
+                                               Map<String, Object> attributes);
 
     <C extends ConfiguredObject> ListenableFuture<C> getAttainedChildById(Class<C> childClass,
                                                                           UUID id);
@@ -240,8 +239,7 @@ public interface ConfiguredObject<X exte
     <C extends ConfiguredObject> ListenableFuture<C> getAttainedChildByName(Class<C> childClass, String name);
 
     <C extends ConfiguredObject> ListenableFuture<C> createChildAsync(Class<C> childClass,
-                                                                      Map<String, Object> attributes,
-                                                                      ConfiguredObject... otherParents);
+                                                                      Map<String, Object> attributes);
 
     void setAttributes(Map<String, Object> attributes) throws IllegalStateException, AccessControlException, IllegalArgumentException;
     ListenableFuture<Void> setAttributesAsync(Map<String, Object> attributes) throws IllegalStateException, AccessControlException, IllegalArgumentException;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFinder.java Thu Dec 22 22:57:59 2016
@@ -304,9 +304,9 @@ public class ConfiguredObjectFinder
         return parents;
     }
 
-    public List<ConfiguredObject> findObjectParentsFromPath(final List<String> names,
-                                                            final Class<? extends ConfiguredObject>[] hierarchy,
-                                                            final Class<? extends ConfiguredObject> objClass)
+    public ConfiguredObject findObjectParentsFromPath(final List<String> names,
+                                                      final Class<? extends ConfiguredObject>[] hierarchy,
+                                                      final Class<? extends ConfiguredObject> objClass)
     {
         Model model = _root.getModel();
         Collection<ConfiguredObject<?>>[] objects = new Collection[hierarchy.length];
@@ -360,16 +360,14 @@ public class ConfiguredObjectFinder
                 }
             }
         }
-        List<ConfiguredObject> parents = new ArrayList<>();
-        Collection<Class<? extends ConfiguredObject>> parentClasses =
-                model.getParentTypes(objClass);
+        Class<? extends ConfiguredObject> parentClass = model.getParentType(objClass);
         for (int i = hierarchy.length - 2; i >= 0; i--)
         {
-            if (parentClasses.contains(hierarchy[i]))
+            if (parentClass.equals(hierarchy[i]))
             {
                 if (objects[i].size() == 1)
                 {
-                    parents.add(objects[i].iterator().next());
+                    return (objects[i].iterator().next());
                 }
                 else
                 {
@@ -378,7 +376,7 @@ public class ConfiguredObjectFinder
                 }
             }
         }
-        return parents;
+        return null;
     }
 
     public String getPath(final ConfiguredObject<?> object)
@@ -423,28 +421,20 @@ public class ConfiguredObjectFinder
 
         if (category != rootClass)
         {
-            Collection<Class<? extends ConfiguredObject>> parentCategories;
+            Class<? extends ConfiguredObject> parentCategory;
 
             hierarchyList.add(category);
 
-            while (!(parentCategories = model.getParentTypes(category)).contains(rootClass))
+            while (!rootClass.equals(parentCategory = model.getParentType(category)))
             {
-                hierarchyList.addAll(parentCategories);
-                if (!parentCategories.isEmpty())
+                if (parentCategory != null)
                 {
-                    Iterator<Class<? extends ConfiguredObject>> iterator = parentCategories.iterator();
-                    category = iterator.next();
-                    if (!model.getAncestorCategories(category).contains(rootClass))
+                    hierarchyList.add(parentCategory);
+                    if (!model.getAncestorCategories(parentCategory).contains(rootClass))
                     {
-                        if (iterator.hasNext())
-                        {
-                            category = iterator.next();
-                        }
-                        else
-                        {
-                            break;
-                        }
+                        break;
                     }
+                    category = parentCategory;
                 }
                 else
                 {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java Thu Dec 22 22:57:59 2016
@@ -91,11 +91,12 @@ public abstract class Model
         }
         else
         {
-            for(Class<? extends ConfiguredObject> parentClass : getParentTypes(category))
+            Class<? extends ConfiguredObject> parentClass = getParentType(category);
+            if(parentClass != null)
             {
                 ConfiguredObject<?> parent = object.getParent(parentClass);
                 C ancestor = getAncestor(ancestorClass, parentClass, parent);
-                if(ancestor != null)
+                if (ancestor != null)
                 {
                     return ancestor;
                 }
@@ -123,7 +124,11 @@ public abstract class Model
             candidateClasses = new HashSet<>();
             for(Class<? extends ConfiguredObject> prev : previous)
             {
-                candidateClasses.addAll(getParentTypes(prev));
+                final Class<? extends ConfiguredObject> parentType = getParentType(prev);
+                if(parentType != null)
+                {
+                    candidateClasses.add(parentType);
+                }
             }
         }
         return null;
@@ -168,7 +173,8 @@ public abstract class Model
     public final Collection<Class<? extends ConfiguredObject>> getAncestorCategories(Class<? extends ConfiguredObject> category)
     {
         Set<Class<? extends ConfiguredObject>> allAncestors = new HashSet<>();
-        for(Class<? extends ConfiguredObject> clazz : getParentTypes(category))
+        Class<? extends ConfiguredObject> clazz = getParentType(category);
+        if(clazz != null)
         {
             if(allAncestors.add(clazz))
             {
@@ -184,7 +190,8 @@ public abstract class Model
 
     public abstract Class<? extends ConfiguredObject> getRootCategory();
 
-    public abstract Collection<Class<? extends ConfiguredObject>> getParentTypes(Class<? extends ConfiguredObject> child);
+    public abstract Class<? extends ConfiguredObject> getParentType(Class<? extends ConfiguredObject> child);
+
     public abstract int getMajorVersion();
     public abstract int getMinorVersion();
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfigBootstrapModel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfigBootstrapModel.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfigBootstrapModel.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfigBootstrapModel.java Thu Dec 22 22:57:59 2016
@@ -68,9 +68,10 @@ public final class SystemConfigBootstrap
         return _rootCategory;
     }
 
-    public Collection<Class<? extends ConfiguredObject>> getParentTypes(Class<? extends ConfiguredObject> child)
+    @Override
+    public Class<? extends ConfiguredObject> getParentType(final Class<? extends ConfiguredObject> child)
     {
-        return Collections.<Class<? extends ConfiguredObject>>emptyList();
+        return null;
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java Thu Dec 22 22:57:59 2016
@@ -195,7 +195,7 @@ public class FileBasedGroupProviderImpl
 
     @Override
     public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
-            Map<String, Object> attributes, ConfiguredObject... otherParents)
+                                                                          Map<String, Object> attributes)
     {
         if (childClass == Group.class)
         {
@@ -360,8 +360,7 @@ public class FileBasedGroupProviderImpl
 
         @Override
         public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
-                Map<String, Object> attributes,
-                ConfiguredObject... otherParents)
+                                                                              Map<String, Object> attributes)
         {
             if (childClass == GroupMember.class)
             {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java Thu Dec 22 22:57:59 2016
@@ -35,7 +35,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.configuration.CommonProperties;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.messages.BrokerMessages;
 import org.apache.qpid.server.logging.messages.PortMessages;
 import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.model.ConfiguredObject;
@@ -297,14 +296,13 @@ public abstract class AbstractPort<X ext
 
     @Override
     public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                                          final Map<String, Object> attributes,
-                                                                          final ConfiguredObject... otherParents)
+                                                                          final Map<String, Object> attributes)
     {
         if (VirtualHostAlias.class.isAssignableFrom(childClass))
         {
             return getObjectFactory().createAsync(childClass, attributes, this);
         }
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
     protected State onActivate()

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java Thu Dec 22 22:57:59 2016
@@ -223,8 +223,7 @@ public abstract class ConfigModelPasswor
 
     @Override
     public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                   final Map<String, Object> attributes,
-                                                   final ConfiguredObject... otherParents)
+                                                                          final Map<String, Object> attributes)
     {
         if(childClass == User.class)
         {
@@ -238,7 +237,7 @@ public abstract class ConfigModelPasswor
             user.create();
             return Futures.immediateFuture((C)getUser(username));
         }
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
     abstract void validateUser(final ManagedUser managedUser);

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java Thu Dec 22 22:57:59 2016
@@ -305,8 +305,7 @@ public abstract class PrincipalDatabaseA
 
     @Override
     public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
-                                                   Map<String, Object> attributes,
-                                                   ConfiguredObject... otherParents)
+                                                                          Map<String, Object> attributes)
     {
         if(childClass == User.class)
         {
@@ -332,7 +331,7 @@ public abstract class PrincipalDatabaseA
             return Futures.immediateFuture((C)principalAdapter);
         }
 
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java Thu Dec 22 22:57:59 2016
@@ -50,8 +50,7 @@ public class GroupImpl extends AbstractC
 
     @Override
     protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                      final Map<String, Object> attributes,
-                                                      final ConfiguredObject... otherParents)
+                                                                             final Map<String, Object> attributes)
     {
         if(childClass == GroupMember.class)
         {
@@ -59,7 +58,7 @@ public class GroupImpl extends AbstractC
         }
         else
         {
-            return super.addChildAsync(childClass, attributes, otherParents);
+            return super.addChildAsync(childClass, attributes);
         }
     }
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java Thu Dec 22 22:57:59 2016
@@ -77,8 +77,7 @@ public class GroupProviderImpl extends A
 
     @Override
     protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                      final Map<String, Object> attributes,
-                                                      final ConfiguredObject... otherParents)
+                                                                             final Map<String, Object> attributes)
     {
         if(childClass == Group.class)
         {
@@ -87,7 +86,7 @@ public class GroupProviderImpl extends A
         }
         else
         {
-            return super.addChildAsync(childClass, attributes, otherParents);
+            return super.addChildAsync(childClass, attributes);
         }
     }
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecordConverter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecordConverter.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecordConverter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/ConfiguredObjectRecordConverter.java Thu Dec 22 22:57:59 2016
@@ -157,34 +157,6 @@ public class ConfiguredObjectRecordConve
         if(parentId != null)
         {
             parentMap.put(parentClass.getSimpleName(),parentId);
-            for(Class<? extends ConfiguredObject> otherParent : _model.getParentTypes(clazz))
-            {
-                if(otherParent != parentClass)
-                {
-                    final String otherParentAttr = otherParent.getSimpleName().toLowerCase();
-                    Object otherParentId = data.remove(otherParentAttr);
-                    if(otherParentId instanceof String)
-                    {
-                        try
-                        {
-                            parentMap.put(otherParent.getSimpleName(), UUID.fromString((String) otherParentId));
-                        }
-                        catch(IllegalArgumentException e)
-                        {
-                            final String ancestorClassName =
-                                    _model.getAncestorClassWithGivenDescendant(clazz, otherParent).getSimpleName();
-                            final String parentName = (String) otherParentId;
-                            final String parentType = otherParent.getSimpleName();
-
-                            requiringResolution.add(new AncestorFindingResolver(id,
-                                                                                parentType,
-                                                                                parentName,
-                                                                                ancestorClassName));
-                        }
-                    }
-                }
-
-            }
         }
 
         records.put(id, new ConfiguredObjectRecordImpl(id, type, data, parentMap));

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java Thu Dec 22 22:57:59 2016
@@ -319,15 +319,12 @@ public class JsonFileConfigStore extends
             {
                 continue;
             }
-            Collection<Class<? extends ConfiguredObject>> parentTypes =
-                    model.getParentTypes(_classNameMapping.get(record.getType()));
-            if (parentTypes != null && !parentTypes.isEmpty())
+            Class<? extends ConfiguredObject> parentType =
+                    model.getParentType(_classNameMapping.get(record.getType()));
+            if (parentType != null)
             {
 
-                final Class<? extends ConfiguredObject> primaryParentCategory =
-                        parentTypes.iterator().next();
-
-                String parentCategoryName = primaryParentCategory.getSimpleName();
+                String parentCategoryName = parentType.getSimpleName();
 
                 UUID parentId = record.getParents().get(parentCategoryName);
 
@@ -358,21 +355,6 @@ public class JsonFileConfigStore extends
         ConfiguredObjectRecord record = _objectsById.get(id);
         Map<String,Object> map = new LinkedHashMap<>();
 
-        Collection<Class<? extends ConfiguredObject>> parentTypes = _parent.getModel().getParentTypes(type);
-        if(parentTypes.size() > 1)
-        {
-            Iterator<Class<? extends ConfiguredObject>> iter = parentTypes.iterator();
-            // skip the first parent, which is given by structure
-            iter.next();
-            // for all other parents add a fake attribute with name being the parent type in lower case, and the value
-            // being the parents id
-            while(iter.hasNext())
-            {
-                String parentType = iter.next().getSimpleName();
-                map.put(parentType.toLowerCase(), record.getParents().get(parentType));
-            }
-        }
-
         map.put("id", id);
         map.putAll(record.getAttributes());
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/AbstractAMQPConnection.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/AbstractAMQPConnection.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/AbstractAMQPConnection.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/AbstractAMQPConnection.java Thu Dec 22 22:57:59 2016
@@ -636,7 +636,8 @@ public abstract class AbstractAMQPConnec
     }
 
     @Override
-    public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+    public <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                          Map<String, Object> attributes)
     {
         if(childClass == Session.class)
         {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractNonConnectionAcceptingVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractNonConnectionAcceptingVirtualHost.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractNonConnectionAcceptingVirtualHost.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractNonConnectionAcceptingVirtualHost.java Thu Dec 22 22:57:59 2016
@@ -176,8 +176,7 @@ public abstract class AbstractNonConnect
 
     @Override
     protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                                             final Map<String, Object> attributes,
-                                                                             final ConfiguredObject... otherParents)
+                                                                             final Map<String, Object> attributes)
     {
         throwUnsupported();
         return null;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Thu Dec 22 22:57:59 2016
@@ -806,7 +806,8 @@ public abstract class AbstractVirtualHos
     }
 
     @Override
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                             Map<String, Object> attributes)
     {
         checkVHostStateIsActive();
         if(childClass == Exchange.class)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNode.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNode.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNode.java Thu Dec 22 22:57:59 2016
@@ -60,14 +60,14 @@ public abstract class AbstractStandardVi
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
     @Override
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes,
-            ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                             Map<String, Object> attributes)
     {
         if(childClass == VirtualHost.class)
         {
             return getObjectFactory().createAsync(childClass, attributes, this);
         }
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java Thu Dec 22 22:57:59 2016
@@ -280,15 +280,15 @@ public class RedirectingVirtualHostNodeI
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
     @Override
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes,
-                                                                             ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                             Map<String, Object> attributes)
     {
         if(childClass == VirtualHost.class)
         {
             throw new UnsupportedOperationException("The redirecting virtualhost node automatically manages the creation"
                                                     + " of the redirecting virtualhost. Creating it explicitly is not supported.");
         }
-        return super.addChildAsync(childClass, attributes, otherParents);
+        return super.addChildAsync(childClass, attributes);
     }
 
     public static Map<String, Collection<String>> getSupportedChildTypes()

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java Thu Dec 22 22:57:59 2016
@@ -75,7 +75,7 @@ public class StoreConfigurationChangeLis
         when(child.getCategoryClass()).thenReturn(VirtualHost.class);
         Model model = mock(Model.class);
         when(model.getChildTypes(any(Class.class))).thenReturn(Collections.<Class<? extends ConfiguredObject>>emptyList());
-        when(model.getParentTypes(eq(VirtualHost.class))).thenReturn(Collections.<Class<? extends ConfiguredObject>>singleton(Broker.class));
+        when(model.getParentType(eq(VirtualHost.class))).thenReturn((Class)Broker.class);
         when(child.getModel()).thenReturn(model);
         when(child.isDurable()).thenReturn(true);
         _listener.childAdded(broker, child);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java Thu Dec 22 22:57:59 2016
@@ -49,7 +49,7 @@ public class DirectExchangeTest extends
         attributes.put(Exchange.DURABLE, false);
         attributes.put(Exchange.TYPE, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
 
-        _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes, _vhost);
+        _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes);
         _exchange.open();
     }
 
@@ -79,7 +79,7 @@ public class DirectExchangeTest extends
 
         try
         {
-            _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes, _vhost);
+            _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes);
             _exchange.open();
             fail("Exception not thrown");
         }
@@ -104,7 +104,7 @@ public class DirectExchangeTest extends
 
         try
         {
-            _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes, _vhost);
+            _exchange = (DirectExchangeImpl) _vhost.createChild(Exchange.class, attributes);
             _exchange.open();
             fail("Exception not thrown");
         }

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java Thu Dec 22 22:57:59 2016
@@ -63,7 +63,7 @@ public class TopicExchangeTest extends Q
         attributes.put(Exchange.DURABLE, false);
         attributes.put(Exchange.TYPE, ExchangeDefaults.TOPIC_EXCHANGE_CLASS);
 
-        _exchange = (TopicExchangeImpl) _vhost.createChild(Exchange.class, attributes, _vhost);
+        _exchange = (TopicExchangeImpl) _vhost.createChild(Exchange.class, attributes);
         _exchange.open();
     }
 

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCarImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCarImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCarImpl.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCarImpl.java Thu Dec 22 22:57:59 2016
@@ -56,8 +56,7 @@ public class TestKitCarImpl extends Abst
 
     @Override
     protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                                             final Map<String, Object> attributes,
-                                                                             final ConfiguredObject... otherParents)
+                                                                             final Map<String, Object> attributes)
     {
         return getObjectFactory().createAsync(childClass, attributes, this);
     }

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestModel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestModel.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestModel.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestModel.java Thu Dec 22 22:57:59 2016
@@ -93,11 +93,9 @@ public class TestModel extends Model
     }
 
     @Override
-    public Collection<Class<? extends ConfiguredObject>> getParentTypes(final Class<? extends ConfiguredObject> child)
+    public Class<? extends ConfiguredObject> getParentType(final Class<? extends ConfiguredObject> child)
     {
-        return TestEngine.class.isAssignableFrom(child)
-                ? Collections.<Class<? extends ConfiguredObject>>singleton(TestCar.class)
-                : Collections.<Class<? extends ConfiguredObject>>emptySet();
+        return TestEngine.class.isAssignableFrom(child) ? TestCar.class : null;
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCarImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCarImpl.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCarImpl.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCarImpl.java Thu Dec 22 22:57:59 2016
@@ -77,8 +77,7 @@ public class TestStandardCarImpl extends
 
     @Override
     protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
-                                                                             final Map<String, Object> attributes,
-                                                                             final ConfiguredObject... otherParents)
+                                                                             final Map<String, Object> attributes)
     {
         return getObjectFactory().createAsync(childClass, attributes, this);
     }

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/lifecycle/TestConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/lifecycle/TestConfiguredObject.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/lifecycle/TestConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/lifecycle/TestConfiguredObject.java Thu Dec 22 22:57:59 2016
@@ -243,11 +243,9 @@ public class TestConfiguredObject extend
         }
 
         @Override
-        public Collection<Class<? extends ConfiguredObject>> getParentTypes(final Class<? extends ConfiguredObject> child)
+        public Class<? extends ConfiguredObject> getParentType(final Class<? extends ConfiguredObject> child)
         {
-            return TestConfiguredObject.class.isAssignableFrom(child)
-                    ? CATEGORIES
-                    : Collections.<Class<? extends ConfiguredObject>>emptySet();
+            return TestConfiguredObject.class.isAssignableFrom(child) ? TestConfiguredObject.class : null;
         }
 
         @Override

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestModel.java Thu Dec 22 22:57:59 2016
@@ -88,9 +88,9 @@ public class TestModel extends Model
     }
 
     @Override
-    public Collection<Class<? extends ConfiguredObject>> getParentTypes(final Class<? extends ConfiguredObject> child)
+    public Class<? extends ConfiguredObject> getParentType(final Class<? extends ConfiguredObject> child)
     {
-        return Collections.<Class<? extends ConfiguredObject>>emptySet();
+        return null;
     }
 
     @Override

Modified: qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AbstractLogger.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AbstractLogger.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AbstractLogger.java (original)
+++ qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/AbstractLogger.java Thu Dec 22 22:57:59 2016
@@ -124,7 +124,8 @@ public abstract class AbstractLogger<X e
     }
 
     @Override
-    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
+    protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass,
+                                                                             Map<String, Object> attributes)
     {
         return getObjectFactory().createAsync(childClass, attributes, this);
     }

Modified: qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java (original)
+++ qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java Thu Dec 22 22:57:59 2016
@@ -600,7 +600,8 @@ class ManagementNode implements MessageS
                                                  "Cannot change the value of '" + IDENTITY_ATTRIBUTE + "'");
                 }
                 String path = (String) attributes.remove(OBJECT_PATH);
-                for (Class<? extends ConfiguredObject> parentType : _model.getParentTypes(clazz))
+                Class<? extends ConfiguredObject> parentType = _model.getParentType(clazz);
+                if(parentType != null)
                 {
                     String attributeName = parentType.getSimpleName().toLowerCase();
                     final Object parentValue = attributes.remove(attributeName);
@@ -721,22 +722,20 @@ class ManagementNode implements MessageS
                 String path = String.valueOf(attributes.remove(OBJECT_PATH));
 
                 ConfiguredObject theParent = _managedObject;
-                ConfiguredObject[] otherParents = null;
 
                 final Class<? extends ConfiguredObject>[] hierarchy = _configuredObjectFinder.getHierarchy(clazz);
                 if (hierarchy.length > 1)
                 {
 
-                    List<ConfiguredObject> parents =
+                    ConfiguredObject parent =
                             _configuredObjectFinder.findObjectParentsFromPath(Arrays.asList(getPathElements(path)), hierarchy, ConfiguredObjectTypeRegistry.getCategory(clazz));
-                    if(parents.isEmpty())
+                    if(parent == null)
                     {
                         return createFailureResponse(message, STATUS_CODE_NOT_FOUND, "The '"+OBJECT_PATH+"' "+path+" does not identify a valid parent");
                     }
-                    theParent = parents.remove(0);
-                    otherParents = parents.toArray(new ConfiguredObject[parents.size()]);
+                    theParent = parent;
                 }
-                return doCreate(clazz, message, responseHeader, attributes, theParent, otherParents);
+                return doCreate(clazz, message, responseHeader, attributes, theParent);
 
             }
             else if(_configuredObjectFinder.getHierarchy(clazz).length == 1 && attributes.containsKey(ConfiguredObject.NAME))
@@ -759,8 +758,7 @@ class ManagementNode implements MessageS
                                      final InternalMessage message,
                                      final MutableMessageHeader responseHeader,
                                      final Map<String, Object> attributes,
-                                     final ConfiguredObject<?> primaryParent,
-                                     final ConfiguredObject<?>... otherParents)
+                                     final ConfiguredObject<?> parent)
     {
         try
         {
@@ -777,7 +775,7 @@ class ManagementNode implements MessageS
                 }
 
 
-                final ConfiguredObject object = primaryParent.createChild(ConfiguredObjectTypeRegistry.getCategory(clazz), attributes, otherParents);
+                final ConfiguredObject object = parent.createChild(ConfiguredObjectTypeRegistry.getCategory(clazz), attributes);
                 return InternalMessage.createMapMessage(_addressSpace.getMessageStore(), responseHeader,
                                                         _managementOutputConverter.convertToOutput(object, true));
             }
@@ -1348,12 +1346,10 @@ class ManagementNode implements MessageS
             if(category != _managedObject.getCategoryClass()
                && !isSyntheticChildClass(category))
             {
-                for (Class<? extends ConfiguredObject> parentType : _model.getParentTypes(category))
+                Class<? extends ConfiguredObject> parentType = _model.getParentType(category);
+                if (parentType != _managedObject.getCategoryClass())
                 {
-                    if (parentType != _managedObject.getCategoryClass())
-                    {
-                        attributeNames.add(parentType.getSimpleName().toLowerCase());
-                    }
+                    attributeNames.add(parentType.getSimpleName().toLowerCase());
                 }
             }
 

Modified: qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java (original)
+++ qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java Thu Dec 22 22:57:59 2016
@@ -115,14 +115,13 @@ class ManagementOutputConverter
 
         if(object != _managementNode.getManagedObject() && !_managementNode.isSyntheticChildClass(object.getCategoryClass()))
         {
-            for (Class<? extends ConfiguredObject> parentType : object.getModel()
-                                                                      .getParentTypes(object.getCategoryClass()))
+            Class<? extends ConfiguredObject> parentType = object.getModel().getParentType(object.getCategoryClass());
+
+            if (parentType != _managementNode.getManagedObject().getCategoryClass())
             {
-                if (parentType != _managementNode.getManagedObject().getCategoryClass())
-                {
-                    attributes.put(parentType.getSimpleName().toLowerCase(), object.getParent(parentType));
-                }
+                attributes.put(parentType.getSimpleName().toLowerCase(), object.getParent(parentType));
             }
+
         }
 
         for(String name : object.getAttributeNames())

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java Thu Dec 22 22:57:59 2016
@@ -289,7 +289,7 @@ public class ConfiguredObjectExpressionF
             {
                 if(PARENT_ATTR.equals(_propertyName))
                 {
-                    return object.getParent(object.getModel().getParentTypes(object.getCategoryClass()).iterator().next());
+                    return object.getParent(object.getModel().getParentType(object.getCategoryClass()));
                 }
                 else
                 {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerQueryServlet.java Thu Dec 22 22:57:59 2016
@@ -88,15 +88,15 @@ public class BrokerQueryServlet extends
             while (element != null && element != Broker.class)
             {
                 hierarchy.add(element);
-                final Collection<Class<? extends ConfiguredObject>> parentTypes =
-                        brokerModel.getParentTypes(element);
-                if(parentTypes == null || parentTypes.isEmpty())
+                Class<? extends ConfiguredObject> parentType =
+                        brokerModel.getParentType(element);
+                if(parentType == null)
                 {
                     break;
                 }
                 else
                 {
-                    element = parentTypes.iterator().next();
+                    element = parentType;
                 }
             }
             Collections.reverse(hierarchy);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java Thu Dec 22 22:57:59 2016
@@ -200,10 +200,10 @@ public class ConfiguredObjectToMapConver
     private void collectInheritedActualContext(ConfiguredObject<?> confObject, Map<String, Object> contextValues)
     {
         Model model = confObject.getModel();
-        Collection<Class<? extends ConfiguredObject>> parents = model.getParentTypes(confObject.getCategoryClass());
-        if(parents != null && !parents.isEmpty())
+        Class<? extends ConfiguredObject> parentType = model.getParentType(confObject.getCategoryClass());
+        if(parentType != null)
         {
-            ConfiguredObject parent = confObject.getParent(parents.iterator().next());
+            ConfiguredObject parent = confObject.getParent(parentType);
             if(parent != null)
             {
                 collectInheritedActualContext(parent, contextValues);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1775768&r1=1775767&r2=1775768&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java Thu Dec 22 22:57:59 2016
@@ -36,8 +36,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -432,22 +430,18 @@ public class RestServlet extends Abstrac
                 }
 
                 ConfiguredObject theParent = managedObject;
-                ConfiguredObject[] otherParents = null;
                 Class<? extends ConfiguredObject> objClass = configuredClass;
                 if (hierarchy.length > 1)
                 {
 
-                    List<ConfiguredObject> parents =
-                            finder.findObjectParentsFromPath(names, hierarchy, configuredClass);
-                    theParent = parents.remove(0);
-                    otherParents = parents.toArray(new ConfiguredObject[parents.size()]);
+                    theParent = finder.findObjectParentsFromPath(names, hierarchy, configuredClass);
                 }
 
                 if (isFullObjectURL)
                 {
                     providedObject.put("name", names.get(names.size() - 1));
                     ConfiguredObject<?> configuredObject =
-                            findObjectToUpdateInParent(objClass, providedObject, theParent, otherParents);
+                            findObjectToUpdateInParent(objClass, providedObject, theParent);
 
                     if (configuredObject != null)
                     {
@@ -465,7 +459,7 @@ public class RestServlet extends Abstrac
                     }
                 }
 
-                ConfiguredObject<?> configuredObject = theParent.createChild(objClass, providedObject, otherParents);
+                ConfiguredObject<?> configuredObject = theParent.createChild(objClass, providedObject);
                 StringBuffer requestURL = request.getRequestURL();
                 if (!isFullObjectURL)
                 {
@@ -718,19 +712,17 @@ public class RestServlet extends Abstrac
         else
         {
             ConfiguredObject theParent = managedObject;
-            ConfiguredObject[] otherParents = null;
             if (hierarchy.length > 1)
             {
 
-                List<ConfiguredObject> parents =
+                ConfiguredObject parent =
                         finder.findObjectParentsFromPath(names, hierarchy, configuredClass);
-                theParent = parents.remove(0);
-                otherParents = parents.toArray(new ConfiguredObject[parents.size()]);
+                theParent = parent;
             }
             Class<? extends ConfiguredObject> objClass = configuredClass;
             Map<String, Object> objectName =
                     Collections.<String, Object>singletonMap("name", names.get(names.size() - 1));
-            target = findObjectToUpdateInParent(objClass, objectName, theParent, otherParents);
+            target = findObjectToUpdateInParent(objClass, objectName, theParent);
             if (target == null)
             {
 
@@ -865,14 +857,16 @@ public class RestServlet extends Abstrac
         return providedObject;
     }
 
-    private ConfiguredObject<?> findObjectToUpdateInParent(Class<? extends ConfiguredObject> objClass, Map<String, Object> providedObject, ConfiguredObject theParent, ConfiguredObject[] otherParents)
+    private ConfiguredObject<?> findObjectToUpdateInParent(Class<? extends ConfiguredObject> objClass,
+                                                           Map<String, Object> providedObject,
+                                                           ConfiguredObject theParent)
     {
         Collection<? extends ConfiguredObject> existingChildren = theParent.getChildren(objClass);
 
         for (ConfiguredObject obj : existingChildren)
         {
             if ((providedObject.containsKey("id") && String.valueOf(providedObject.get("id")).equals(obj.getId().toString()))
-                    || (obj.getName().equals(providedObject.get("name")) && sameOtherParents(obj, otherParents, objClass)))
+                    || (obj.getName().equals(providedObject.get("name")) ))
             {
                 return obj;
             }
@@ -880,37 +874,6 @@ public class RestServlet extends Abstrac
         return null;
     }
 
-    private boolean sameOtherParents(ConfiguredObject obj, ConfiguredObject[] otherParents, Class<? extends ConfiguredObject> objClass)
-    {
-        Collection<Class<? extends ConfiguredObject>> parentClasses = obj.getModel().getParentTypes(objClass);
-
-        if(otherParents == null || otherParents.length == 0)
-        {
-            return parentClasses.size() == 1;
-        }
-
-
-        for (ConfiguredObject parent : otherParents)
-        {
-            boolean found = false;
-            for (Class<? extends ConfiguredObject> parentClass : parentClasses)
-            {
-                if (parent == obj.getParent(parentClass))
-                {
-                    found = true;
-                    break;
-                }
-            }
-
-            if (!found)
-            {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
     private void setResponseStatus(HttpServletRequest request, HttpServletResponse response, Throwable e)
             throws IOException
     {



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


Mime
View raw message