qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1588586 [2/3] - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/binding/ broker-core/src/main/java/org/apache/qpid/server/exchange/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/jav...
Date Fri, 18 Apr 2014 22:38:05 GMT
Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreFactory.java Fri Apr 18 22:38:03 2014
@@ -20,9 +20,7 @@
  */
 package org.apache.qpid.server.security;
 
-import java.util.HashMap;
 import java.util.Map;
-import java.util.UUID;
 
 import org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory;
 import org.apache.qpid.server.model.Broker;
@@ -35,22 +33,10 @@ public class FileTrustStoreFactory exten
         super(FileTrustStoreImpl.class);
     }
 
-    protected final Broker getBroker(ConfiguredObject<?>... parents)
-    {
-        if(parents.length != 1 && !(parents[0] instanceof Broker))
-        {
-            throw new IllegalArgumentException("Should have exactly one parent of type broker");
-        }
-        return (Broker) parents[0];
-    }
-
     @Override
     public FileTrustStoreImpl createInstance(final Map<String, Object> attributes, final ConfiguredObject<?>... parents)
     {
-        HashMap<String, Object> attributesWithoutId = new HashMap<String, Object>(attributes);
-        Object idObj = attributesWithoutId.remove(ConfiguredObject.ID);
-        UUID id = idObj == null ? UUID.randomUUID() : idObj instanceof UUID ? (UUID) idObj : UUID.fromString(idObj.toString());
-        return new FileTrustStoreImpl(id, getParent(Broker.class, parents), attributesWithoutId);
+        return new FileTrustStoreImpl(attributes, getParent(Broker.class, parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java Fri Apr 18 22:38:03 2014
@@ -29,7 +29,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
@@ -67,10 +66,10 @@ public class FileTrustStoreImpl extends 
 
     private Broker<?> _broker;
 
-    public FileTrustStoreImpl(UUID id, Broker<?> broker, Map<String, Object> attributes)
+    public FileTrustStoreImpl(Map<String, Object> attributes, Broker<?> broker)
     {
         super(parentsMap(broker),
-              combineIdWithAttributes(id, attributes),
+              attributes,
               broker.getTaskExecutor());
         _broker = broker;
     }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -61,8 +61,7 @@ public abstract class AbstractAuthentica
     private PreferencesProvider _preferencesProvider;
     private AtomicReference<State> _state = new AtomicReference<State>(State.INITIALISING);
 
-    protected AbstractAuthenticationManager(final Broker broker,
-                                            final Map<String, Object> attributes)
+    protected AbstractAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
         super(parentsMap(broker),
               attributes, broker.getTaskExecutor());

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -50,10 +50,9 @@ public class AnonymousAuthenticationMana
 
     private static final AuthenticationResult ANONYMOUS_AUTHENTICATION = new AuthenticationResult(ANONYMOUS_PRINCIPAL);
 
-    protected AnonymousAuthenticationManager(final Broker broker,
-                                             final Map<String, Object> attributes)
+    protected AnonymousAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerFactory.java Fri Apr 18 22:38:03 2014
@@ -54,7 +54,7 @@ public class AnonymousAuthenticationMana
     public AnonymousAuthenticationManager createInstance(final Map<String, Object> attributes,
                                                          final ConfiguredObject<?>... parents)
     {
-        return new AnonymousAuthenticationManager(getParent(Broker.class,parents), attributes);
+        return new AnonymousAuthenticationManager(attributes, getParent(Broker.class,parents));
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordDatabaseAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordDatabaseAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/Base64MD5PasswordDatabaseAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -36,7 +36,7 @@ public class Base64MD5PasswordDatabaseAu
     protected Base64MD5PasswordDatabaseAuthenticationManager(final Broker broker,
                                                              final Map<String, Object> attributes)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerFactory.java Fri Apr 18 22:38:03 2014
@@ -60,7 +60,7 @@ public class ExternalAuthenticationManag
     public ExternalAuthenticationManagerImpl createInstance(final Map<String, Object> attributes,
                                                         final ConfiguredObject<?>... parents)
     {
-        return new ExternalAuthenticationManagerImpl(getParent(Broker.class, parents), attributes);
+        return new ExternalAuthenticationManagerImpl(attributes, getParent(Broker.class, parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java Fri Apr 18 22:38:03 2014
@@ -38,10 +38,9 @@ public class ExternalAuthenticationManag
     @ManagedAttributeField
     private boolean _useFullDN;
 
-    protected ExternalAuthenticationManagerImpl(final Broker broker,
-                                                final Map<String, Object> attributes)
+    protected ExternalAuthenticationManagerImpl(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -42,10 +42,9 @@ public class KerberosAuthenticationManag
     private static final String GSSAPI_MECHANISM = "GSSAPI";
     private final CallbackHandler _callbackHandler = new GssApiCallbackHandler();
 
-    protected KerberosAuthenticationManager(final Broker broker,
-                                            final Map<String, Object> attributes)
+    protected KerberosAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManagerFactory.java Fri Apr 18 22:38:03 2014
@@ -52,7 +52,7 @@ public class KerberosAuthenticationManag
     public KerberosAuthenticationManager createInstance(final Map<String, Object> attributes,
                                                         final ConfiguredObject<?>... parents)
     {
-        return new KerberosAuthenticationManager(getParent(Broker.class, parents), attributes);
+        return new KerberosAuthenticationManager(attributes, getParent(Broker.class, parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordDatabaseAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordDatabaseAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PlainPasswordDatabaseAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -33,7 +33,7 @@ public class PlainPasswordDatabaseAuthen
     protected PlainPasswordDatabaseAuthenticationManager(final Broker broker,
                                                          final Map<String, Object> attributes)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -70,10 +70,9 @@ public abstract class PrincipalDatabaseA
     @ManagedAttributeField
     private String _path;
 
-    protected PrincipalDatabaseAuthenticationManager(final Broker broker,
-                                                     final Map<String, Object> attributes)
+    protected PrincipalDatabaseAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -76,10 +76,9 @@ public class ScramSHA1AuthenticationMana
     private Map<String, ScramAuthUser> _users = new ConcurrentHashMap<String, ScramAuthUser>();
 
 
-    protected ScramSHA1AuthenticationManager(final Broker broker,
-                                             final Map<String, Object> attributes)
+    protected ScramSHA1AuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerFactory.java Fri Apr 18 22:38:03 2014
@@ -60,7 +60,7 @@ public class ScramSHA1AuthenticationMana
     public ScramSHA1AuthenticationManager createInstance(final Map<String, Object> attributes,
                                                          final ConfiguredObject<?>... parents)
     {
-        return new ScramSHA1AuthenticationManager(getParent(Broker.class, parents), attributes);
+        return new ScramSHA1AuthenticationManager(attributes, getParent(Broker.class, parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java Fri Apr 18 22:38:03 2014
@@ -54,10 +54,9 @@ public class SimpleAuthenticationManager
 
     private final Map<String, String> _users = Collections.synchronizedMap(new HashMap<String, String>());
 
-    public SimpleAuthenticationManager(final Broker broker,
-                                       final Map<String, Object> attributes)
+    public SimpleAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerFactory.java Fri Apr 18 22:38:03 2014
@@ -74,7 +74,7 @@ public class SimpleLDAPAuthenticationMan
     public SimpleLDAPAuthenticationManagerImpl createInstance(final Map<String, Object> attributes,
                                                           final ConfiguredObject<?>... parents)
     {
-        return new SimpleLDAPAuthenticationManagerImpl(getParent(Broker.class, parents), attributes);
+        return new SimpleLDAPAuthenticationManagerImpl(attributes, getParent(Broker.class, parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java Fri Apr 18 22:38:03 2014
@@ -94,10 +94,9 @@ public class SimpleLDAPAuthenticationMan
      */
     private Class<? extends SocketFactory> _sslSocketFactoryOverrideClass;
 
-    protected SimpleLDAPAuthenticationManagerImpl(final Broker broker,
-                                                  final Map<String, Object> attributes)
+    protected SimpleLDAPAuthenticationManagerImpl(final Map<String, Object> attributes, final Broker broker)
     {
-        super(broker, attributes);
+        super(attributes, broker);
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java Fri Apr 18 22:38:03 2014
@@ -21,14 +21,9 @@
 package org.apache.qpid.server.util;
 
 import java.lang.reflect.Array;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 
 public class MapValueConverter
 {
@@ -57,40 +52,6 @@ public class MapValueConverter
         return String.valueOf(value);
     }
 
-    public static String getStringAttribute(String name, Map<String, Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getStringAttribute(name, attributes, null);
-    }
-
-    public static void assertMandatoryAttribute(String name, Map<String, Object> attributes)
-    {
-        if (!attributes.containsKey(name))
-        {
-            throw new IllegalArgumentException("Value for attribute " + name + " is not found");
-        }
-    }
-
-    public static Map<String,Object> getMapAttribute(String name, Map<String,Object> attributes, Map<String,Object> defaultVal)
-    {
-        final Object value = attributes.get(name);
-        if(value == null)
-        {
-            return defaultVal;
-        }
-        else if(value instanceof Map)
-        {
-            @SuppressWarnings("unchecked")
-            Map<String,Object> retVal = (Map<String,Object>) value;
-            return retVal;
-        }
-        else
-        {
-            throw new IllegalArgumentException("Value for attribute " + name + " is not of required type Map");
-        }
-    }
-
-
     @SuppressWarnings({ "unchecked", "rawtypes" })
     public static <E extends Enum> E getEnumAttribute(Class<E> clazz, String name, Map<String,Object> attributes, E defaultVal)
     {
@@ -113,12 +74,6 @@ public class MapValueConverter
         }
     }
 
-    public static <E extends Enum<?>> E getEnumAttribute(Class<E> clazz, String name, Map<String,Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getEnumAttribute(clazz, name, attributes, null);
-    }
-
     @SuppressWarnings({ "unchecked" })
     public static <T extends Enum<T>> T toEnum(String name, Object rawValue, Class<T> enumType)
     {
@@ -174,13 +129,6 @@ public class MapValueConverter
         }
     }
 
-
-    public static boolean getBooleanAttribute(String name, Map<String, Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getBooleanAttribute(name, attributes, null);
-    }
-
     public static Integer getIntegerAttribute(String name, Map<String,Object> attributes, Integer defaultValue)
     {
         Object obj = attributes.get(name);
@@ -212,25 +160,6 @@ public class MapValueConverter
         }
     }
 
-    public static Integer getIntegerAttribute(String name, Map<String,Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getIntegerAttribute(name, attributes, null);
-    }
-
-    public static Long getLongAttribute(String name, Map<String,Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        Object obj = attributes.get(name);
-        return toLong(name, obj, null);
-    }
-
-    public static Long getLongAttribute(String name, Map<String,Object> attributes, Long defaultValue)
-    {
-        Object obj = attributes.get(name);
-        return toLong(name, obj, defaultValue);
-    }
-
     public static Long toLong(String name, Object obj)
     {
         return toLong(name, obj, null);
@@ -255,31 +184,6 @@ public class MapValueConverter
             throw new IllegalArgumentException("Value for attribute " + name + " is not of required type Long");
         }
     }
-
-    public static <T> Set<T> getSetAttribute(String name, Map<String,Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getSetAttribute(name, attributes, Collections.<T>emptySet());
-    }
-
-    @SuppressWarnings("unchecked")
-    public static <T> Set<T> getSetAttribute(String name, Map<String,Object> attributes, Set<T> defaultValue)
-    {
-        Object obj = attributes.get(name);
-        if(obj == null)
-        {
-            return defaultValue;
-        }
-        else if(obj instanceof Set)
-        {
-            return (Set<T>) obj;
-        }
-        else
-        {
-            throw new IllegalArgumentException("Value for attribute " + name + " is not of required type Set");
-        }
-    }
-
     public static <T extends Enum<T>> Set<T> getEnumSetAttribute(String name, Map<String, Object> attributes, Class<T> clazz)
     {
         Object obj = attributes.get(name);
@@ -293,107 +197,6 @@ public class MapValueConverter
         }
     }
 
-    public static Map<String, Object> convert(Map<String, Object> configurationAttributes, Map<String, Type> attributeTypes)
-    {
-        return convert(configurationAttributes, attributeTypes, true);
-    }
-
-    public static Map<String, Object> convert(Map<String, Object> configurationAttributes,
-                                              Map<String, Type> attributeTypes,
-                                              boolean exclusive)
-    {
-        Map<String, Object> attributes = new HashMap<String, Object>();
-        for (Map.Entry<String, Object> attribute : configurationAttributes.entrySet())
-        {
-            String attributeName = attribute.getKey();
-            Object rawValue = attribute.getValue();
-
-            if (attributeTypes.containsKey(attributeName))
-            {
-                Type typeObject = attributeTypes.get(attributeName);
-
-                Object value = null;
-                if (typeObject instanceof Class)
-                {
-                    Class<?> classObject = (Class<?>)typeObject;
-                    value =  convert(rawValue, classObject, attributeName);
-                }
-                else if (typeObject instanceof ParameterizedType)
-                {
-                    ParameterizedType parameterizedType= (ParameterizedType)typeObject;
-                    value = convertParameterizedType(rawValue, parameterizedType, attributeName);
-                }
-                else
-                {
-                    throw new IllegalArgumentException("Conversion into " + typeObject + " is not yet supported");
-                }
-                attributes.put(attributeName, value);
-            }
-            else if(!exclusive)
-            {
-                attributes.put(attributeName, rawValue);
-            }
-        }
-
-        return attributes;
-    }
-
-    private static Object convertParameterizedType(Object rawValue, ParameterizedType parameterizedType, String attributeName)
-    {
-        Type type = parameterizedType.getRawType();
-        Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
-        Object convertedValue;
-        if (type == Set.class)
-        {
-            if (actualTypeArguments.length != 1)
-            {
-                throw new IllegalArgumentException("Unexpected number of Set type arguments " + actualTypeArguments.length);
-            }
-            Class<?> classObject = (Class<?>)actualTypeArguments[0];
-            convertedValue = toSet(rawValue, classObject, attributeName);
-        }
-        else if (type == Map.class)
-        {
-            if (actualTypeArguments.length != 2)
-            {
-                throw new IllegalArgumentException("Unexpected number of Map type arguments " + actualTypeArguments.length);
-            }
-            Class<?> keyClassObject = (Class<?>)actualTypeArguments[0];
-            Class<?> valueClassObject = (Class<?>)actualTypeArguments[1];
-            convertedValue = toMap(rawValue, keyClassObject, valueClassObject, attributeName);
-        }
-        else
-        {
-            throw new IllegalArgumentException("Conversion into " + parameterizedType + " is not yet supported");
-        }
-        return convertedValue;
-    }
-
-    private static <K,V> Map<K, V> toMap(Object rawValue, Class<K> keyClassObject, Class<V> valueClassObject, String attributeName)
-    {
-        if (rawValue == null)
-        {
-            return null;
-        }
-        if (rawValue instanceof Map)
-        {
-             Map<K, V> convertedMap =  new HashMap<K, V>();
-             Map<?, ?> rawMap = (Map<?,?>)rawValue;
-
-             for (Map.Entry<?, ?> entry : rawMap.entrySet())
-             {
-                 K convertedKey = convert(entry.getKey(), keyClassObject, attributeName + " (map key)");
-                 V convertedValue = convert(entry.getValue(), valueClassObject,  attributeName + " (map value)");
-                 convertedMap.put(convertedKey, convertedValue);
-             }
-             return convertedMap;
-        }
-        else
-        {
-            throw new IllegalArgumentException("rawValue is not of unexpected type Map, was : " + rawValue.getClass());
-        }
-    }
-
     public static <T> Set<T> toSet(Object rawValue, Class<T> setItemClass, String attributeName)
     {
         if (rawValue == null)
@@ -463,41 +266,4 @@ public class MapValueConverter
         return (T) value;
     }
 
-
-    public static UUID getUUIDAttribute(String name, Map<String, Object> attributes)
-    {
-        assertMandatoryAttribute(name, attributes);
-        return getUUIDAttribute(name, attributes, null);
-    }
-
-    public static UUID getUUIDAttribute(String name, Map<String,Object> attributes, UUID defaultVal)
-    {
-        final Object value = attributes.get(name);
-        return toUUID(value, defaultVal);
-    }
-
-    private static UUID toUUID(final Object value, final UUID defaultVal)
-    {
-        if(value == null)
-        {
-            return defaultVal;
-        }
-        else if(value instanceof UUID)
-        {
-            return (UUID)value;
-        }
-        else if(value instanceof String)
-        {
-            return UUID.fromString((String)value);
-        }
-        else if(value instanceof byte[])
-        {
-            return UUID.nameUUIDFromBytes((byte[])value);
-        }
-        else
-        {
-            throw new IllegalArgumentException("Cannot convert " + value.getClass().getName() + " to UUID");
-        }
-    }
-
 }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/FileTrustStoreCreationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/FileTrustStoreCreationTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/FileTrustStoreCreationTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/FileTrustStoreCreationTest.java Fri Apr 18 22:38:03 2014
@@ -43,13 +43,13 @@ public class FileTrustStoreCreationTest 
 {
     public void testCreateWithAllAttributesProvided()
     {
-        Map<String, Object> attributes = getTrustStoreAttributes();
+        UUID id = UUID.randomUUID();
+        Map<String, Object> attributes = getTrustStoreAttributes(id);
         Map<String, Object> attributesCopy = new HashMap<String, Object>(attributes);
 
-        UUID id = UUID.randomUUID();
         Broker broker = mock(Broker.class);
 
-        final FileTrustStore trustStore = new FileTrustStoreImpl(id, broker, attributes);
+        final FileTrustStore trustStore = new FileTrustStoreImpl(attributes, broker);
         trustStore.open();
         assertNotNull("Trust store configured object is not created", trustStore);
         assertEquals(id, trustStore.getId());
@@ -81,9 +81,9 @@ public class FileTrustStoreCreationTest 
 
     public void testCreateWithMissedRequiredAttributes()
     {
-        Map<String, Object> attributes = getTrustStoreAttributes();
-
         UUID id = UUID.randomUUID();
+        Map<String, Object> attributes = getTrustStoreAttributes(id);
+
         Broker broker = mock(Broker.class);
 
         String[] mandatoryProperties = {TrustStore.NAME, FileTrustStore.PATH, FileTrustStore.PASSWORD};
@@ -93,7 +93,7 @@ public class FileTrustStoreCreationTest 
             properties.remove(mandatoryProperties[i]);
             try
             {
-                TrustStore trustStore = new FileTrustStoreImpl(id, broker, properties);
+                TrustStore trustStore = new FileTrustStoreImpl(properties, broker);
                 trustStore.open();
                 fail("Cannot create key store without a " + mandatoryProperties[i]);
             }
@@ -104,10 +104,11 @@ public class FileTrustStoreCreationTest 
         }
     }
 
-    private Map<String, Object> getTrustStoreAttributes()
+    private Map<String, Object> getTrustStoreAttributes(UUID id)
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(TrustStore.NAME, getName());
+        attributes.put(TrustStore.ID, id);
         attributes.put(FileTrustStore.PATH, TestSSLConstants.BROKER_TRUSTSTORE);
         attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.BROKER_TRUSTSTORE_PASSWORD);
         attributes.put(FileTrustStore.TRUST_STORE_TYPE, "jks");

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderCreationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderCreationTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderCreationTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/PreferencesProviderCreationTest.java Fri Apr 18 22:38:03 2014
@@ -89,6 +89,7 @@ public class PreferencesProviderCreation
 
         Map<String, Object> attributes = new HashMap<String, Object>();
         UUID id = UUID.randomUUID();
+        attributes.put(PreferencesProvider.ID, id);
         attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.PROVIDER_TYPE);
         attributes.put(PreferencesProvider.NAME, "test-provider");
         File file = TestFileUtils.createTempFile(this,
@@ -97,7 +98,7 @@ public class PreferencesProviderCreation
         try
         {
             attributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
-            PreferencesProvider provider = new FileSystemPreferencesProviderImpl(id,attributes,_authenticationProvider);
+            PreferencesProvider provider = new FileSystemPreferencesProviderImpl(attributes,_authenticationProvider);
             provider.open();
             assertNotNull("Preferences provider was not recovered", provider);
             assertEquals("Unexpected name", "test-provider", provider.getName());

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java Fri Apr 18 22:38:03 2014
@@ -69,7 +69,7 @@ public class FanoutExchangeTest extends 
         when(_virtualHost.getSecurityManager()).thenReturn(securityManager);
         when(_virtualHost.getEventLogger()).thenReturn(new EventLogger());
         when(_virtualHost.getTaskExecutor()).thenReturn(_taskExecutor);
-        _exchange = new FanoutExchange(_virtualHost, attributes);
+        _exchange = new FanoutExchange(attributes, _virtualHost);
         _exchange.open();
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java Fri Apr 18 22:38:03 2014
@@ -34,6 +34,7 @@ import junit.framework.TestCase;
 import org.apache.qpid.server.binding.BindingImpl;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.message.AMQMessageHeader;
+import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
@@ -166,7 +167,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -177,7 +179,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("A", "Value of A");
         matchHeaders.setString("B", "Value of B");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -187,7 +190,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Altered value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertFalse(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -198,7 +202,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -210,7 +215,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertFalse(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -223,7 +229,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("A", "Value of A");
         matchHeaders.setString("B", "Value of B");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -237,7 +244,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("B", "Value of B");
         matchHeaders.setString("C", "Value of C");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -251,7 +259,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("B", "Altered value of B");
         matchHeaders.setString("C", "Value of C");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertFalse(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -262,7 +271,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -274,7 +284,8 @@ public class HeadersBindingTest extends 
 
         matchHeaders.setString("A", "Value of A");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -287,7 +298,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("A", "Value of A");
         matchHeaders.setString("B", "Value of B");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -301,7 +313,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("B", "Value of B");
         matchHeaders.setString("C", "Value of C");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -315,7 +328,8 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("B", "Altered value of B");
         matchHeaders.setString("C", "Value of C");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertTrue(new HeadersBinding(b).matches(matchHeaders));
     }
 
@@ -329,10 +343,28 @@ public class HeadersBindingTest extends 
         matchHeaders.setString("B", "Altered value of B");
         matchHeaders.setString("C", "Value of C");
 
-        BindingImpl b = new BindingImpl(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
+        BindingImpl b =
+                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
         assertFalse(new HeadersBinding(b).matches(matchHeaders));
     }
 
+    public static BindingImpl createBinding(UUID id,
+                                            final String bindingKey,
+                                            final AMQQueue queue,
+                                            final ExchangeImpl exchange,
+                                            final Map<String, Object> arguments)
+    {
+        Map<String, Object> attributes = new HashMap<String, Object>();
+        attributes.put(Binding.NAME, bindingKey);
+        if(arguments != null)
+        {
+            attributes.put(Binding.ARGUMENTS, arguments);
+        }
+        attributes.put(Binding.ID, id);
+        return new BindingImpl(attributes, queue, exchange);
+    }
+
+
     public static junit.framework.Test suite()
     {
         return new junit.framework.TestSuite(HeadersBindingTest.class);

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java Fri Apr 18 22:38:03 2014
@@ -76,7 +76,7 @@ public class HeadersExchangeTest extends
         attributes.put(Exchange.NAME, "test");
         attributes.put(Exchange.DURABLE, false);
 
-        _exchange = new HeadersExchange(_virtualHost, attributes);
+        _exchange = new HeadersExchange(attributes, _virtualHost);
 
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java Fri Apr 18 22:38:03 2014
@@ -34,6 +34,7 @@ import org.apache.qpid.server.binding.Bi
 import org.apache.qpid.server.message.InstanceProperties;
 import org.apache.qpid.server.message.MessageReference;
 import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.UUIDGenerator;
@@ -62,7 +63,7 @@ public class TopicExchangeTest extends Q
         attributes.put(Exchange.NAME, "test");
         attributes.put(Exchange.DURABLE, false);
 
-        _exchange = new TopicExchange(_vhost, attributes);
+        _exchange = new TopicExchange(attributes, _vhost);
     }
 
     @Override
@@ -93,7 +94,7 @@ public class TopicExchangeTest extends Q
     public void testNoRoute() throws Exception
     {
         AMQQueue<?> queue = createQueue("a*#b");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.*.#.b",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.*.#.b", queue, _exchange, null));
 
 
         routeMessage("a.b", 0l);
@@ -104,7 +105,7 @@ public class TopicExchangeTest extends Q
     public void testDirectMatch() throws Exception
     {
         AMQQueue<?> queue = createQueue("ab");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.b",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.b", queue, _exchange, null));
 
 
         routeMessage("a.b",0l);
@@ -126,7 +127,7 @@ public class TopicExchangeTest extends Q
     public void testStarMatch() throws Exception
     {
         AMQQueue<?> queue = createQueue("a*");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.*",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.*", queue, _exchange, null));
 
 
         routeMessage("a.b",0l);
@@ -157,7 +158,7 @@ public class TopicExchangeTest extends Q
     public void testHashMatch() throws Exception
     {
         AMQQueue<?> queue = createQueue("a#");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.#",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.#", queue, _exchange, null));
 
 
         routeMessage("a.b.c",0l);
@@ -208,7 +209,7 @@ public class TopicExchangeTest extends Q
     public void testMidHash() throws Exception
     {
         AMQQueue<?> queue = createQueue("a");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.*.#.b",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.*.#.b", queue, _exchange, null));
 
         routeMessage("a.c.d.b",0l);
 
@@ -233,7 +234,7 @@ public class TopicExchangeTest extends Q
     public void testMatchAfterHash() throws Exception
     {
         AMQQueue<?> queue = createQueue("a#");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.*.#.b.c",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.*.#.b.c", queue, _exchange, null));
 
 
         int queueCount = routeMessage("a.c.b.b",0l);
@@ -271,7 +272,11 @@ public class TopicExchangeTest extends Q
     public void testHashAfterHash() throws Exception
     {
         AMQQueue<?> queue = createQueue("a#");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.*.#.b.c.#.d",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(),
+                                                              "a.*.#.b.c.#.d",
+                                                              queue,
+                                                              _exchange,
+                                                              null));
 
         int queueCount = routeMessage("a.c.b.b.c",0l);
         Assert.assertEquals("Message should not route to any queues", 0, queueCount);
@@ -292,7 +297,7 @@ public class TopicExchangeTest extends Q
     public void testHashHash() throws Exception
     {
         AMQQueue<?> queue = createQueue("a#");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.#.*.#.d",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.#.*.#.d", queue, _exchange, null));
 
         int queueCount = routeMessage("a.c.b.b.c",0l);
         Assert.assertEquals("Message should not route to any queues", 0, queueCount);
@@ -313,7 +318,7 @@ public class TopicExchangeTest extends Q
     public void testSubMatchFails() throws Exception
     {
         AMQQueue<?> queue = createQueue("a");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.b.c.d",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.b.c.d", queue, _exchange, null));
 
         int queueCount = routeMessage("a.b.c",0l);
         Assert.assertEquals("Message should not route to any queues", 0, queueCount);
@@ -342,7 +347,7 @@ public class TopicExchangeTest extends Q
     public void testMoreRouting() throws Exception
     {
         AMQQueue<?> queue = createQueue("a");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.b",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.b", queue, _exchange, null));
 
 
         int queueCount = routeMessage("a.b.c",0l);
@@ -355,7 +360,7 @@ public class TopicExchangeTest extends Q
     public void testMoreQueue() throws Exception
     {
         AMQQueue<?> queue = createQueue("a");
-        _exchange.registerQueue(new BindingImpl(UUID.randomUUID(), "a.b",queue, _exchange, null));
+        _exchange.registerQueue(createBinding(UUID.randomUUID(), "a.b", queue, _exchange, null));
 
 
         int queueCount = routeMessage("a",0l);
@@ -365,4 +370,21 @@ public class TopicExchangeTest extends Q
 
     }
 
+    private static BindingImpl createBinding(UUID id,
+                                                final String bindingKey,
+                                                final AMQQueue queue,
+                                                final ExchangeImpl exchange,
+                                                final Map<String, Object> arguments)
+    {
+        Map<String, Object> attributes = new HashMap<String, Object>();
+        attributes.put(Binding.NAME, bindingKey);
+        if(arguments != null)
+        {
+            attributes.put(Binding.ARGUMENTS, arguments);
+        }
+        attributes.put(Binding.ID, id);
+        return new BindingImpl(attributes, queue, exchange);
+    }
+
+
 }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderFactoryTest.java Fri Apr 18 22:38:03 2014
@@ -75,7 +75,7 @@ public class FileSystemPreferencesProvid
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         UUID id = UUID.randomUUID();
-        attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.class);
+        attributes.put(PreferencesProvider.TYPE, "FileSystemPreferences");
         attributes.put(PreferencesProvider.NAME, "test-provider");
         File file = TestFileUtils.createTempFile(this, ".prefs.json", "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
         try
@@ -99,7 +99,7 @@ public class FileSystemPreferencesProvid
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         UUID id = UUID.randomUUID();
-        attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.class);
+        attributes.put(PreferencesProvider.TYPE, "FileSystemPreferences");
         attributes.put(PreferencesProvider.NAME, "test-provider");
         File file = new File(TMP_FOLDER, UUID.randomUUID() + "prefs.json");
         assertFalse("Preferences store file should not exist", file.exists());
@@ -119,7 +119,7 @@ public class FileSystemPreferencesProvid
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         UUID id = UUID.randomUUID();
-        attributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.class);
+        attributes.put(PreferencesProvider.TYPE, "FileSystemPreferences");
         attributes.put(PreferencesProvider.NAME, "test-provider");
         File file = new File(TMP_FOLDER, UUID.randomUUID() + "prefs.json");
         assertFalse("Preferences store file should not exist", file.exists());

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/FileSystemPreferencesProviderTest.java Fri Apr 18 22:38:03 2014
@@ -97,8 +97,9 @@ public class FileSystemPreferencesProvid
         {
             Map<String, Object> attributes = new HashMap<String, Object>();
             attributes.put(FileSystemPreferencesProvider.PATH, nonExistingFile.getAbsolutePath());
+            attributes.put(ConfiguredObject.ID, UUID.randomUUID());
             attributes.put(ConfiguredObject.NAME, getTestName());
-            _preferencesProvider = new FileSystemPreferencesProviderImpl(UUID.randomUUID(), attributes, _authenticationProvider);
+            _preferencesProvider = new FileSystemPreferencesProviderImpl(attributes, _authenticationProvider);
             _preferencesProvider.open();
 
             assertEquals(State.INITIALISING, _preferencesProvider.getState());
@@ -118,9 +119,10 @@ public class FileSystemPreferencesProvid
         try
         {
             Map<String, Object> attributes = new HashMap<String, Object>();
+            attributes.put(ConfiguredObject.ID, UUID.randomUUID());
             attributes.put(ConfiguredObject.NAME, getTestName());
             attributes.put(FileSystemPreferencesProvider.PATH, emptyPrefsFile.getAbsolutePath());
-            _preferencesProvider = new FileSystemPreferencesProviderImpl(UUID.randomUUID(), attributes, _authenticationProvider);
+            _preferencesProvider = new FileSystemPreferencesProviderImpl(attributes, _authenticationProvider);
             assertEquals(State.INITIALISING, _preferencesProvider.getState());
             _preferencesProvider.close();
         }
@@ -280,8 +282,9 @@ public class FileSystemPreferencesProvid
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(FileSystemPreferencesProvider.PATH, _preferencesFile.getAbsolutePath());
+        attributes.put(ConfiguredObject.ID, UUID.randomUUID());
         attributes.put(ConfiguredObject.NAME, "test");
-        _preferencesProvider = new FileSystemPreferencesProviderImpl(UUID.randomUUID(), attributes, _authenticationProvider);
+        _preferencesProvider = new FileSystemPreferencesProviderImpl(attributes, _authenticationProvider);
         _preferencesProvider.open();
         return _preferencesProvider;
     }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java Fri Apr 18 22:38:03 2014
@@ -1101,7 +1101,7 @@ abstract class AbstractQueueTestBase ext
 
         public NonAsyncDeliverQueue(VirtualHostImpl vhost)
         {
-            super(vhost, attributes());
+            super(attributes(), vhost);
         }
 
         @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/LastValueQueueListTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/LastValueQueueListTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/LastValueQueueListTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/LastValueQueueListTest.java Fri Apr 18 22:38:03 2014
@@ -58,7 +58,7 @@ public class LastValueQueueListTest exte
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        _queue = new LastValueQueueImpl(virtualHost, queueAttributes);
+        _queue = new LastValueQueueImpl(queueAttributes, virtualHost);
         _queue.open();
         _list = _queue.getEntries();
     }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java Fri Apr 18 22:38:03 2014
@@ -58,7 +58,7 @@ public class PriorityQueueListTest exten
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        PriorityQueueImpl queue = new PriorityQueueImpl(virtualHost, queueAttributes);
+        PriorityQueueImpl queue = new PriorityQueueImpl(queueAttributes, virtualHost);
         queue.open();
         _list = queue.getEntries();
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java Fri Apr 18 22:38:03 2014
@@ -199,7 +199,7 @@ public abstract class QueueEntryImplTest
         when(virtualHost.getSecurityManager()).thenReturn(mock(org.apache.qpid.server.security.SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
 
-        StandardQueueImpl queue = new StandardQueueImpl(virtualHost, queueAttributes);
+        StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, virtualHost);
         queue.open();
         OrderedQueueEntryList queueEntryList = queue.getEntries();
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java Fri Apr 18 22:38:03 2014
@@ -47,7 +47,7 @@ public class SimpleQueueEntryImplTest ex
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(org.apache.qpid.server.security.SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        StandardQueueImpl queue = new StandardQueueImpl(virtualHost, queueAttributes);
+        StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, virtualHost);
         queue.open();
         queueEntryList = queue.getEntries();
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryListTest.java Fri Apr 18 22:38:03 2014
@@ -86,7 +86,7 @@ public class SortedQueueEntryListTest ex
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        _testQueue = new SortedQueueImpl(virtualHost, attributes)
+        _testQueue = new SortedQueueImpl(attributes, virtualHost)
         {
             SelfValidatingSortedQueueEntryList _entries;
             @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/SortedQueueEntryTest.java Fri Apr 18 22:38:03 2014
@@ -56,7 +56,7 @@ public class SortedQueueEntryTest extend
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(org.apache.qpid.server.security.SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        SortedQueueImpl queue = new SortedQueueImpl(virtualHost, attributes)
+        SortedQueueImpl queue = new SortedQueueImpl(attributes, virtualHost)
         {
             SelfValidatingSortedQueueEntryList _entries;
             @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueEntryListTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueEntryListTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueEntryListTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueEntryListTest.java Fri Apr 18 22:38:03 2014
@@ -55,7 +55,7 @@ public class StandardQueueEntryListTest 
         final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
         when(virtualHost.getSecurityManager()).thenReturn(mock(SecurityManager.class));
         when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-        _testQueue = new StandardQueueImpl(virtualHost, queueAttributes);
+        _testQueue = new StandardQueueImpl(queueAttributes, virtualHost);
         _testQueue.open();
         _sqel = _testQueue.getEntries();
         for(int i = 1; i <= 100; i++)
@@ -101,7 +101,7 @@ public class StandardQueueEntryListTest 
             final VirtualHostImpl virtualHost = mock(VirtualHostImpl.class);
             when(virtualHost.getSecurityManager()).thenReturn(mock(SecurityManager.class));
             when(virtualHost.getEventLogger()).thenReturn(new EventLogger());
-            StandardQueueImpl queue = new StandardQueueImpl(virtualHost, queueAttributes);
+            StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, virtualHost);
             queue.open();
             return queue.getEntries();
         }

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/StandardQueueTest.java Fri Apr 18 22:38:03 2014
@@ -49,7 +49,7 @@ public class StandardQueueTest extends A
         queueAttributes.put(Queue.ID, UUID.randomUUID());
         queueAttributes.put(Queue.NAME, getQname());
         queueAttributes.put(Queue.LIFETIME_POLICY, LifetimePolicy.DELETE_ON_NO_OUTBOUND_LINKS);
-        final StandardQueueImpl queue = new StandardQueueImpl(getVirtualHost(), queueAttributes);
+        final StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, getVirtualHost());
         queue.open();
         setQueue(queue);
 
@@ -72,7 +72,7 @@ public class StandardQueueTest extends A
         queueAttributes.put(Queue.ID, UUID.randomUUID());
         queueAttributes.put(Queue.NAME, "testActiveConsumerCount");
         queueAttributes.put(Queue.OWNER, "testOwner");
-        final StandardQueueImpl queue = new StandardQueueImpl(getVirtualHost(), queueAttributes);
+        final StandardQueueImpl queue = new StandardQueueImpl(queueAttributes, getVirtualHost());
         queue.open();
         //verify adding an active consumer increases the count
         final MockConsumer consumer1 = new MockConsumer();
@@ -180,7 +180,7 @@ public class StandardQueueTest extends A
         queueAttributes.put(Queue.ID, UUID.randomUUID());
         queueAttributes.put(Queue.NAME, "test");
         // create queue with overridden method deliverAsync
-        StandardQueueImpl testQueue = new StandardQueueImpl(getVirtualHost(), queueAttributes)
+        StandardQueueImpl testQueue = new StandardQueueImpl(queueAttributes, getVirtualHost())
         {
             @Override
             public void deliverAsync(QueueConsumer sub)
@@ -253,7 +253,7 @@ public class StandardQueueTest extends A
 
         public DequeuedQueue(VirtualHostImpl virtualHost)
         {
-            super(virtualHost, attributes());
+            super(attributes(), virtualHost);
         }
 
         @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java Fri Apr 18 22:38:03 2014
@@ -46,7 +46,7 @@ public class AnonymousAuthenticationMana
         Map<String,Object> attrs = new HashMap<String, Object>();
         attrs.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrs.put(AuthenticationProvider.NAME, getTestName());
-        _manager = new AnonymousAuthenticationManager(mock(Broker.class), attrs);
+        _manager = new AnonymousAuthenticationManager(attrs, mock(Broker.class));
 
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java Fri Apr 18 22:38:03 2014
@@ -48,13 +48,13 @@ public class ExternalAuthenticationManag
         attrs.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrs.put(AuthenticationProvider.NAME, getTestName());
         attrs.put("useFullDN",false);
-        _manager = new ExternalAuthenticationManagerImpl(mock(Broker.class), attrs);
+        _manager = new ExternalAuthenticationManagerImpl(attrs, mock(Broker.class));
         _manager.open();
         HashMap<String, Object> attrsFullDN = new HashMap<String, Object>();
         attrsFullDN.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrsFullDN.put(AuthenticationProvider.NAME, getTestName()+"FullDN");
         attrsFullDN.put("useFullDN",true);
-        _managerUsingFullDN = new ExternalAuthenticationManagerImpl(mock(Broker.class), attrsFullDN);
+        _managerUsingFullDN = new ExternalAuthenticationManagerImpl(attrsFullDN, mock(Broker.class));
         _managerUsingFullDN.open();
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java Fri Apr 18 22:38:03 2014
@@ -105,7 +105,7 @@ public class PrincipalDatabaseAuthentica
         attrs.put(ConfiguredObject.ID, UUID.randomUUID());
         attrs.put(ConfiguredObject.NAME, getTestName());
         attrs.put("path", _passwordFileLocation);
-        _manager = new PrincipalDatabaseAuthenticationManager(mock(Broker.class), attrs)
+        _manager = new PrincipalDatabaseAuthenticationManager(attrs, mock(Broker.class))
         {
             @Override
             protected PrincipalDatabase createDatabase()

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java Fri Apr 18 22:38:03 2014
@@ -58,7 +58,7 @@ public class ScramSHA1AuthenticationMana
         final Map<String, Object> attributesMap = new HashMap<String, Object>();
         attributesMap.put(AuthenticationProvider.NAME, getTestName());
         attributesMap.put(AuthenticationProvider.ID, UUID.randomUUID());
-        _authManager = new ScramSHA1AuthenticationManager(_broker, attributesMap);
+        _authManager = new ScramSHA1AuthenticationManager(attributesMap, _broker);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java Fri Apr 18 22:38:03 2014
@@ -51,8 +51,8 @@ public class SimpleAuthenticationManager
         Map<String,Object> authManagerAttrs = new HashMap<String, Object>();
         authManagerAttrs.put(AuthenticationProvider.NAME,"MANAGEMENT_MODE_AUTHENTICATION");
         authManagerAttrs.put(AuthenticationProvider.ID, UUID.randomUUID());
-        final SimpleAuthenticationManager authManager = new SimpleAuthenticationManager(mock(Broker.class),
-                                                                                        authManagerAttrs);
+        final SimpleAuthenticationManager authManager = new SimpleAuthenticationManager(authManagerAttrs, mock(Broker.class)
+        );
         authManager.addUser(TEST_USER, TEST_PASSWORD);
         _authenticationManager = authManager;
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java Fri Apr 18 22:38:03 2014
@@ -168,8 +168,8 @@ public abstract class AbstractDurableCon
     {
         ExchangeImpl<?> exchange = createTestExchange();
         AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false, null);
-        BindingImpl binding = new BindingImpl(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
-                exchange, _bindingArgs);
+        BindingImpl binding = createBinding(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
+                                                            exchange, _bindingArgs);
         DurableConfigurationStoreHelper.createExchange(_configStore, exchange);
         DurableConfigurationStoreHelper.createQueue(_configStore, queue);
         DurableConfigurationStoreHelper.createBinding(_configStore, binding);
@@ -260,8 +260,8 @@ public abstract class AbstractDurableCon
         DurableConfigurationStoreHelper.createExchange(_configStore, exchange);
 
         AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false, null);
-        BindingImpl binding = new BindingImpl(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
-                exchange, _bindingArgs);
+        BindingImpl binding = createBinding(UUIDGenerator.generateRandomUUID(), ROUTING_KEY, queue,
+                                                            exchange, _bindingArgs);
         DurableConfigurationStoreHelper.createBinding(_configStore, binding);
 
         DurableConfigurationStoreHelper.removeBinding(_configStore, binding);
@@ -504,4 +504,21 @@ public abstract class AbstractDurableCon
             _configStore.closeConfigurationStore();
         }
     }
+
+    private static BindingImpl createBinding(UUID id,
+                                             final String bindingKey,
+                                             final AMQQueue queue,
+                                             final ExchangeImpl exchange,
+                                             final Map<String, Object> arguments)
+    {
+        Map<String, Object> attributes = new HashMap<String, Object>();
+        attributes.put(Binding.NAME, bindingKey);
+        if(arguments != null)
+        {
+            attributes.put(Binding.ARGUMENTS, arguments);
+        }
+        attributes.put(Binding.ID, id);
+        return new BindingImpl(attributes, queue, exchange);
+    }
+
 }

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactory.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactory.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactory.java Fri Apr 18 22:38:03 2014
@@ -47,7 +47,7 @@ public class ACLFileAccessControlProvide
     public ACLFileAccessControlProviderImpl createInstance(final Map<String, Object> attributes,
                                                        final ConfiguredObject<?>... parents)
     {
-        return new ACLFileAccessControlProviderImpl(getParent(Broker.class,parents), attributes);
+        return new ACLFileAccessControlProviderImpl(attributes, getParent(Broker.class,parents));
     }
 
 }

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java Fri Apr 18 22:38:03 2014
@@ -56,8 +56,7 @@ public class ACLFileAccessControlProvide
     @ManagedAttributeField
     private String _path;
 
-    public ACLFileAccessControlProviderImpl(Broker broker,
-                                            Map<String, Object> attributes)
+    public ACLFileAccessControlProviderImpl(Map<String, Object> attributes, Broker broker)
     {
         super(parentsMap(broker),
               attributes, broker.getTaskExecutor());

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1588586&r1=1588585&r2=1588586&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Fri Apr 18 22:38:03 2014
@@ -30,7 +30,7 @@ import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.UUID;
+import java.util.Set;
 
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.SSLContext;
@@ -70,7 +70,6 @@ import org.apache.qpid.server.management
 import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.model.adapter.AbstractPluginAdapter;
 import org.apache.qpid.server.model.port.AbstractPortWithAuthProvider;
-import org.apache.qpid.server.util.MapValueConverter;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 import org.apache.qpid.transport.network.security.ssl.QpidMultipleTrustManager;
 
@@ -122,9 +121,9 @@ public class HttpManagement extends Abst
     @ManagedAttributeField
     private int _sessionTimeout;
 
-    public HttpManagement(UUID id, Broker broker, Map<String, Object> attributes)
+    public HttpManagement(Map<String, Object> attributes, Broker broker)
     {
-        super(id, attributes, broker);
+        super(attributes, broker);
     }
 
     @Override
@@ -389,7 +388,7 @@ public class HttpManagement extends Abst
         for (Connector connector : connectors)
         {
             getBroker().getEventLogger().message(ManagementConsoleMessages.LISTENING(stringifyConnectorScheme(connector),
-                                                                  connector.getPort()));
+                                                                                     connector.getPort()));
             if (connector instanceof SslSocketConnector)
             {
                 SslContextFactory sslContextFactory = ((SslSocketConnector)connector).getSslContextFactory();
@@ -460,28 +459,22 @@ public class HttpManagement extends Abst
     }
 
     @Override
-    protected void changeAttributes(Map<String, Object> attributes)
+    protected void validateChange(final ConfiguredObject<?> proxyForValidation, final Set<String> changedAttributes)
     {
-        Map<String, Object> convertedAttributes = MapValueConverter.convert(attributes, ATTRIBUTE_TYPES);
-        validateAttributes(convertedAttributes);
+        super.validateChange(proxyForValidation, changedAttributes);
 
-        super.changeAttributes(convertedAttributes);
-    }
-
-    private void validateAttributes(Map<String, Object> convertedAttributes)
-    {
-        if(convertedAttributes.containsKey(HttpManagement.NAME))
+        HttpManagementConfiguration<?> updated = (HttpManagementConfiguration<?>)proxyForValidation;
+        if(changedAttributes.contains(HttpManagement.NAME))
         {
-            String newName = (String) convertedAttributes.get(HttpManagement.NAME);
-            if(!getName().equals(newName))
+            if(!getName().equals(updated.getName()))
             {
                 throw new IllegalConfigurationException("Changing the name of http management plugin is not allowed");
             }
         }
-        if (convertedAttributes.containsKey(TIME_OUT))
+        if (changedAttributes.contains(TIME_OUT))
         {
-            Number value = (Number) convertedAttributes.get(TIME_OUT);
-            if (value == null || value.longValue() < 0)
+            int value = updated.getSessionTimeout();
+            if (value < 0)
             {
                 throw new IllegalConfigurationException("Only positive integer value can be specified for the session time out attribute");
             }



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


Mime
View raw message