qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1469917 - in /qpid/trunk/qpid/java: broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ broker/src/main/java/org/apache/qpid/server/configuration/ broker/src/main/java/org/apache/qpid/...
Date Fri, 19 Apr 2013 15:50:48 GMT
Author: orudyy
Date: Fri Apr 19 15:50:48 2013
New Revision: 1469917

URL: http://svn.apache.org/r1469917
Log:
QPID-4755: Rename broker attribute 'supportedStoreTypes' into 'virtualHostSupportedStoreTypes'
and introduce new attribute for broker supported store types

Modified:
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java
Fri Apr 19 15:50:48 2013
@@ -17,7 +17,7 @@ public class ListMessageStoreTypes imple
     @Override
     public Object perform(Map<String, Object> request, Broker broker)
     {
-        return broker.getAttribute(Broker.SUPPORTED_STORE_TYPES);
+        return broker.getAttribute(Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES);
     }
 
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java
Fri Apr 19 15:50:48 2013
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.configuration;
 
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -72,4 +74,8 @@ public class BrokerConfigurationStoreCre
         return factory.createStore(storeLocation, initialStore, overwrite);
     }
 
+    public Collection<String> getStoreTypes()
+    {
+        return Collections.unmodifiableCollection(_factories.keySet());
+    }
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java Fri
Apr 19 15:50:48 2013
@@ -43,7 +43,8 @@ public interface Broker extends Configur
     String PLATFORM = "platform";
     String PROCESS_PID = "processPid";
     String PRODUCT_VERSION = "productVersion";
-    String SUPPORTED_STORE_TYPES = "supportedStoreTypes";
+    String SUPPORTED_BROKER_STORE_TYPES = "supportedBrokerStoreTypes";
+    String SUPPORTED_VIRTUALHOST_STORE_TYPES = "supportedVirtualHostStoreTypes";
     String SUPPORTED_AUTHENTICATION_PROVIDERS = "supportedAuthenticationProviders";
     String CREATED = "created";
     String DURABLE = "durable";
@@ -95,7 +96,8 @@ public interface Broker extends Configur
                               PLATFORM,
                               PROCESS_PID,
                               PRODUCT_VERSION,
-                              SUPPORTED_STORE_TYPES,
+                              SUPPORTED_BROKER_STORE_TYPES,
+                              SUPPORTED_VIRTUALHOST_STORE_TYPES,
                               SUPPORTED_AUTHENTICATION_PROVIDERS,
                               CREATED,
                               DURABLE,

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
Fri Apr 19 15:50:48 2013
@@ -34,6 +34,7 @@ import java.util.UUID;
 import org.apache.log4j.Logger;
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.configuration.BrokerConfigurationStoreCreator;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
@@ -172,7 +173,8 @@ public class BrokerAdapter extends Abstr
     private final PortFactory _portFactory;
     private final SecurityManager _securityManager;
 
-    private final Collection<String> _supportedStoreTypes;
+    private final Collection<String> _supportedVirtualHostStoreTypes;
+    private Collection<String> _supportedBrokerStoreTypes;
     private final ConfigurationEntryStore _brokerStore;
 
     private AuthenticationProvider _managementAuthenticationProvider;
@@ -194,7 +196,8 @@ public class BrokerAdapter extends Abstr
         _portFactory = portFactory;
         _securityManager = new SecurityManager((String)getAttribute(ACL_FILE));
         addChangeListener(_securityManager);
-        _supportedStoreTypes = new MessageStoreCreator().getStoreTypes();
+        _supportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
+        _supportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
         _brokerStore = brokerStore;
         _brokerOptions = brokerOptions;
         if (_brokerOptions.isManagementMode())
@@ -684,9 +687,13 @@ public class BrokerAdapter extends Abstr
         {
             return QpidProperties.getReleaseVersion();
         }
-        else if(SUPPORTED_STORE_TYPES.equals(name))
+        else if(SUPPORTED_BROKER_STORE_TYPES.equals(name))
         {
-            return _supportedStoreTypes;
+            return _supportedBrokerStoreTypes;
+        }
+        else if(SUPPORTED_VIRTUALHOST_STORE_TYPES.equals(name))
+        {
+            return _supportedVirtualHostStoreTypes;
         }
         else if(SUPPORTED_AUTHENTICATION_PROVIDERS.equals(name))
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
Fri Apr 19 15:50:48 2013
@@ -63,7 +63,7 @@ public class BrokerRestHttpsTest extends
         Map<String, Object> brokerDetails = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
 
         Asserts.assertAttributesPresent(brokerDetails, Broker.AVAILABLE_ATTRIBUTES, Broker.BYTES_RETAINED,
-                Broker.PROCESS_PID, Broker.SUPPORTED_STORE_TYPES, Broker.CREATED, Broker.TIME_TO_LIVE,
Broker.UPDATED,
+                Broker.PROCESS_PID, Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES, Broker.CREATED,
Broker.TIME_TO_LIVE, Broker.UPDATED,
                 Broker.ACL_FILE);
     }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1469917&r1=1469916&r2=1469917&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
Fri Apr 19 15:50:48 2013
@@ -29,11 +29,13 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.qpid.common.QpidProperties;
+import org.apache.qpid.server.configuration.BrokerConfigurationStoreCreator;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.MessageStoreCreator;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
@@ -210,7 +212,7 @@ public class BrokerRestTest extends Qpid
     protected void assertBrokerAttributes(Map<String, Object> brokerDetails)
     {
         Asserts.assertAttributesPresent(brokerDetails, Broker.AVAILABLE_ATTRIBUTES,
-                Broker.BYTES_RETAINED, Broker.PROCESS_PID, Broker.SUPPORTED_STORE_TYPES,
+                Broker.BYTES_RETAINED, Broker.PROCESS_PID,
                 Broker.CREATED, Broker.TIME_TO_LIVE, Broker.UPDATED, Broker.ACL_FILE);
 
         assertEquals("Unexpected value of attribute " + Broker.BUILD_VERSION, QpidProperties.getBuildVersion(),
@@ -234,6 +236,16 @@ public class BrokerRestTest extends Qpid
         assertNotNull("Unexpected value of attribute virtualhosts", brokerDetails.get(BROKER_VIRTUALHOSTS_ATTRIBUTE));
         assertNotNull("Unexpected value of attribute ports", brokerDetails.get(BROKER_PORTS_ATTRIBUTE));
         assertNotNull("Unexpected value of attribute authenticationproviders", brokerDetails.get(BROKER_AUTHENTICATIONPROVIDERS_ATTRIBUTE));
+
+        @SuppressWarnings("unchecked")
+        Collection<String> supportedBrokerStoreTypes = (Collection<String>)brokerDetails.get(Broker.SUPPORTED_BROKER_STORE_TYPES);
+        Collection<String> expectedSupportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
+        assertEquals("Unexpected supported broker store types",  new HashSet<String>(expectedSupportedBrokerStoreTypes),
new HashSet<String>(supportedBrokerStoreTypes));
+
+        @SuppressWarnings("unchecked")
+        Collection<String> supportedVirtualHostStoreTypes = (Collection<String>)brokerDetails.get(Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES);
+        Collection<String> expectedSupportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
+        assertEquals("Unexpected supported virtual host store types",  new HashSet<String>(expectedSupportedVirtualHostStoreTypes),
new HashSet<String>(supportedVirtualHostStoreTypes));
     }
 
 }



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


Mime
View raw message