QPID-8455: [Broker-J] Add functionality to upgrade broker configuration
diff --git a/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java b/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java
index 3925f72..8b362e6 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java
@@ -48,6 +48,8 @@
{
private static final Logger LOGGER = LoggerFactory.getLogger(BrokerStoreUpgraderAndRecoverer.class);
+
+
public static final String VIRTUALHOSTS = "virtualhosts";
private final SystemConfig<?> _systemConfig;
@@ -734,20 +736,24 @@
}
}
- private class Upgrader_8_0_to_9_0 extends StoreUpgraderPhase
+ private static class Upgrader_8_0_to_9_0 extends StoreUpgraderPhase
{
- public Upgrader_8_0_to_9_0()
+
+ Upgrader_8_0_to_9_0()
{
super("modelVersion", "8.0", "9.0");
}
@Override
- public void configuredObject(final ConfiguredObjectRecord record)
+ public void configuredObject(ConfiguredObjectRecord record)
{
- if("Broker".equals(record.getType()))
+ if ("Broker".equals(record.getType()))
{
- upgradeRootRecord(record);
+ record = upgradeRootRecord(record);
}
+ renameContextVariables(record,
+ "context",
+ UpgraderHelper.MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES);
}
@Override
diff --git a/broker-core/src/main/java/org/apache/qpid/server/store/StoreUpgraderPhase.java b/broker-core/src/main/java/org/apache/qpid/server/store/StoreUpgraderPhase.java
index b40dc73..df8bcf8 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/store/StoreUpgraderPhase.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/store/StoreUpgraderPhase.java
@@ -55,4 +55,31 @@
return _toVersion;
}
-}
\ No newline at end of file
+ ConfiguredObjectRecord renameContextVariables(final ConfiguredObjectRecord record,
+ final String contextAttributeName,
+ final Map<String, String> oldToNewNameMapping)
+ {
+ final Map<String, Object> attributes = record.getAttributes();
+ if (attributes != null && attributes.containsKey(contextAttributeName))
+ {
+ final Object context = attributes.get(contextAttributeName);
+ if (context instanceof Map)
+ {
+ final Map<String, String> newContext =
+ UpgraderHelper.renameContextVariables((Map<String, String>) context, oldToNewNameMapping);
+
+ final Map<String, Object> updatedAttributes = new HashMap<>(record.getAttributes());
+ updatedAttributes.put(contextAttributeName, newContext);
+ final ConfiguredObjectRecord updatedRecord = new ConfiguredObjectRecordImpl(record.getId(),
+ record.getType(),
+ updatedAttributes,
+ record.getParents());
+ getUpdateMap().put(updatedRecord.getId(), updatedRecord);
+ return updatedRecord;
+ }
+ }
+ return record;
+ }
+
+
+}
diff --git a/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderHelper.java b/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderHelper.java
new file mode 100644
index 0000000..4428d67
--- /dev/null
+++ b/broker-core/src/main/java/org/apache/qpid/server/store/UpgraderHelper.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.store;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class UpgraderHelper
+{
+ public static final Map<String, String> MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES = new HashMap<>();
+ static
+ {
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES.put("qpid.security.tls.protocolWhiteList",
+ "qpid.security.tls.protocolAllowList");
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES.put("qpid.security.tls.protocolBlackList",
+ "qpid.security.tls.protocolDenyList");
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES.put("qpid.security.tls.cipherSuiteWhiteList",
+ "qpid.security.tls.cipherSuiteAllowList");
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES.put("qpid.security.tls.cipherSuiteBlackList",
+ "qpid.security.tls.cipherSuiteDenyList");
+ }
+
+ public static Map<String, String> renameContextVariables(final Map<String, String> context,
+ final Map<String, String> oldToNewNameMapping)
+ {
+ final Map<String, String> newContext = new HashMap<>(context);
+ oldToNewNameMapping.forEach((oldName, newName) -> {
+ if (newContext.containsKey(oldName))
+ {
+ final String value = newContext.remove(oldName);
+ newContext.put(newName, value);
+ }
+ });
+ return newContext;
+ }
+
+ public static Map<String, String> reverse(Map<String, String> map)
+ {
+ return map.entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));
+ }
+}
diff --git a/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java b/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java
index d1bc608..248c89b 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java
@@ -1088,20 +1088,23 @@
}
}
- private class Upgrader_8_0_to_9_0 extends StoreUpgraderPhase
+ private static class Upgrader_8_0_to_9_0 extends StoreUpgraderPhase
{
- public Upgrader_8_0_to_9_0()
+ Upgrader_8_0_to_9_0()
{
super("modelVersion", "8.0", "9.0");
}
@Override
- public void configuredObject(final ConfiguredObjectRecord record)
+ public void configuredObject(ConfiguredObjectRecord record)
{
- if("VirtualHost".equals(record.getType()))
+ if ("VirtualHost".equals(record.getType()))
{
- upgradeRootRecord(record);
+ record = upgradeRootRecord(record);
}
+ renameContextVariables(record,
+ "context",
+ UpgraderHelper.MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES);
}
@Override
diff --git a/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java b/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java
index 8d8f991..67c1d1d 100644
--- a/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java
+++ b/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java
@@ -35,6 +35,7 @@
import java.util.Map;
import java.util.UUID;
+import org.apache.qpid.server.configuration.CommonProperties;
import org.junit.Before;
import org.junit.Test;
@@ -888,6 +889,121 @@
upgradedAttributes.containsKey("conection.closeWhenNoRoute"));
}
+ @Test
+ public void testContextVariableUpgradeForTLSProtocolsSetOnBroker()
+ {
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.protocolWhiteList", ".*");
+ context.put("qpid.security.tls.protocolBlackList", "Ssl.*");
+
+ _brokerRecord.getAttributes().put("modelVersion", "8.0");
+ _brokerRecord.getAttributes().put("context", context);
+
+ final DurableConfigurationStore dcs = new DurableConfigurationStoreStub(_brokerRecord);
+ final BrokerStoreUpgraderAndRecoverer recoverer = new BrokerStoreUpgraderAndRecoverer(_systemConfig);
+ final List<ConfiguredObjectRecord> records = upgrade(dcs, recoverer);
+
+ final Map<String, String> contextMap = findCategoryRecordAndGetContext("Broker", records);
+
+ assertEquals(".*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_ALLOW_LIST));
+ assertEquals("Ssl.*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_DENY_LIST));
+ }
+
+
+ @Test
+ public void testContextVariableUpgradeForTLSCipherSuitesSetOnBroker()
+ {
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.cipherSuiteWhiteList", ".*");
+ context.put("qpid.security.tls.cipherSuiteBlackList", "Ssl.*");
+
+ _brokerRecord.getAttributes().put("modelVersion", "8.0");
+ _brokerRecord.getAttributes().put("context", context);
+
+ final DurableConfigurationStore dcs = new DurableConfigurationStoreStub(_brokerRecord);
+ final BrokerStoreUpgraderAndRecoverer recoverer = new BrokerStoreUpgraderAndRecoverer(_systemConfig);
+ final List<ConfiguredObjectRecord> records = upgrade(dcs, recoverer);
+
+ final Map<String, String> contextMap = findCategoryRecordAndGetContext("Broker", records);
+
+ assertEquals(".*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_ALLOW_LIST));
+ assertEquals("Ssl.*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_DENY_LIST));
+ }
+
+ @Test
+ public void testContextVariableUpgradeForTLSProtocolsSetOnPort()
+ {
+ _brokerRecord.getAttributes().put("modelVersion", "8.0");
+
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.protocolWhiteList", ".*");
+ context.put("qpid.security.tls.protocolBlackList", "Ssl.*");
+
+ final ConfiguredObjectRecord portRecord =
+ createMockRecordForGivenCategoryTypeAndContext("Port", "AMQP", context);
+
+ final DurableConfigurationStore dcs = new DurableConfigurationStoreStub(portRecord, _brokerRecord);
+ final BrokerStoreUpgraderAndRecoverer recoverer = new BrokerStoreUpgraderAndRecoverer(_systemConfig);
+
+ final List<ConfiguredObjectRecord> records = upgrade(dcs, recoverer);
+
+ final Map<String, String> contextMap = findCategoryRecordAndGetContext("Port", records);
+
+ assertEquals(".*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_ALLOW_LIST));
+ assertEquals("Ssl.*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_DENY_LIST));
+ }
+
+ @Test
+ public void testContextVariableUpgradeForTLSCipherSuitesSetOnAuthenticationProvider()
+ {
+ _brokerRecord.getAttributes().put("modelVersion", "8.0");
+
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.cipherSuiteWhiteList", ".*");
+ context.put("qpid.security.tls.cipherSuiteBlackList", "Ssl.*");
+ final ConfiguredObjectRecord authenticationProviderRecord =
+ createMockRecordForGivenCategoryTypeAndContext("AuthenticationProvider", "OAuth2", context);
+
+ final DurableConfigurationStore dcs =
+ new DurableConfigurationStoreStub(authenticationProviderRecord, _brokerRecord);
+ final BrokerStoreUpgraderAndRecoverer recoverer = new BrokerStoreUpgraderAndRecoverer(_systemConfig);
+
+ final List<ConfiguredObjectRecord> records = upgrade(dcs, recoverer);
+
+ final Map<String, String> contextMap = findCategoryRecordAndGetContext("AuthenticationProvider", records);
+
+ assertEquals(".*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_ALLOW_LIST));
+ assertEquals("Ssl.*", contextMap.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_DENY_LIST));
+ }
+
+ private ConfiguredObjectRecord createMockRecordForGivenCategoryTypeAndContext(final String category,
+ final String type,
+ final Map<String, String> context)
+ {
+ final ConfiguredObjectRecord record = mock(ConfiguredObjectRecord.class);
+ when(record.getId()).thenReturn(UUID.randomUUID());
+ when(record.getType()).thenReturn(category);
+ final Map<String, Object> attributes = new HashMap<>();
+ attributes.put("name", getTestName());
+ attributes.put("type", type);
+ attributes.put("context", context);
+ when(record.getAttributes()).thenReturn(attributes);
+ return record;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<String, String> findCategoryRecordAndGetContext(final String category,
+ final List<ConfiguredObjectRecord> records)
+ {
+ final List<ConfiguredObjectRecord> foundRecords = findRecordByType(category, records);
+ assertEquals("Unexpected number of records", 1, foundRecords.size());
+ final Map<String, Object> attributes = foundRecords.get(0).getAttributes();
+ assertNotNull(attributes);
+ final Object context = attributes.get("context");
+ assertTrue(context instanceof Map);
+ return (Map<String, String>) context;
+ }
+
private void assertModelVersionUpgraded(final List<ConfiguredObjectRecord> records)
{
ConfiguredObjectRecord upgradedBrokerRecord = findRecordById(_brokerRecord.getId(), records);
diff --git a/broker-core/src/test/java/org/apache/qpid/server/store/UpgraderHelperTest.java b/broker-core/src/test/java/org/apache/qpid/server/store/UpgraderHelperTest.java
new file mode 100644
index 0000000..a429199
--- /dev/null
+++ b/broker-core/src/test/java/org/apache/qpid/server/store/UpgraderHelperTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.store;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+
+public class UpgraderHelperTest
+{
+
+ @Test
+ public void renameContextVariables()
+ {
+ final Map<String, String> context = new HashMap<>();
+ context.put("foo", "fooValue");
+ context.put("bar", "barValue");
+ final Map<String, String> newContext =
+ UpgraderHelper.renameContextVariables(context, Collections.singletonMap("foo", "newFoo"));
+ assertThat(newContext, is(notNullValue()));
+ assertThat(newContext.size(), equalTo(context.size()));
+ assertThat(newContext.get("bar"), equalTo(context.get("bar")));
+ assertThat(newContext.get("newFoo"), equalTo(context.get("foo")));
+ }
+}
diff --git a/broker-core/src/test/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecovererTest.java b/broker-core/src/test/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecovererTest.java
index 0f2cf93..c45c024 100644
--- a/broker-core/src/test/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecovererTest.java
+++ b/broker-core/src/test/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecovererTest.java
@@ -38,6 +38,7 @@
import org.junit.Before;
import org.junit.Test;
+import org.apache.qpid.server.configuration.CommonProperties;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.OverflowPolicy;
import org.apache.qpid.server.model.VirtualHostNode;
@@ -312,6 +313,56 @@
assertEquals("Unexpected messageGroupType", "STANDARD", upgradedAttributes.get("messageGroupType"));
}
+ @Test
+ public void testContextVariableUpgradeForTLSProtocolsSetOnVirtualHost() throws Exception
+ {
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.protocolWhiteList", ".*");
+ context.put("qpid.security.tls.protocolBlackList", "Ssl.*");
+
+ final Map<String, Object> rootAttributes = new HashMap<>();
+ rootAttributes.put("modelVersion", "8.0");
+ rootAttributes.put("name", "root");
+ rootAttributes.put("context", context);
+ final ConfiguredObjectRecord rootRecord = new ConfiguredObjectRecordImpl(UUID.randomUUID(),
+ "VirtualHost",
+ rootAttributes);
+ final List<ConfiguredObjectRecord> upgradedRecords =
+ _upgraderAndRecoverer.upgrade(_store,
+ Collections.singletonList(rootRecord),
+ "VirtualHost",
+ "modelVersion");
+
+ final Map<String, Object> newContext = getContextForRecordWithGivenId(rootRecord.getId(), upgradedRecords);
+ assertEquals(".*", newContext.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_ALLOW_LIST));
+ assertEquals("Ssl.*", newContext.get(CommonProperties.QPID_SECURITY_TLS_PROTOCOL_DENY_LIST));
+ }
+
+ @Test
+ public void testContextVariableUpgradeForTLSCipherSuitesSetOnVirtualHostAccessControlProvider() throws Exception
+ {
+ final Map<String, Object> rootAttributes = new HashMap<>();
+ rootAttributes.put("modelVersion", "8.0");
+ rootAttributes.put("name", "root");
+ final ConfiguredObjectRecord rootRecord =
+ new ConfiguredObjectRecordImpl(UUID.randomUUID(), "VirtualHost", rootAttributes);
+
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.cipherSuiteWhiteList", ".*");
+ context.put("qpid.security.tls.cipherSuiteBlackList", "Ssl.*");
+ final ConfiguredObjectRecord accessControlProviderRecord =
+ createMockRecordForGivenCategoryTypeAndContext("VirtualHostAccessControlProvider", "test", context);
+
+ final List<ConfiguredObjectRecord> records = Arrays.asList(rootRecord, accessControlProviderRecord);
+ final List<ConfiguredObjectRecord> upgradedRecords =
+ _upgraderAndRecoverer.upgrade(_store, records, "VirtualHost", "modelVersion");
+
+ final Map<String, Object> newContext =
+ getContextForRecordWithGivenId(accessControlProviderRecord.getId(), upgradedRecords);
+ assertEquals(".*", newContext.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_ALLOW_LIST));
+ assertEquals("Ssl.*", newContext.get(CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_DENY_LIST));
+ }
+
private ConfiguredObjectRecord findRecordById(UUID id, List<ConfiguredObjectRecord> records)
{
for (ConfiguredObjectRecord record : records)
@@ -323,4 +374,35 @@
}
return null;
}
+
+ private ConfiguredObjectRecord createMockRecordForGivenCategoryTypeAndContext(final String category,
+ final String type,
+ final Map<String, String> context)
+ {
+ final ConfiguredObjectRecord record = mock(ConfiguredObjectRecord.class);
+ when(record.getId()).thenReturn(UUID.randomUUID());
+ when(record.getType()).thenReturn(category);
+ final Map<String, Object> attributes = new HashMap<>();
+ attributes.put("name", getTestName());
+ attributes.put("type", type);
+ attributes.put("context", context);
+ when(record.getAttributes()).thenReturn(attributes);
+ return record;
+ }
+
+ private Map<String, Object> getContextForRecordWithGivenId(final UUID rootRecordId,
+ final List<ConfiguredObjectRecord> upgradedRecords)
+ {
+ final ConfiguredObjectRecord upgradedRecord = findRecordById(rootRecordId, upgradedRecords);
+ assertNotNull(upgradedRecord);
+ final Map<String, Object> attributes = upgradedRecord.getAttributes();
+ assertNotNull(attributes);
+
+ final Object context = attributes.get("context");
+ assertTrue(context instanceof Map);
+ @SuppressWarnings("unchecked")
+ final Map<String, Object> contextMap = (Map<String, Object>) context;
+ return contextMap;
+ }
+
}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
deleted file mode 100644
index 0c39f8f..0000000
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerController.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.management.plugin.controller.v7_0.category;
-
-
-import java.util.Set;
-
-import org.apache.qpid.server.management.plugin.controller.GenericLegacyConfiguredObject;
-import org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject;
-import org.apache.qpid.server.management.plugin.controller.LegacyManagementController;
-import org.apache.qpid.server.management.plugin.controller.TypeController;
-
-
-class ContainerController extends LegacyCategoryController
-{
- ContainerController(final LegacyManagementController legacyManagementController,
- final String type,
- final String parentType,
- final String defaultType,
- final Set<TypeController> typeControllers)
- {
- super(legacyManagementController, type, parentType, defaultType, typeControllers);
- }
-
- @Override
- protected LegacyConfiguredObject convertNextVersionLegacyConfiguredObject(final LegacyConfiguredObject object)
- {
- return new LegacyContainer(getManagementController(), object, getCategory());
- }
-
- static class LegacyContainer extends GenericLegacyConfiguredObject
- {
- private static final String MODEL_VERSION = "modelVersion";
-
- LegacyContainer(final LegacyManagementController managementController,
- final LegacyConfiguredObject nextVersionLegacyConfiguredObject,
- final String category)
- {
- super(managementController, nextVersionLegacyConfiguredObject, category);
- }
-
- @Override
- public Object getAttribute(final String name)
- {
- if (MODEL_VERSION.equals(name))
- {
- return getManagementController().getVersion();
- }
- return super.getAttribute(name);
- }
-
- @Override
- public Object getActualAttribute(final String name)
- {
- if (MODEL_VERSION.equals(name))
- {
- return getManagementController().getVersion();
- }
- return super.getActualAttribute(name);
- }
-
- @Override
- public LegacyConfiguredObject getParent(final String category)
- {
- if (LegacyCategoryControllerFactory.CATEGORY_BROKER.equals(getCategory())
- && LegacyCategoryControllerFactory.CATEGORY_SYSTEM_CONFIG.equals(category))
- {
- LegacyConfiguredObject nextVersionParent = getNextVersionLegacyConfiguredObject().getParent(category);
- return new GenericLegacyConfiguredObject(getManagementController(),
- nextVersionParent,
- category);
- }
- return super.getParent(category);
- }
- }
-}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerDecorator.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerDecorator.java
new file mode 100644
index 0000000..33695d7
--- /dev/null
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/ContainerDecorator.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.controller.v7_0.category;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.qpid.server.management.plugin.ManagementResponse;
+import org.apache.qpid.server.management.plugin.controller.GenericLegacyConfiguredObject;
+import org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject;
+
+public class ContainerDecorator implements LegacyConfiguredObject
+{
+ private static final String MODEL_VERSION = "modelVersion";
+ private final GenericLegacyConfiguredObject _original;
+
+ public ContainerDecorator(final GenericLegacyConfiguredObject original)
+ {
+ _original = original;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ return _original.getAttributeNames();
+ }
+
+ @Override
+ public Object getAttribute(final String name)
+ {
+ if (MODEL_VERSION.equals(name))
+ {
+ return _original.getManagementController().getVersion();
+ }
+ return _original.getAttribute(name);
+ }
+
+ @Override
+ public Map<String, Object> getStatistics()
+ {
+ return _original.getStatistics();
+ }
+
+ @Override
+ public Object getActualAttribute(final String name)
+ {
+ if (MODEL_VERSION.equals(name))
+ {
+ return _original.getManagementController().getVersion();
+ }
+ return _original.getActualAttribute(name);
+ }
+
+ @Override
+ public boolean isSecureAttribute(final String name)
+ {
+ return _original.isSecureAttribute(name);
+ }
+
+ @Override
+ public boolean isOversizedAttribute(final String name)
+ {
+ return _original.isOversizedAttribute(name);
+ }
+
+ @Override
+ public String getCategory()
+ {
+ return _original.getCategory();
+ }
+
+ @Override
+ public Collection<LegacyConfiguredObject> getChildren(final String category)
+ {
+ return _original.getChildren(category);
+ }
+
+ @Override
+ public LegacyConfiguredObject getParent(final String category)
+ {
+ if (LegacyCategoryControllerFactory.CATEGORY_BROKER.equals(getCategory())
+ && LegacyCategoryControllerFactory.CATEGORY_SYSTEM_CONFIG.equals(category))
+ {
+ LegacyConfiguredObject nextVersionParent = _original.getNextVersionConfiguredObject().getParent(category);
+ return new GenericLegacyConfiguredObject(_original.getManagementController(),
+ nextVersionParent,
+ category);
+ }
+ return _original.getParent(category);
+ }
+
+ @Override
+ public String getContextValue(final String contextKey)
+ {
+ return _original.getContextValue(contextKey);
+ }
+
+ @Override
+ public ManagementResponse invoke(final String operation,
+ final Map<String, Object> parameters,
+ final boolean isSecure)
+ {
+ return _original.invoke(operation, parameters, isSecure);
+ }
+
+ @Override
+ public LegacyConfiguredObject getNextVersionConfiguredObject()
+ {
+ return _original.getNextVersionConfiguredObject();
+ }
+}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryController.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryController.java
index 7aad335..deffdf8 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryController.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryController.java
@@ -33,7 +33,7 @@
{
private final String _parentCategory;
- LegacyCategoryController(final LegacyManagementController managementController,
+ public LegacyCategoryController(final LegacyManagementController managementController,
final String name,
final String parentCategory,
final String defaultType,
@@ -56,8 +56,13 @@
@Override
protected LegacyConfiguredObject convertNextVersionLegacyConfiguredObject(final LegacyConfiguredObject object)
{
- return new GenericLegacyConfiguredObject(getManagementController(),
- object,
- getCategory());
+ final GenericLegacyConfiguredObject legacyegacyConfiguredObject =
+ new GenericLegacyConfiguredObject(getManagementController(), object, getCategory());
+ if (LegacyCategoryControllerFactory.CATEGORY_VIRTUAL_HOST.equals(getCategory())
+ || LegacyCategoryControllerFactory.CATEGORY_BROKER.equals(getCategory()))
+ {
+ return new ContainerDecorator(legacyegacyConfiguredObject);
+ }
+ return legacyegacyConfiguredObject;
}
}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
index 92373b9..e413d26 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory.java
@@ -34,23 +34,23 @@
@PluggableService
public class LegacyCategoryControllerFactory implements CategoryControllerFactory
{
- static final String CATEGORY_BROKER = "Broker";
+ public static final String CATEGORY_BROKER = "Broker";
private static final String CATEGORY_BROKER_LOGGER = "BrokerLogger";
private static final String CATEGORY_BROKER_LOG_INCLUSION_RULE = "BrokerLogInclusionRule";
- private static final String CATEGORY_AUTHENTICATION_PROVIDER = "AuthenticationProvider";
+ public static final String CATEGORY_AUTHENTICATION_PROVIDER = "AuthenticationProvider";
private static final String CATEGORY_USER = "User";
private static final String CATEGORY_ACCESS_CONTROL_PROVIDER = "AccessControlProvider";
private static final String CATEGORY_PLUGIN = "Plugin";
private static final String CATEGORY_TRUST_STORE = "TrustStore";
private static final String CATEGORY_KEY_STORE = "KeyStore";
- private static final String CATEGORY_PORT = "Port";
+ public static final String CATEGORY_PORT = "Port";
private static final String CATEGORY_VIRTUAL_HOST_ALIAS = "VirtualHostAlias";
private static final String CATEGORY_GROUP_PROVIDER = "GroupProvider";
private static final String CATEGORY_GROUP = "Group";
private static final String CATEGORY_GROUP_MEMBER = "GroupMember";
private static final String CATEGORY_VIRTUAL_HOST_NODE = "VirtualHostNode";
private static final String CATEGORY_REMOTE_REPLICATION_NODE = "RemoteReplicationNode";
- static final String CATEGORY_VIRTUAL_HOST = "VirtualHost";
+ public static final String CATEGORY_VIRTUAL_HOST = "VirtualHost";
private static final String CATEGORY_VIRTUAL_HOST_LOGGER = "VirtualHostLogger";
private static final String CATEGORY_VIRTUAL_HOST_LOG_INCLUSION_RULE = "VirtualHostLogInclusionRule";
private static final String CATEGORY_VIRTUAL_HOST_ACCESS_CONTROL_PROVIDER = "VirtualHostAccessControlProvider";
@@ -60,7 +60,7 @@
private static final String CATEGORY_CONNECTION = "Connection";
private static final String CATEGORY_SESSION = "Session";
static final String CATEGORY_SYSTEM_CONFIG = "SystemConfig";
- static final Map<String, String> SUPPORTED_CATEGORIES =
+ public static final Map<String, String> SUPPORTED_CATEGORIES =
Collections.unmodifiableMap(new HashMap<String, String>()
{
{
@@ -92,7 +92,7 @@
}
});
- private static final Map<String, String> DEFAULT_TYPES = Collections.unmodifiableMap(new HashMap<String, String>()
+ public static final Map<String, String> DEFAULT_TYPES = Collections.unmodifiableMap(new HashMap<String, String>()
{
{
put(CATEGORY_BROKER_LOGGER, "Broker");
@@ -111,22 +111,11 @@
{
if (SUPPORTED_CATEGORIES.containsKey(type))
{
- if (CATEGORY_VIRTUAL_HOST.equals(type) || CATEGORY_BROKER.equals(type))
- {
- return new ContainerController(legacyManagementController,
- type,
- SUPPORTED_CATEGORIES.get(type),
- DEFAULT_TYPES.get(type),
- legacyManagementController.getTypeControllersByCategory(type));
- }
- else
- {
- return new LegacyCategoryController(legacyManagementController,
- type,
- SUPPORTED_CATEGORIES.get(type),
- DEFAULT_TYPES.get(type),
- legacyManagementController.getTypeControllersByCategory(type));
- }
+ return new LegacyCategoryController(legacyManagementController,
+ type,
+ SUPPORTED_CATEGORIES.get(type),
+ DEFAULT_TYPES.get(type),
+ legacyManagementController.getTypeControllersByCategory(type));
}
else
{
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v8_0.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v8_0.java
deleted file mode 100644
index 7be3a34..0000000
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v8_0.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.management.plugin.controller.v7_0.category;
-
-import org.apache.qpid.server.management.plugin.controller.v7_0.LegacyManagementControllerFactory_v8_0;
-import org.apache.qpid.server.plugin.PluggableService;
-
-@PluggableService
-public class LegacyCategoryControllerFactory_v8_0 extends LegacyCategoryControllerFactory
-{
- @Override
- public String getModelVersion()
- {
- return LegacyManagementControllerFactory_v8_0.MODEL_VERSION;
- }
-}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v7_1.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/LegacyManagementControllerFactory_v7_1.java
similarity index 96%
rename from broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v7_1.java
rename to broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/LegacyManagementControllerFactory_v7_1.java
index 0bd8242..c5d0439 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v7_1.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/LegacyManagementControllerFactory_v7_1.java
@@ -1,5 +1,4 @@
/*
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,7 +17,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.management.plugin.controller.v7_0;
+package org.apache.qpid.server.management.plugin.controller.v7_1;
import org.apache.qpid.server.management.plugin.HttpManagementConfiguration;
import org.apache.qpid.server.management.plugin.ManagementController;
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v7_1.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/category/LegacyCategoryControllerFactory_v7_1.java
similarity index 87%
rename from broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v7_1.java
rename to broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/category/LegacyCategoryControllerFactory_v7_1.java
index 40e02cd..cb224e0 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/category/LegacyCategoryControllerFactory_v7_1.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_1/category/LegacyCategoryControllerFactory_v7_1.java
@@ -1,5 +1,4 @@
/*
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,9 +17,10 @@
* under the License.
*
*/
-package org.apache.qpid.server.management.plugin.controller.v7_0.category;
+package org.apache.qpid.server.management.plugin.controller.v7_1.category;
-import org.apache.qpid.server.management.plugin.controller.v7_0.LegacyManagementControllerFactory_v7_1;
+import org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryControllerFactory;
+import org.apache.qpid.server.management.plugin.controller.v7_1.LegacyManagementControllerFactory_v7_1;
import org.apache.qpid.server.plugin.PluggableService;
@PluggableService
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v8_0.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/LegacyManagementControllerFactory_v8_0.java
similarity index 86%
rename from broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v8_0.java
rename to broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/LegacyManagementControllerFactory_v8_0.java
index 977029e..9aa6d17 100644
--- a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v7_0/LegacyManagementControllerFactory_v8_0.java
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/LegacyManagementControllerFactory_v8_0.java
@@ -1,5 +1,4 @@
/*
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,11 +17,12 @@
* under the License.
*
*/
-package org.apache.qpid.server.management.plugin.controller.v7_0;
+package org.apache.qpid.server.management.plugin.controller.v8_0;
import org.apache.qpid.server.management.plugin.HttpManagementConfiguration;
import org.apache.qpid.server.management.plugin.ManagementController;
import org.apache.qpid.server.management.plugin.ManagementControllerFactory;
+import org.apache.qpid.server.management.plugin.controller.v7_0.LegacyManagementController;
import org.apache.qpid.server.plugin.PluggableService;
@PluggableService
@@ -53,7 +53,8 @@
final ManagementController nextVersionManagementController)
{
- LegacyManagementController controller = new LegacyManagementController(nextVersionManagementController, MODEL_VERSION);
+ LegacyManagementController
+ controller = new LegacyManagementController(nextVersionManagementController, MODEL_VERSION);
controller.initialize();
return controller;
}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryControllerFactory_v8_0.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryControllerFactory_v8_0.java
new file mode 100644
index 0000000..fee75db
--- /dev/null
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryControllerFactory_v8_0.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.management.plugin.controller.v8_0.category;
+
+import org.apache.qpid.server.management.plugin.controller.CategoryController;
+import org.apache.qpid.server.management.plugin.controller.LegacyManagementController;
+import org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryControllerFactory;
+import org.apache.qpid.server.management.plugin.controller.v8_0.LegacyManagementControllerFactory_v8_0;
+import org.apache.qpid.server.plugin.PluggableService;
+
+@PluggableService
+public class LegacyCategoryControllerFactory_v8_0 extends LegacyCategoryControllerFactory
+{
+ @Override
+ public String getModelVersion()
+ {
+ return LegacyManagementControllerFactory_v8_0.MODEL_VERSION;
+ }
+
+
+ @Override
+ public CategoryController createController(final String type,
+ final LegacyManagementController legacyManagementController)
+ {
+ if (SUPPORTED_CATEGORIES.containsKey(type))
+ {
+ return new LegacyCategoryController_v8_0(legacyManagementController,
+ type,
+ SUPPORTED_CATEGORIES.get(type),
+ DEFAULT_TYPES.get(type),
+ legacyManagementController.getTypeControllersByCategory(type));
+ }
+ else
+ {
+ throw new IllegalArgumentException(String.format("Unsupported type '%s'", type));
+ }
+ }
+}
diff --git a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0.java b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0.java
new file mode 100644
index 0000000..cdf25aa
--- /dev/null
+++ b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0.java
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.controller.v8_0.category;
+
+import static org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryControllerFactory.CATEGORY_AUTHENTICATION_PROVIDER;
+import static org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryControllerFactory.CATEGORY_PORT;
+import static org.apache.qpid.server.store.UpgraderHelper.MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.qpid.server.management.plugin.controller.GenericLegacyConfiguredObject;
+import org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject;
+import org.apache.qpid.server.management.plugin.controller.LegacyManagementController;
+import org.apache.qpid.server.management.plugin.controller.TypeController;
+import org.apache.qpid.server.management.plugin.controller.v7_0.category.ContainerDecorator;
+import org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryController;
+import org.apache.qpid.server.management.plugin.controller.v7_0.category.LegacyCategoryControllerFactory;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.store.UpgraderHelper;
+
+public class LegacyCategoryController_v8_0 extends LegacyCategoryController
+{
+ private static final Map<String, String> NEW_TO_OLD =
+ UpgraderHelper.reverse(MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES);
+
+
+ LegacyCategoryController_v8_0(final LegacyManagementController legacyManagementController,
+ final String type,
+ final String parentCategory,
+ final String defaultType,
+ final Set<TypeController> typeControllersByCategory)
+ {
+ super(legacyManagementController, type, parentCategory, defaultType, typeControllersByCategory);
+ }
+
+
+ @Override
+ protected LegacyConfiguredObject convertNextVersionLegacyConfiguredObject(final LegacyConfiguredObject object)
+ {
+ final LegacyConfiguredObject_v8_0 converted = new LegacyConfiguredObject_v8_0(getManagementController(),
+ object,
+ getCategory());
+ if (LegacyCategoryControllerFactory.CATEGORY_VIRTUAL_HOST.equals(getCategory())
+ || LegacyCategoryControllerFactory.CATEGORY_BROKER.equals(getCategory()))
+ {
+ return new ContainerDecorator(converted);
+ }
+ return converted;
+ }
+
+ @Override
+ protected Map<String, Object> convertAttributesToNextVersion(final ConfiguredObject<?> root,
+ final List<String> path,
+ final Map<String, Object> attributes)
+ {
+ Map<String, Object> nextVersionAttributes;
+ if (attributes.containsKey("context"))
+ {
+ nextVersionAttributes = convertContextToNextVersion(attributes);
+ }
+ else
+ {
+ nextVersionAttributes = attributes;
+ }
+ return super.convertAttributesToNextVersion(root, path, nextVersionAttributes);
+ }
+
+ private Map<String, Object> convertContextToNextVersion(final Map<String, Object> attributes)
+ {
+ final Object context = attributes.get("context");
+ if (context instanceof Map)
+ {
+ @SuppressWarnings("unchecked") final Map<String, String> oldContext = (Map<String, String>) context;
+ final Map<String, String> newContext = UpgraderHelper.renameContextVariables(oldContext,
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES);
+ final Map<String, Object> nextVersionAttributes = new HashMap<>(attributes);
+ nextVersionAttributes.put("context", newContext);
+ return nextVersionAttributes;
+ }
+ return attributes;
+ }
+
+ static class LegacyConfiguredObject_v8_0 extends GenericLegacyConfiguredObject
+ {
+ private static final Map<String, String> ALLOW_DENY_TO_WHITE_BLACK_MAPPING = new HashMap<>();
+
+ static
+ {
+ ALLOW_DENY_TO_WHITE_BLACK_MAPPING.put("tlsProtocolAllowList", "tlsProtocolWhiteList");
+ ALLOW_DENY_TO_WHITE_BLACK_MAPPING.put("tlsProtocolDenyList", "tlsProtocolBlackList");
+ ALLOW_DENY_TO_WHITE_BLACK_MAPPING.put("tlsCipherSuiteAllowList", "tlsCipherSuiteWhiteList");
+ ALLOW_DENY_TO_WHITE_BLACK_MAPPING.put("tlsCipherSuiteDenyList", "tlsCipherSuiteBlackList");
+ }
+
+ private static final Map<String, String> WHITE_BLACK_TO_ALLOW_DENY_MAPPING =
+ UpgraderHelper.reverse(ALLOW_DENY_TO_WHITE_BLACK_MAPPING);
+
+ LegacyConfiguredObject_v8_0(final LegacyManagementController managementController,
+ final LegacyConfiguredObject nextVersionLegacyConfiguredObject,
+ final String category)
+ {
+ super(managementController, nextVersionLegacyConfiguredObject, category);
+ }
+
+ @Override
+ public Object getAttribute(final String name)
+ {
+ Object value;
+ if ("context".equals(name))
+ {
+ return convertContextToModelVersion(super.getAttribute(name));
+ }
+ else if (isPortOrAuthenticationPovider() && WHITE_BLACK_TO_ALLOW_DENY_MAPPING.containsKey(name))
+ {
+ value = super.getAttribute(WHITE_BLACK_TO_ALLOW_DENY_MAPPING.getOrDefault(name, name));
+ }
+ else
+ {
+ value = super.getAttribute(name);
+ }
+ return value;
+ }
+
+ private boolean isPortOrAuthenticationPovider()
+ {
+ return CATEGORY_PORT.equals(getCategory()) || CATEGORY_AUTHENTICATION_PROVIDER.equals(getCategory());
+ }
+
+ @Override
+ public Collection<String> getAttributeNames()
+ {
+ final Collection<String> attributeNames = super.getAttributeNames();
+ if (isPortOrAuthenticationPovider())
+ {
+ return attributeNames.stream()
+ .map(i -> ALLOW_DENY_TO_WHITE_BLACK_MAPPING.getOrDefault(i, i))
+ .collect(Collectors.toList());
+ }
+ return attributeNames;
+ }
+
+ @Override
+ public Object getActualAttribute(final String name)
+ {
+ Object value = super.getActualAttribute(name);
+ if ("context".equals(name))
+ {
+ return convertContextToModelVersion(value);
+ }
+ return value;
+ }
+
+ @Override
+ public String getContextValue(final String contextKey)
+ {
+ final String nextVersionName =
+ MODEL9_MAPPING_FOR_RENAME_TO_ALLOW_DENY_CONTEXT_VARIABLES.getOrDefault(contextKey, contextKey);
+ return super.getContextValue(nextVersionName);
+ }
+
+ private Object convertContextToModelVersion(final Object value)
+ {
+ if (value instanceof Map)
+ {
+ return UpgraderHelper.renameContextVariables((Map<String, String>) value, NEW_TO_OLD);
+ }
+ return null;
+ }
+ }
+}
diff --git a/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0Test.java b/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0Test.java
new file mode 100644
index 0000000..ba1a746
--- /dev/null
+++ b/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/controller/v8_0/category/LegacyCategoryController_v8_0Test.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.server.management.plugin.controller.v8_0.category;
+
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.AdditionalMatchers.not;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.qpid.server.management.plugin.ManagementController;
+import org.apache.qpid.server.management.plugin.ManagementException;
+import org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject;
+import org.apache.qpid.server.management.plugin.controller.LegacyManagementController;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+
+public class LegacyCategoryController_v8_0Test
+{
+ private static final String TEST_CATEGORY = "Port";
+ private static final String PARENT_CATEGORY = "Broker";
+ private static final String DEFAULT_TYPE = "";
+ private static final String PORT_NAME = "testPort";
+ private static final String PROTOCOL_ALLOW_LIST = "Tls.*";
+ private static final String PROTOCOL_DENY_LIST = "Ssl.*";
+ private static final String NEW_CONTEXT_TLS_PROTOCOL_ALLOW_LIST = "qpid.security.tls.protocolAllowList";
+ private static final String NEW_CONTEXT_TLS_PROTOCOL_DENY_LIST = "qpid.security.tls.protocolDenyList";
+ private static final String OLD_CONTEXT_TLS_PROTOCOL_WHITE_LIST = "qpid.security.tls.protocolWhiteList";
+ private static final String OLD_CONTEXT_TLS_PROTOCOL_BLACK_LIST = "qpid.security.tls.protocolBlackList";
+ private static final String ATTRIBUTE_NAME = "name";
+ private static final String ATTRIBUTE_CONTEXT = "context";
+
+ private LegacyCategoryController_v8_0 _controller;
+ private ConfiguredObject _root;
+ private ManagementController _nextVersionManagementController;
+
+ @Before
+ public void setUp()
+ {
+ _nextVersionManagementController = mock(ManagementController.class);
+ LegacyManagementController managementController = mock(LegacyManagementController.class);
+ when(managementController.getNextVersionManagementController()).thenReturn(_nextVersionManagementController);
+ _controller = new LegacyCategoryController_v8_0(managementController,
+ TEST_CATEGORY,
+ PARENT_CATEGORY,
+ DEFAULT_TYPE,
+ Collections.emptySet());
+
+ _root = mock(ConfiguredObject.class);
+ }
+
+ @Test
+ public void getExistingPortWithSetAllowDenyTlsProtocolSettings()
+ {
+ final List<String> path = Arrays.asList("port", PORT_NAME);
+ final Map<String, List<String>> parameters = Collections.emptyMap();
+ final LegacyConfiguredObject nextVersionPort = createNewVersionPortMock();
+
+ when(_nextVersionManagementController.get(_root,
+ TEST_CATEGORY,
+ path,
+ parameters)).thenReturn(nextVersionPort);
+
+ final Object port = _controller.get(_root, path, parameters);
+ assertThat(port, instanceOf(LegacyConfiguredObject.class));
+ final LegacyConfiguredObject newPort = (LegacyConfiguredObject)port;
+ assertPortTLSSettings(newPort);
+ }
+
+
+ @Test
+ public void testCreatePortWithSetAllowDenyTlsProtocolSettings()
+ {
+ final List<String> path = Arrays.asList("port", PORT_NAME);
+
+ final Map<String, String> oldContext = new HashMap<>();
+ oldContext.put(OLD_CONTEXT_TLS_PROTOCOL_WHITE_LIST,PROTOCOL_ALLOW_LIST);
+ oldContext.put(OLD_CONTEXT_TLS_PROTOCOL_BLACK_LIST,PROTOCOL_DENY_LIST);
+ final Map<String, Object> attributes = new HashMap<>();
+ attributes.put(ATTRIBUTE_NAME, PORT_NAME);
+ attributes.put(ATTRIBUTE_CONTEXT, oldContext);
+ attributes.put("type", "AMQP");
+
+
+ final Map<String,String> newVersionContext = new HashMap<>();
+ newVersionContext.put(NEW_CONTEXT_TLS_PROTOCOL_ALLOW_LIST, PROTOCOL_ALLOW_LIST);
+ newVersionContext.put(NEW_CONTEXT_TLS_PROTOCOL_DENY_LIST, PROTOCOL_DENY_LIST);
+ Map<String, Object> newAttributes = new HashMap<>();
+ newAttributes.put(ATTRIBUTE_NAME, PORT_NAME);
+ newAttributes.put(ATTRIBUTE_CONTEXT, newVersionContext);
+ newAttributes.put("type", "AMQP");
+
+ LegacyConfiguredObject newVersionPort = createNewVersionPortMock();
+ when(_nextVersionManagementController.createOrUpdate(eq(_root), eq(TEST_CATEGORY), eq(path), eq(newAttributes), eq(false) )).thenReturn(newVersionPort);
+ ManagementException error = ManagementException.createUnprocessableManagementException("unexpected");
+ when(_nextVersionManagementController.createOrUpdate(any(ConfiguredObject.class), anyString(), eq(path), not(eq(newAttributes)), anyBoolean())).thenThrow(error);
+ LegacyConfiguredObject port = _controller.createOrUpdate(_root, path, attributes, false) ;
+ assertThat(port, is(notNullValue()));
+ assertPortTLSSettings(port);
+ }
+
+ private void assertPortTLSSettings(final LegacyConfiguredObject port)
+ {
+ assertThat(port.getAttribute(ATTRIBUTE_NAME), equalTo(PORT_NAME));
+ assertThat(port.getContextValue(OLD_CONTEXT_TLS_PROTOCOL_WHITE_LIST), equalTo(PROTOCOL_ALLOW_LIST));
+ assertThat(port.getContextValue(OLD_CONTEXT_TLS_PROTOCOL_BLACK_LIST), equalTo(PROTOCOL_DENY_LIST));
+ final Object context = port.getAttribute(ATTRIBUTE_CONTEXT);
+ assertThat(context, instanceOf(Map.class));
+ final Map contextMap = (Map) context;
+ assertThat(contextMap.get(OLD_CONTEXT_TLS_PROTOCOL_WHITE_LIST), equalTo(PROTOCOL_ALLOW_LIST));
+ assertThat(contextMap.get(OLD_CONTEXT_TLS_PROTOCOL_BLACK_LIST), equalTo(PROTOCOL_DENY_LIST));
+ }
+ private LegacyConfiguredObject createNewVersionPortMock()
+ {
+ final LegacyConfiguredObject nextVersionPort = mock(LegacyConfiguredObject.class);
+ final Map<String,String> newVersionContext = new HashMap<>();
+ newVersionContext.put(NEW_CONTEXT_TLS_PROTOCOL_ALLOW_LIST, PROTOCOL_ALLOW_LIST);
+ newVersionContext.put(NEW_CONTEXT_TLS_PROTOCOL_DENY_LIST, PROTOCOL_DENY_LIST);
+ when(nextVersionPort.getAttribute(ATTRIBUTE_NAME)).thenReturn(PORT_NAME);
+ when(nextVersionPort.getAttribute(ATTRIBUTE_CONTEXT)).thenReturn(newVersionContext);
+ when(nextVersionPort.getContextValue(NEW_CONTEXT_TLS_PROTOCOL_ALLOW_LIST)).thenReturn(PROTOCOL_ALLOW_LIST);
+ when(nextVersionPort.getContextValue(NEW_CONTEXT_TLS_PROTOCOL_DENY_LIST)).thenReturn(PROTOCOL_DENY_LIST);
+ return nextVersionPort;
+ }
+
+}
diff --git a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v7_0/LegacyManagementTest.java b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v7_0/LegacyManagementTest.java
new file mode 100644
index 0000000..14543a8
--- /dev/null
+++ b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v7_0/LegacyManagementTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.tests.http.v7_0;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Test;
+
+import org.apache.qpid.tests.http.HttpRequestConfig;
+import org.apache.qpid.tests.http.HttpTestBase;
+
+@HttpRequestConfig(useVirtualHostAsHost = false)
+public class LegacyManagementTest extends HttpTestBase
+{
+ @Test
+ public void testModelVersion() throws Exception
+ {
+ final Map<String, Object> brokerAttributes = getHelper().getJsonAsMap("/api/v7.0/broker");
+ assertThat(brokerAttributes, is(notNullValue()));
+ assertThat(brokerAttributes.get("modelVersion"), equalTo("7.0"));
+ }
+
+}
diff --git a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v8_0/LegacyManagementTest.java b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v8_0/LegacyManagementTest.java
new file mode 100644
index 0000000..862a0e6
--- /dev/null
+++ b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/v8_0/LegacyManagementTest.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.tests.http.v8_0;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Test;
+
+import org.apache.qpid.tests.http.HttpRequestConfig;
+import org.apache.qpid.tests.http.HttpTestBase;
+
+@HttpRequestConfig(useVirtualHostAsHost = false)
+public class LegacyManagementTest extends HttpTestBase
+{
+ @Test
+ public void testModelVersion() throws Exception
+ {
+ final Map<String, Object> brokerAttributes = getHelper().getJsonAsMap("/api/v8.0/broker");
+ assertThat(brokerAttributes, is(notNullValue()));
+ assertThat(brokerAttributes.get("modelVersion"), equalTo("8.0"));
+ }
+
+ @Test
+ public void testPortAllowDenyProtocolSettings() throws Exception
+ {
+ final String authenticationProviderName = getTestName() + "AuthenticationProvider";
+ final Map<String, Object> authenticationProviderAttributes = new HashMap<>();
+ authenticationProviderAttributes.put("type", "Anonymous");
+ authenticationProviderAttributes.put("name", authenticationProviderName);
+ getHelper().submitRequest("/api/v8.0/authenticationprovider", "POST", authenticationProviderAttributes, HttpServletResponse.SC_CREATED);
+
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.protocolWhiteList", "TLSv1");
+ context.put("qpid.security.tls.protocolBlackList", "SSL.*");
+ final Map<String, Object> attributes = new HashMap<>();
+ attributes.put("name", getTestName());
+ attributes.put("type", "AMQP");
+ attributes.put("port", 0);
+ attributes.put("context", context);
+ attributes.put("authenticationProvider", authenticationProviderName);
+ getHelper().submitRequest("/api/v8.0/port", "POST", attributes, HttpServletResponse.SC_CREATED);
+
+ final Map<String, Object> portAttributes = getHelper().getJsonAsMap("port/" + getTestName());
+ assertThat(portAttributes, is(notNullValue()));
+ final Object portContext = portAttributes.get("context");
+ assertThat(portContext, instanceOf(Map.class));
+ final Map contextMap = (Map)portContext;
+ assertThat(contextMap.get("qpid.security.tls.protocolAllowList"), is(equalTo("TLSv1")));
+ assertThat(contextMap.get("qpid.security.tls.protocolDenyList"), is(equalTo("SSL.*")));
+ assertThat(portAttributes.get("tlsProtocolAllowList"),is(equalTo(Collections.singletonList("TLSv1"))));
+ assertThat(portAttributes.get("tlsProtocolDenyList"),is(equalTo(Collections.singletonList("SSL.*"))));
+
+ final Map<String, Object> portAttributes8_0 = getHelper().getJsonAsMap("/api/v8.0/port/" + getTestName());
+ assertThat(portAttributes8_0, is(notNullValue()));
+ final Object portContext8_0 = portAttributes8_0.get("context");
+ assertThat(portContext8_0, instanceOf(Map.class));
+ final Map contextMap8_0 = (Map)portContext8_0;
+ assertThat(contextMap8_0.get("qpid.security.tls.protocolWhiteList"), is(equalTo("TLSv1")));
+ assertThat(contextMap8_0.get("qpid.security.tls.protocolBlackList"), is(equalTo("SSL.*")));
+ assertThat(portAttributes8_0.get("tlsProtocolWhiteList"),is(equalTo(Collections.singletonList("TLSv1"))));
+ assertThat(portAttributes8_0.get("tlsProtocolBlackList"),is(equalTo(Collections.singletonList("SSL.*"))));
+ }
+
+ @Test
+ public void testBrokerAllowDenyProtocolSettings() throws Exception
+ {
+ final Map<String, String> context = new HashMap<>();
+ context.put("qpid.security.tls.protocolWhiteList", "TLSv1");
+ context.put("qpid.security.tls.protocolBlackList", "");
+ final Map<String, Object> attributes = new HashMap<>();
+ attributes.put("context", context);
+ getHelper().submitRequest("/api/v8.0/broker", "POST", attributes, HttpServletResponse.SC_OK);
+
+ final Map<String, Object> brokerAttributes = getHelper().getJsonAsMap("broker");
+ assertThat(brokerAttributes, is(notNullValue()));
+ final Object portContext = brokerAttributes.get("context");
+ assertThat(portContext, instanceOf(Map.class));
+ final Map contextMap = (Map)portContext;
+ assertThat(contextMap.get("qpid.security.tls.protocolAllowList"), is(equalTo("TLSv1")));
+ assertThat(contextMap.get("qpid.security.tls.protocolDenyList"), is(equalTo("")));
+
+ final Map<String, Object> brokerAttributes8_0 = getHelper().getJsonAsMap("/api/v8.0/broker");
+ assertThat(brokerAttributes8_0, is(notNullValue()));
+ final Object brokerContext8_0 = brokerAttributes8_0.get("context");
+ assertThat(brokerContext8_0, instanceOf(Map.class));
+ final Map contextMap8_0 = (Map)brokerContext8_0;
+ assertThat(contextMap8_0.get("qpid.security.tls.protocolWhiteList"), is(equalTo("TLSv1")));
+ assertThat(contextMap8_0.get("qpid.security.tls.protocolBlackList"), is(equalTo("")));
+ }
+}
diff --git a/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java b/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
index deacb21..e73776f 100644
--- a/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
+++ b/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
@@ -751,8 +751,6 @@
List<String> jvmArguments = new ArrayList<>();
jvmArguments.add("java");
-// jvmArguments.add("-cp");
-// jvmArguments.add(classpath);
jvmArguments.add("-Djava.io.tmpdir=" + escape(System.getProperty("java.io.tmpdir")));
jvmArguments.add("-Dlogback.configurationFile=default-broker-logback.xml");
jvmArguments.add("-Dqpid.tests.mms.messagestore.persistence=true");