ARTEMIS-878 Use Strings in CLI JMX interaction
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/8057ec4b Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/8057ec4b Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/8057ec4b Branch: refs/heads/master Commit: 8057ec4b27fca60ccfe7d83e5b19e23e37169cc3 Parents: 1339c93 Author: jbertram <[email protected]> Authored: Fri Dec 9 18:00:53 2016 +0000 Committer: Martyn Taylor <[email protected]> Committed: Fri Dec 9 18:43:15 2016 +0000 ---------------------------------------------------------------------- .../artemis/cli/commands/address/CreateAddress.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8057ec4b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java index ac1a9a9..42f721a 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java @@ -17,9 +17,6 @@ package org.apache.activemq.artemis.cli.commands.address; -import java.util.HashSet; -import java.util.Set; - import io.airlift.airline.Command; import io.airlift.airline.Option; import org.apache.activemq.artemis.api.core.client.ClientMessage; @@ -35,7 +32,7 @@ public class CreateAddress extends AbstractAction { String name; @Option(name = "--routingTypes", description = "The routing types supported by this address, options are 'anycast' or 'multicast', enter comma separated list, defaults to 'multicast' only") - Set<RoutingType> routingTypes = new HashSet<>(); + String[] routingTypes = new String[] {RoutingType.MULTICAST.toString()}; @Option(name = "--defaultMaxConsumers", description = "Sets the default max consumers for any queues created under this address, default = -1 (no limit)") int defaultMaxConsumers = -1; @@ -54,7 +51,7 @@ public class CreateAddress extends AbstractAction { performCoreManagement(new ManagementCallback<ClientMessage>() { @Override public void setUpInvocation(ClientMessage message) throws Exception { - ManagementHelper.putOperationInvocation(message, "broker", "createAddress", getName(), routingTypes, defaultDeleteOnNoConsumers, defaultMaxConsumers); + ManagementHelper.putOperationInvocation(message, "broker", "createAddress", getName(), routingTypes); } @Override @@ -78,13 +75,16 @@ public class CreateAddress extends AbstractAction { return name; } - public Set<RoutingType> getRoutingTypes() { + public String[] getRoutingTypes() { return routingTypes; } public void setRoutingTypes(String routingTypes) { - for (String s : routingTypes.split(",")) { - this.routingTypes.add(RoutingType.valueOf(s.trim())); + String[] split = routingTypes.split(","); + this.routingTypes = new String[split.length]; + for (int i = 0; i < split.length; i++) { + RoutingType.valueOf(split[i].trim()); + this.routingTypes[i] = split[i].trim(); } }
