diff options
author | Alex Rudyy <orudyy@apache.org> | 2013-04-19 15:50:48 +0000 |
---|---|---|
committer | Alex Rudyy <orudyy@apache.org> | 2013-04-19 15:50:48 +0000 |
commit | 8daa35c9f6fc4f4e8f18e7fa5dafb2cd0a6c3460 (patch) | |
tree | e7478f3394bbab1a6d17993a48414a1693cd8b52 | |
parent | d792f4deff8d3ce6b4672c7156ad56eb4438c01d (diff) | |
download | qpid-python-8daa35c9f6fc4f4e8f18e7fa5dafb2cd0a6c3460.tar.gz |
QPID-4755: Rename broker attribute 'supportedStoreTypes' into 'virtualHostSupportedStoreTypes' and introduce new attribute for broker supported store types
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1469917 13f79535-47bb-0310-9956-ffa450edef68
6 files changed, 36 insertions, 9 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java index 4166736c01..091068f238 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java +++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListMessageStoreTypes.java @@ -17,7 +17,7 @@ public class ListMessageStoreTypes implements Action @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); } } diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java index a91c3695b3..8ce74ff334 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/BrokerConfigurationStoreCreator.java @@ -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 BrokerConfigurationStoreCreator return factory.createStore(storeLocation, initialStore, overwrite); } + public Collection<String> getStoreTypes() + { + return Collections.unmodifiableCollection(_factories.keySet()); + } } diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java index 44adf3414d..2cdc62d2dc 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java @@ -43,7 +43,8 @@ public interface Broker extends ConfiguredObject 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 ConfiguredObject PLATFORM, PROCESS_PID, PRODUCT_VERSION, - SUPPORTED_STORE_TYPES, + SUPPORTED_BROKER_STORE_TYPES, + SUPPORTED_VIRTUALHOST_STORE_TYPES, SUPPORTED_AUTHENTICATION_PROVIDERS, CREATED, DURABLE, diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java index 17a8f19cd3..b0e57d339a 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java @@ -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 AbstractAdapter implements Broker, Configurat 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 AbstractAdapter implements Broker, Configurat _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 AbstractAdapter implements Broker, Configurat { 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)) { diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java index 0c590ad1d8..8fe342e394 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java @@ -63,7 +63,7 @@ public class BrokerRestHttpsTest extends QpidRestTestCase 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); } } diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java index 7b1b1ca8be..4bca63204d 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java @@ -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 QpidRestTestCase 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 QpidRestTestCase 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)); } } |