You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2012/12/12 18:43:57 UTC

svn commit: r1420878 - in /qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src: main/java/org/apache/qpid/server/configuration/ main/java/org/apache/qpid/server/model/adapter/ test/java/org/apache/qpid/server/configuration/startup/ velocity...

Author: orudyy
Date: Wed Dec 12 17:43:53 2012
New Revision: 1420878

URL: http://svn.apache.org/viewvc?rev=1420878&view=rev
Log:
QPID-4390: Miscellaneous changes related to the deletion of references to ApplicationRegistry and refactoring of virtual host configuration

Modified:
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.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/KeyStoreAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.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/VirtualHostConfiguration.java?rev=1420878&r1=1420877&r2=1420878&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java (original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java Wed Dec 12 17:43:53 2012
@@ -62,18 +62,17 @@ public class VirtualHostConfiguration ex
         {
             Configuration virtualHostConfig = XmlConfigurationUtilities.parseConfig(configurationFile, null);
 
+            // check if it is old virtual host configuration file
             Configuration config = virtualHostConfig.subset("virtualhost." + XmlConfigurationUtilities.escapeTagName(name));
             if (config.isEmpty())
             {
                 // try to load virtual host configuration from 'name' element
-                config = virtualHostConfig.subset(XmlConfigurationUtilities.escapeTagName(name));
-                if (config.isEmpty())
-                {
-                    // fallback to the original configuration
-                    config = virtualHostConfig;
-                }
+                configuration = virtualHostConfig;
+            }
+            else
+            {
+                configuration = config;
             }
-            configuration = config;
         }
         setConfiguration(configuration);
     }

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=1420878&r1=1420877&r2=1420878&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 Wed Dec 12 17:43:53 2012
@@ -49,9 +49,9 @@ public abstract class AbstractKeyStoreAd
         _name = MapValueConverter.getStringAttribute(TrustStore.NAME, attributes);
         _password = MapValueConverter.getStringAttribute(TrustStore.PASSWORD, attributes);
         setMandatoryAttribute(TrustStore.PATH, attributes);
-        setOptionalAttribute(TrustStore.TYPE, attributes, java.security.KeyStore.getDefaultType());
-        setOptionalAttribute(TrustStore.KEY_MANAGER_FACTORY_ALGORITHM, attributes, KeyManagerFactory.getDefaultAlgorithm());
-        setOptionalAttribute(TrustStore.DESCRIPTION, attributes, null);
+        setOptionalAttribute(TrustStore.TYPE, attributes);
+        setOptionalAttribute(TrustStore.KEY_MANAGER_FACTORY_ALGORITHM, attributes);
+        setOptionalAttribute(TrustStore.DESCRIPTION, attributes);
     }
 
     @Override
@@ -190,8 +190,11 @@ public abstract class AbstractKeyStoreAd
         setAttribute(name, null, MapValueConverter.getStringAttribute(name, attributes));
     }
 
-    protected void setOptionalAttribute(String name, Map<String, Object> attributes, String defaultValue)
+    protected void setOptionalAttribute(String name, Map<String, Object> attributes)
     {
-        setAttribute(name, null, MapValueConverter.getStringAttribute(name, attributes, defaultValue));
+        if (attributes.containsKey(name))
+        {
+            setAttribute(name, null, MapValueConverter.getStringAttribute(name, attributes));
+        }
     }
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.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/KeyStoreAdapter.java?rev=1420878&r1=1420877&r2=1420878&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java (original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/KeyStoreAdapter.java Wed Dec 12 17:43:53 2012
@@ -33,7 +33,10 @@ public class KeyStoreAdapter extends Abs
     public KeyStoreAdapter(UUID id, Broker broker, Map<String, Object> attributes)
     {
         super(id, broker, attributes);
-        setOptionalAttribute(CERTIFICATE_ALIAS, attributes, null);
+        if (attributes.containsKey(CERTIFICATE_ALIAS))
+        {
+            setAttribute(CERTIFICATE_ALIAS, null, attributes.get(CERTIFICATE_ALIAS));
+        }
     }
 
     @Override

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java?rev=1420878&r1=1420877&r2=1420878&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java (original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/KeyStoreRecovererTest.java Wed Dec 12 17:43:53 2012
@@ -30,6 +30,7 @@ import java.util.UUID;
 import org.apache.qpid.server.configuration.ConfigurationEntry;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.KeyStore;
+import org.apache.qpid.server.model.TrustStore;
 
 import junit.framework.TestCase;
 
@@ -53,7 +54,10 @@ public class KeyStoreRecovererTest exten
         assertEquals(id, KeyStore.getId());
         assertEquals("my-secret-password", KeyStore.getPassword());
 
-        // password attribute  should not be provided
+        assertNull("Password was unexpectedly returned from configured object", KeyStore.getAttribute(TrustStore.PASSWORD));
+
+        // password attribute should not be exposed by a key store configured object
+        // so, we should set password value to null in the map being used to create the key store configured object
         attributes.put(KeyStore.PASSWORD, null);
         for (Map.Entry<String, Object> attribute : attributes.entrySet())
         {

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java?rev=1420878&r1=1420877&r2=1420878&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java (original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/TrustStoreRecovererTest.java Wed Dec 12 17:43:53 2012
@@ -51,7 +51,10 @@ public class TrustStoreRecovererTest ext
         assertEquals(id, trustStore.getId());
         assertEquals("my-secret-password", trustStore.getPassword());
 
-        // password attribute  should not be provided
+        assertNull("Password was unexpectedly returned from configured object", trustStore.getAttribute(TrustStore.PASSWORD));
+
+        // password attribute should not be exposed by a trust store configured object
+        // so, we should set password value to null in the map being used to create the trust store configured object
         attributes.put(TrustStore.PASSWORD, null);
         for (Map.Entry<String, Object> attribute : attributes.entrySet())
         {

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm?rev=1420878&r1=1420877&r2=1420878&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm (original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm Wed Dec 12 17:43:53 2012
@@ -58,11 +58,6 @@ public class ${type.name}Messages
         Logger.getLogger(${message.methodName.toUpperCase()}_LOG_HIERARCHY);
 #end
 
-        reload();
-    }
-
-    public static void reload()
-    {
         _messages = ResourceBundle.getBundle("${resource}", _currentLocale);
     }
 



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