qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1432184 - in /qpid/branches/java-broker-config-qpid-4390/qpid/java: broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/ broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ broker/src/m...
Date Fri, 11 Jan 2013 17:39:13 GMT
Author: orudyy
Date: Fri Jan 11 17:39:12 2013
New Revision: 1432184

URL: http://svn.apache.org/viewvc?rev=1432184&view=rev
Log:
QPID-4390: Add default attributes support

Modified:
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/AmqpPortAdapter.java

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
Fri Jan 11 17:39:12 2013
@@ -24,6 +24,7 @@ import java.io.File;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.UUID;
 
 import org.apache.log4j.Logger;
@@ -92,9 +93,9 @@ public class HttpManagement extends Abst
 
     private final HttpConfiguration _configuration;
 
-    public HttpManagement(UUID id, Broker broker, HttpConfiguration configuration)
+    public HttpManagement(UUID id, Broker broker, HttpConfiguration configuration, Map<String,
Object> defaults)
     {
-        super(id);
+        super(id, defaults);
         _broker = broker;
         _configuration = configuration;
         addParent(Broker.class, broker);

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java
Fri Jan 11 17:39:12 2013
@@ -61,6 +61,8 @@ public class HttpManagementFactory imple
                 getStringAttribute(KEY_STORE_PATH, attributes, null),
                 getStringAttribute(KEY_STORE_PASSWORD, attributes, null)
                 );
-        return new HttpManagement( id, broker, configuration);
+        //TODO: create defaults
+        Map<String, Object> defaults = null;
+        return new HttpManagement( id, broker, configuration, defaults);
     }
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
Fri Jan 11 17:39:12 2013
@@ -70,9 +70,9 @@ public class JMXManagement extends Abstr
 
     private final JMXConfiguration _jmxConfiguration;
 
-    public JMXManagement(UUID id, Broker broker, JMXConfiguration jmxConfiguration)
+    public JMXManagement(UUID id, Broker broker, JMXConfiguration jmxConfiguration, Map<String,
Object> defaults)
     {
-        super(id);
+        super(id, defaults);
         _broker = broker;
         _jmxConfiguration = jmxConfiguration;
     }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java
Fri Jan 11 17:39:12 2013
@@ -55,7 +55,9 @@ public class JMXManagementFactory implem
                     getStringAttribute(KEY_STORE_PASSWORD, attributes, null),
                     getBooleanAttribute(MANAGEMENT_RIGHTS_INFER_ALL_ACCESS, attributes, true));
 
-            return new JMXManagement(id, broker, jmxConfiguration);
+            //TODO: create defaults
+            Map<String, Object> defaults = null;
+            return new JMXManagement(id, broker, jmxConfiguration, defaults);
         }
         else
         {

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/BrokerRecoverer.java
Fri Jan 11 17:39:12 2013
@@ -28,6 +28,7 @@ public class BrokerRecoverer implements 
     private final RootMessageLogger _rootMessageLogger;
     private final AuthenticationProviderFactory _authenticationProviderFactory;
     private final PortFactory _portFactory;
+    private Map<String, Object> _defaults;
 
     public BrokerRecoverer(AuthenticationProviderFactory authenticationProviderFactory, PortFactory
portFactory,
             StatisticsGatherer statisticsGatherer, VirtualHostRegistry virtualHostRegistry,
LogRecorder logRecorder,
@@ -44,7 +45,7 @@ public class BrokerRecoverer implements 
     @Override
     public Broker create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject...
parents)
     {
-        BrokerAdapter broker = new BrokerAdapter(entry.getId(), entry.getAttributes(), _statisticsGatherer,
+        BrokerAdapter broker = new BrokerAdapter(entry.getId(), entry.getAttributes(), _defaults,
_statisticsGatherer,
                 _virtualHostRegistry, _logRecorder, _rootMessageLogger, _authenticationProviderFactory,
_portFactory);
         Map<String, Collection<ConfigurationEntry>> childEntries = entry.getChildren();
         for (String type : childEntries.keySet())

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/GroupProviderRecoverer.java
Fri Jan 11 17:39:12 2013
@@ -54,7 +54,9 @@ public class GroupProviderRecoverer impl
         {
             throw new IllegalConfigurationException("Cannot create GroupManager from attributes
: " + attributes);
         }
-        GroupProviderAdapter groupProviderAdapter = new GroupProviderAdapter(configurationEntry.getId(),
groupManager, broker);
+        //TODO: add defaults
+        Map<String, Object> defaults = null;
+        GroupProviderAdapter groupProviderAdapter = new GroupProviderAdapter(configurationEntry.getId(),
groupManager, broker, defaults);
         return groupProviderAdapter;
     }
 

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/startup/VirtualHostRecoverer.java
Fri Jan 11 17:39:12 2013
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.configuration.startup;
 
+import java.util.Map;
+
 import org.apache.qpid.server.configuration.ConfigurationEntry;
 import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
 import org.apache.qpid.server.configuration.RecovererProvider;
@@ -43,7 +45,10 @@ public class VirtualHostRecoverer implem
     public VirtualHost create(RecovererProvider recovererProvider, ConfigurationEntry entry,
ConfiguredObject... parents)
     {
         Broker broker = RecovererHelper.verifyOnlyBrokerIsParent(parents);
-        return new VirtualHostAdapter(entry.getId(), entry.getAttributes(),broker, _brokerStatisticsGatherer);
+
+        //TODO add defaults
+        Map<String, Object> defaults = null;
+        return new VirtualHostAdapter(entry.getId(), entry.getAttributes(),broker, _brokerStatisticsGatherer,
defaults);
     }
 
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
Fri Jan 11 17:39:12 2013
@@ -201,14 +201,27 @@ public interface ConfiguredObject
 
 
     /**
-     * Return the value for the given attribute
-     *
-     * @param name the name of the attribute
-     * @return the value of the attribute at the object (or null if the attribute is not
set
+     * Return the value for the given attribute name. The actual attribute value
+     * is returned if the configured object has such attribute set. If not, the
+     * value is looked in parent hierarchy from bottom to top. If no parent has
+     * an attribute set than the value is looked in the object default attributes.
+     *
+     * @param name
+     *            the name of the attribute
+     * @return the value of the attribute at the object (or null if the
+     *         attribute value is set neither on object itself, no object
+     *         parents, no in defaults)
      */
     Object getAttribute(String name);
 
     /**
+     * Return the map containing only explicitly set attributes
+     *
+     * @return the map with the attributes
+     */
+    Map<String, Object> getActualAttributes();
+
+    /**
      * Set the value of an attribute
      *
      * @param name the name of the attribute to be set

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
Fri Jan 11 17:39:12 2013
@@ -41,10 +41,15 @@ abstract class AbstractAdapter implement
             new ArrayList<ConfigurationChangeListener>();
 
     private final UUID _id;
+    private final Map<String, Object> _defaultAttributes = new HashMap<String, Object>();
 
-    protected AbstractAdapter(UUID id)
+    protected AbstractAdapter(UUID id, Map<String, Object> defaults)
     {
         _id = id;
+        if (defaults != null)
+        {
+            _defaultAttributes.putAll(defaults);
+        }
     }
 
     public final UUID getId()
@@ -135,7 +140,33 @@ abstract class AbstractAdapter implement
         }
     }
 
-    public Object getAttribute(final String name)
+
+    private final Object getDefaultAttribute(String name)
+    {
+        return _defaultAttributes.get(name);
+    }
+
+    @Override
+    public Object getAttribute(String name)
+    {
+        Object value = getActualAttribute(name);
+        if (value == null)
+        {
+            value = getDefaultAttribute(name);
+        }
+        return value;
+    }
+
+    @Override
+    public final Map<String, Object> getActualAttributes()
+    {
+        synchronized (this)
+        {
+            return new HashMap<String, Object>(_attributes);
+        }
+    }
+
+    private Object getActualAttribute(final String name)
     {
         synchronized (this)
         {
@@ -148,7 +179,7 @@ abstract class AbstractAdapter implement
     {
         synchronized (this)
         {
-            Object currentValue = _attributes.get(name);
+            Object currentValue = getAttribute(name);
             if((currentValue == null && expected == null)
                || (currentValue != null && currentValue.equals(expected)))
             {

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractKeyStoreAdapter.java
Fri Jan 11 17:39:12 2013
@@ -42,7 +42,7 @@ public abstract class AbstractKeyStoreAd
 
     protected AbstractKeyStoreAdapter(UUID id, Broker broker, Map<String, Object> attributes)
     {
-        super(id);
+        super(id, null);
         addParent(Broker.class, broker);
         _name = MapValueConverter.getStringAttribute(TrustStore.NAME, attributes);
         _password = MapValueConverter.getStringAttribute(TrustStore.PASSWORD, attributes);

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractPluginAdapter.java
Fri Jan 11 17:39:12 2013
@@ -35,9 +35,9 @@ import org.apache.qpid.server.model.Stat
 public abstract class AbstractPluginAdapter extends AbstractAdapter implements Plugin
 {
 
-    protected AbstractPluginAdapter(UUID id)
+    protected AbstractPluginAdapter(UUID id, Map<String, Object> defaults)
     {
-        super(id);
+        super(id, defaults);
     }
 
     @Override

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
Fri Jan 11 17:39:12 2013
@@ -63,9 +63,9 @@ public abstract class AuthenticationProv
 
     private GroupPrincipalAccessor _groupAccessor;
 
-    private AuthenticationProviderAdapter(UUID id, Broker broker, final T authManager)
+    private AuthenticationProviderAdapter(UUID id, Broker broker, final T authManager, Map<String,
Object> defaults)
     {
-        super(id);
+        super(id, defaults);
         _authManager = authManager;
         _broker = broker;
         addParent(Broker.class, broker);
@@ -246,20 +246,21 @@ public abstract class AuthenticationProv
     public static class SimpleAuthenticationProviderAdapter extends AuthenticationProviderAdapter<AuthenticationManager>
     {
         public SimpleAuthenticationProviderAdapter(
-                UUID id, Broker broker, AuthenticationManager authManager)
+                UUID id, Broker broker, AuthenticationManager authManager, Map<String,
Object> defaults)
         {
-            super(id, broker,authManager);
+            super(id, broker,authManager, defaults);
         }
     }
 
+    //TODO: add file path attribute into actual attributes
     public static class PrincipalDatabaseAuthenticationManagerAdapter
             extends AuthenticationProviderAdapter<PrincipalDatabaseAuthenticationManager>
             implements PasswordCredentialManagingAuthenticationProvider
     {
         public PrincipalDatabaseAuthenticationManagerAdapter(
-                UUID id, Broker broker, PrincipalDatabaseAuthenticationManager authManager)
+                UUID id, Broker broker, PrincipalDatabaseAuthenticationManager authManager,
Map<String, Object> defaults)
         {
-            super(id, broker, authManager);
+            super(id, broker, authManager, defaults);
         }
 
         @Override
@@ -384,7 +385,7 @@ public abstract class AuthenticationProv
 
             public PrincipalAdapter(Principal user)
             {
-                super(UUIDGenerator.generateUserUUID(PrincipalDatabaseAuthenticationManagerAdapter.this.getName(),
user.getName()));
+                super(UUIDGenerator.generateUserUUID(PrincipalDatabaseAuthenticationManagerAdapter.this.getName(),
user.getName()), null);
                 _user = user;
 
             }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderFactory.java
Fri Jan 11 17:39:12 2013
@@ -59,12 +59,16 @@ public class AuthenticationProviderFacto
                 AuthenticationProviderAdapter<?> authenticationProvider;
                 if (manager instanceof PrincipalDatabaseAuthenticationManager)
                 {
+                    // TODO : add defaults
+                    Map<String, Object> defaults = null;
                     authenticationProvider = new PrincipalDatabaseAuthenticationManagerAdapter(id,
broker,
-                            (PrincipalDatabaseAuthenticationManager) manager);
+                            (PrincipalDatabaseAuthenticationManager) manager, defaults);
                 }
                 else
                 {
-                    authenticationProvider = new SimpleAuthenticationProviderAdapter(id,
broker, manager);
+                    // TODO : add defaults
+                    Map<String, Object> defaults = null;
+                    authenticationProvider = new SimpleAuthenticationProviderAdapter(id,
broker, manager, attributes);
                 }
                 authenticationProvider.setGroupAccessor(groupPrincipalAccessor);
                 return authenticationProvider;

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BindingAdapter.java
Fri Jan 11 17:39:12 2013
@@ -48,7 +48,7 @@ final class BindingAdapter extends Abstr
                           ExchangeAdapter exchangeAdapter,
                           QueueAdapter queueAdapter)
     {
-        super(binding.getId());
+        super(binding.getId(), null);
         _binding = binding;
         _exchange = exchangeAdapter;
         _queue = queueAdapter;

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
Fri Jan 11 17:39:12 2013
@@ -105,11 +105,11 @@ public class BrokerAdapter extends Abstr
     private int _statisticsReportingPeriod;
     private boolean _statisticsReportingResetEnabled;
 
-    public BrokerAdapter(UUID id, Map<String, Object> attributes, StatisticsGatherer
statisticsGatherer, VirtualHostRegistry virtualHostRegistry,
+    public BrokerAdapter(UUID id, Map<String, Object> attributes, Map<String, Object>
defaults, StatisticsGatherer statisticsGatherer, VirtualHostRegistry virtualHostRegistry,
             LogRecorder logRecorder, RootMessageLogger rootMessageLogger, AuthenticationProviderFactory
authenticationProviderFactory,
             PortFactory portFactory)
     {
-        super(id);
+        super(id, defaults);
         _name = "Broker";
         _statisticsGatherer = statisticsGatherer;
         _virtualHostRegistry = virtualHostRegistry;
@@ -215,8 +215,10 @@ public class BrokerAdapter extends Abstr
     private VirtualHost createVirtualHost(final Map<String, Object> attributes)
             throws AccessControlException, IllegalArgumentException
     {
+        //TODO create defaults
+        Map<String, Object> defaults = null;
         final VirtualHostAdapter virtualHostAdapter = new VirtualHostAdapter(UUID.randomUUID(),
attributes, this,
-                _statisticsGatherer);
+                _statisticsGatherer, defaults);
 
         synchronized (_vhostAdapters)
         {
@@ -328,6 +330,7 @@ public class BrokerAdapter extends Abstr
         return Collections.emptySet();
     }
 
+    //TODO: ACL
     @SuppressWarnings("unchecked")
     @Override
     public <C extends ConfiguredObject> C createChild(Class<C> childClass, Map<String,
Object> attributes, ConfiguredObject... otherParents)

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java
Fri Jan 11 17:39:12 2013
@@ -50,9 +50,9 @@ final class ConnectionAdapter extends Ab
             new HashMap<AMQSessionModel, SessionAdapter>();
     private final Statistics _statistics;
 
-    public ConnectionAdapter(final AMQConnectionModel conn)
+    public ConnectionAdapter(final AMQConnectionModel conn, Map<String, Object> defaults)
     {
-        super(UUIDGenerator.generateRandomUUID());
+        super(UUIDGenerator.generateRandomUUID(), defaults);
         _connection = conn;
         _statistics = new ConnectionStatisticsAdapter(conn);
     }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java
Fri Jan 11 17:39:12 2013
@@ -45,7 +45,7 @@ public class ConsumerAdapter extends Abs
                                                queueAdapter.getName(),
                                                subscription.getSessionModel().getConnectionModel().getRemoteAddressString(),
                                                String.valueOf(subscription.getSessionModel().getChannelId()),
-                                               subscription.getConsumerName()));
+                                               subscription.getConsumerName()), null);
         _subscription = subscription;
         _queue = queueAdapter;
         _statistics = new ConsumerStatistics();

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ExchangeAdapter.java
Fri Jan 11 17:39:12 2013
@@ -56,7 +56,7 @@ final class ExchangeAdapter extends Abst
     public ExchangeAdapter(final VirtualHostAdapter virtualHostAdapter,
                            final org.apache.qpid.server.exchange.Exchange exchange)
     {
-        super(exchange.getId());
+        super(exchange.getId(), null);
         _statistics = new ExchangeStatistics();
         _vhost = virtualHostAdapter;
         _exchange = exchange;

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
Fri Jan 11 17:39:12 2013
@@ -47,9 +47,9 @@ public class GroupProviderAdapter extend
 {
     private final GroupManager _groupManager;
     private final Broker _broker;
-    public GroupProviderAdapter(UUID id, GroupManager groupManager, Broker broker)
+    public GroupProviderAdapter(UUID id, GroupManager groupManager, Broker broker, Map<String,
Object> defaults)
     {
-        super(id);
+        super(id, defaults);
 
         if (groupManager == null)
         {
@@ -231,7 +231,7 @@ public class GroupProviderAdapter extend
         public GroupAdapter(String group)
         {
             super(UUIDGenerator.generateGroupUUID(
-                    GroupProviderAdapter.this.getName(), group));
+                    GroupProviderAdapter.this.getName(), group), null);
             _group = group;
 
         }
@@ -409,7 +409,7 @@ public class GroupProviderAdapter extend
                 super(UUIDGenerator
                         .generateGroupMemberUUID(
                                 GroupProviderAdapter.this.getName(), _group,
-                                memberName));
+                                memberName), null);
                 _memberName = memberName;
             }
 

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
Fri Jan 11 17:39:12 2013
@@ -67,9 +67,9 @@ public class PortAdapter extends Abstrac
      * protocols on the same port we need to introduce a special entity like
      * PortAceptor which will be responsible for port binding/unbinding
      */
-    public PortAdapter(UUID id, Broker broker, Map<String, Object> attributes)
+    public PortAdapter(UUID id, Broker broker, Map<String, Object> attributes, Map<String,
Object> defaults)
     {
-        super(id);
+        super(id, defaults);
         _broker = broker;
 
         addParent(Broker.class, broker);

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortFactory.java
Fri Jan 11 17:39:12 2013
@@ -50,11 +50,15 @@ public class PortFactory
         final Port port;
         if (isAmqpProtocol(attributes))
         {
-            port = new AmqpPortAdapter(id, broker, attributes);
+            //TODO: create defaults
+            Map<String, Object> defaults = null;
+            port = new AmqpPortAdapter(id, broker, attributes, defaults);
         }
         else
         {
-            port = new PortAdapter(id, broker, attributes);
+            //TODO: create defaults
+            Map<String, Object> defaults = null;
+            port = new PortAdapter(id, broker, attributes, defaults);
         }
         return port;
     }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
Fri Jan 11 17:39:12 2013
@@ -78,9 +78,9 @@ final class QueueAdapter extends Abstrac
     private QueueStatisticsAdapter _statistics;
     private QueueNotificationListener _queueNotificationListener;
 
-    public QueueAdapter(final VirtualHostAdapter virtualHostAdapter, final AMQQueue queue)
+    public QueueAdapter(final VirtualHostAdapter virtualHostAdapter, final AMQQueue queue,
Map<String, Object> defaults)
     {
-        super(queue.getId());
+        super(queue.getId(), defaults);
         _vhost = virtualHostAdapter;
         addParent(org.apache.qpid.server.model.VirtualHost.class, virtualHostAdapter);
 

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java
Fri Jan 11 17:39:12 2013
@@ -46,7 +46,7 @@ final class SessionAdapter extends Abstr
 
     public SessionAdapter(final AMQSessionModel session)
     {
-        super(UUIDGenerator.generateRandomUUID());
+        super(UUIDGenerator.generateRandomUUID(), null);
         _session = session;
         _statistics = new SessionStatistics();
     }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
Fri Jan 11 17:39:12 2013
@@ -92,9 +92,9 @@ public final class VirtualHostAdapter ex
     private final String _configurationFile;
     private StatisticsGatherer _brokerStatisticsGatherer;
 
-    public VirtualHostAdapter(UUID id, Map<String, Object> attributes, Broker broker,
StatisticsGatherer brokerStatisticsGatherer)
+    public VirtualHostAdapter(UUID id, Map<String, Object> attributes, Broker broker,
StatisticsGatherer brokerStatisticsGatherer, Map<String, Object> defaults)
     {
-        super(id);
+        super(id, defaults);
         _broker = broker;
         _name = MapValueConverter.getStringAttribute(NAME, attributes);
         _configurationFile = MapValueConverter.getStringAttribute(CONFIGURATION, attributes);
@@ -131,7 +131,9 @@ public final class VirtualHostAdapter ex
                 {
                     if(!_queueAdapters.containsKey(queue))
                     {
-                        _queueAdapters.put(queue, new QueueAdapter(this,queue));
+                        //TODO: create queue defaults map
+                        Map<String, Object> queueDefaults = null;
+                        _queueAdapters.put(queue, new QueueAdapter(this,queue, queueDefaults));
                     }
                 }
             }
@@ -149,7 +151,9 @@ public final class VirtualHostAdapter ex
             {
                 if(!_connectionAdapters.containsKey(conn))
                 {
-                    _connectionAdapters.put(conn, new ConnectionAdapter(conn));
+                    //TODO: create connection defaults
+                    Map<String, Object> connectionDefaults = null;
+                    _connectionAdapters.put(conn, new ConnectionAdapter(conn, connectionDefaults));
                 }
             }
         }
@@ -511,7 +515,9 @@ public final class VirtualHostAdapter ex
         {
             if(!_queueAdapters.containsKey(queue))
             {
-                adapter = new QueueAdapter(this, queue);
+                //TODO: create queue defaults
+                Map<String, Object> queueDefaults = null;
+                adapter = new QueueAdapter(this, queue, queueDefaults);
                 _queueAdapters.put(queue, adapter);
 
             }
@@ -547,7 +553,9 @@ public final class VirtualHostAdapter ex
         {
             if(!_connectionAdapters.containsKey(connection))
             {
-                adapter = new ConnectionAdapter(connection);
+                //TODO: create defaults
+                Map<String, Object> defaults = null;
+                adapter = new ConnectionAdapter(connection, defaults);
                 _connectionAdapters.put(connection, adapter);
 
             }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAliasAdapter.java
Fri Jan 11 17:39:12 2013
@@ -43,7 +43,7 @@ public class VirtualHostAliasAdapter  ex
 
     public VirtualHostAliasAdapter(VirtualHostAdapter virtualHostAdapter, Port port)
     {
-        super(UUIDGenerator.generateVhostAliasUUID(virtualHostAdapter.getName(), port.getName()));
+        super(UUIDGenerator.generateVhostAliasUUID(virtualHostAdapter.getName(), port.getName()),
null);
         _vhost = virtualHostAdapter;
         _port = port;
     }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/AmqpPortAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/AmqpPortAdapter.java?rev=1432184&r1=1432183&r2=1432184&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/AmqpPortAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/AmqpPortAdapter.java
Fri Jan 11 17:39:12 2013
@@ -51,9 +51,9 @@ public class AmqpPortAdapter extends Por
     private final Broker _broker;
     private IncomingNetworkTransport _transport;
 
-    public AmqpPortAdapter(UUID id, Broker broker, Map<String, Object> attributes)
+    public AmqpPortAdapter(UUID id, Broker broker, Map<String, Object> attributes,
Map<String, Object> defaultAttributes)
     {
-        super(id, broker, attributes);
+        super(id, broker, attributes, defaultAttributes);
         _broker = broker;
     }
 



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


Mime
View raw message