GEODE-3436: Restore refactoring of DurableClientCommands * See initial commit GEODE-3259 (440c87f81fab96f9ce38a2d53ded75e5fe8390d7)
Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/7ff95394 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/7ff95394 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/7ff95394 Branch: refs/heads/develop Commit: 7ff953941dc730f05d059f19014672a3e703fb63 Parents: 3387008 Author: YehEmily <emilyyeh1...@gmail.com> Authored: Mon Aug 7 11:52:14 2017 -0700 Committer: Jinmei Liao <jil...@pivotal.io> Committed: Tue Aug 29 09:27:23 2017 -0700 ---------------------------------------------------------------------- .../cli/commands/CloseDurableCQsCommand.java | 83 ++++ .../cli/commands/CloseDurableClientCommand.java | 77 ++++ .../commands/CountDurableCQEventsCommand.java | 88 ++++ .../cli/commands/DurableClientCommands.java | 420 ------------------- .../DurableClientCommandsResultBuilder.java | 164 ++++++++ .../commands/ListDurableClientCQsCommand.java | 121 ++++++ .../DurableClientCommandsController.java | 15 +- .../internal/security/TestCommand.java | 5 +- 8 files changed, 545 insertions(+), 428 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableCQsCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableCQsCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableCQsCommand.java new file mode 100644 index 0000000..61dd914 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableCQsCommand.java @@ -0,0 +1,83 @@ +/* + * 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.geode.management.internal.cli.commands; + +import java.util.List; +import java.util.Set; + +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.management.cli.CliMetaData; +import org.apache.geode.management.cli.ConverterHint; +import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.CliUtil; +import org.apache.geode.management.internal.cli.domain.MemberResult; +import org.apache.geode.management.internal.cli.functions.CloseDurableCqFunction; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.result.ResultBuilder; +import org.apache.geode.management.internal.security.ResourceOperation; +import org.apache.geode.security.ResourcePermission; + +public class CloseDurableCQsCommand implements GfshCommand { + DurableClientCommandsResultBuilder builder = new DurableClientCommandsResultBuilder(); + + @CliCommand(value = CliStrings.CLOSE_DURABLE_CQS, help = CliStrings.CLOSE_DURABLE_CQS__HELP) + @CliMetaData() + @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER, + operation = ResourcePermission.Operation.MANAGE, target = ResourcePermission.Target.QUERY) + public Result closeDurableCqs(@CliOption(key = CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID, + mandatory = true, + help = CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID__HELP) final String durableClientId, + + @CliOption(key = CliStrings.CLOSE_DURABLE_CQS__NAME, mandatory = true, + help = CliStrings.CLOSE_DURABLE_CQS__NAME__HELP) final String cqName, + + @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, + help = CliStrings.CLOSE_DURABLE_CQS__MEMBER__HELP, + optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, + + @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, + help = CliStrings.CLOSE_DURABLE_CQS__GROUP__HELP, + optionContext = ConverterHint.MEMBERGROUP) final String[] group) { + Result result; + try { + Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); + + if (targetMembers.isEmpty()) { + return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); + } + + String[] params = new String[2]; + params[0] = durableClientId; + params[1] = cqName; + + final ResultCollector<?, ?> rc = + CliUtil.executeFunction(new CloseDurableCqFunction(), params, targetMembers); + final List<MemberResult> results = (List<MemberResult>) rc.getResult(); + String failureHeader = + CliStrings.format(CliStrings.CLOSE_DURABLE_CQS__FAILURE__HEADER, cqName, durableClientId); + String successHeader = + CliStrings.format(CliStrings.CLOSE_DURABLE_CQS__SUCCESS, cqName, durableClientId); + result = builder.buildResult(results, successHeader, failureHeader); + } catch (Exception e) { + result = ResultBuilder.createGemFireErrorResult(e.getMessage()); + } + return result; + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableClientCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableClientCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableClientCommand.java new file mode 100644 index 0000000..14c9731 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CloseDurableClientCommand.java @@ -0,0 +1,77 @@ +/* + * 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.geode.management.internal.cli.commands; + +import java.util.List; +import java.util.Set; + +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.management.cli.CliMetaData; +import org.apache.geode.management.cli.ConverterHint; +import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.CliUtil; +import org.apache.geode.management.internal.cli.domain.MemberResult; +import org.apache.geode.management.internal.cli.functions.CloseDurableClientFunction; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.result.ResultBuilder; +import org.apache.geode.management.internal.security.ResourceOperation; +import org.apache.geode.security.ResourcePermission; + +public class CloseDurableClientCommand implements GfshCommand { + DurableClientCommandsResultBuilder builder = new DurableClientCommandsResultBuilder(); + + @CliCommand(value = CliStrings.CLOSE_DURABLE_CLIENTS, + help = CliStrings.CLOSE_DURABLE_CLIENTS__HELP) + @CliMetaData() + @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER, + operation = ResourcePermission.Operation.MANAGE, target = ResourcePermission.Target.QUERY) + public Result closeDurableClient( + @CliOption(key = CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID, mandatory = true, + help = CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID__HELP) final String durableClientId, + @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, + help = CliStrings.CLOSE_DURABLE_CLIENTS__MEMBER__HELP, + optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, + @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP, + optionContext = ConverterHint.MEMBERGROUP) final String[] group) { + + Result result; + try { + + Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); + + if (targetMembers.isEmpty()) { + return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); + } + + final ResultCollector<?, ?> rc = + CliUtil.executeFunction(new CloseDurableClientFunction(), durableClientId, targetMembers); + final List<MemberResult> results = (List<MemberResult>) rc.getResult(); + String failureHeader = + CliStrings.format(CliStrings.CLOSE_DURABLE_CLIENTS__FAILURE__HEADER, durableClientId); + String successHeader = + CliStrings.format(CliStrings.CLOSE_DURABLE_CLIENTS__SUCCESS, durableClientId); + result = builder.buildResult(results, successHeader, failureHeader); + } catch (Exception e) { + result = ResultBuilder.createGemFireErrorResult(e.getMessage()); + } + return result; + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CountDurableCQEventsCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CountDurableCQEventsCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CountDurableCQEventsCommand.java new file mode 100644 index 0000000..8ebc4da --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CountDurableCQEventsCommand.java @@ -0,0 +1,88 @@ +/* + * 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.geode.management.internal.cli.commands; + +import java.util.List; +import java.util.Set; + +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.management.cli.CliMetaData; +import org.apache.geode.management.cli.ConverterHint; +import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.CliUtil; +import org.apache.geode.management.internal.cli.domain.SubscriptionQueueSizeResult; +import org.apache.geode.management.internal.cli.functions.GetSubscriptionQueueSizeFunction; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.result.ResultBuilder; +import org.apache.geode.management.internal.security.ResourceOperation; +import org.apache.geode.security.ResourcePermission; + +public class CountDurableCQEventsCommand implements GfshCommand { + DurableClientCommandsResultBuilder builder = new DurableClientCommandsResultBuilder(); + + @CliCommand(value = CliStrings.COUNT_DURABLE_CQ_EVENTS, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__HELP) + @CliMetaData() + @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER, + operation = ResourcePermission.Operation.READ) + public Result countDurableCqEvents( + @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, mandatory = true, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID__HELP) final String durableClientId, + @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME__HELP) final String cqName, + @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__MEMBER__HELP, + optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, + @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, + help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP, + optionContext = ConverterHint.MEMBERGROUP) final String[] group) { + + Result result; + try { + Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); + + if (targetMembers.isEmpty()) { + return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); + } + + String[] params = new String[2]; + params[0] = durableClientId; + params[1] = cqName; + final ResultCollector<?, ?> rc = + CliUtil.executeFunction(new GetSubscriptionQueueSizeFunction(), params, targetMembers); + final List<SubscriptionQueueSizeResult> funcResults = + (List<SubscriptionQueueSizeResult>) rc.getResult(); + + String queueSizeColumnName; + + if (cqName != null && !cqName.isEmpty()) { + queueSizeColumnName = CliStrings + .format(CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, cqName); + } else { + queueSizeColumnName = CliStrings.format( + CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, durableClientId); + } + result = builder.buildTableResultForQueueSize(funcResults, queueSizeColumnName); + } catch (Exception e) { + result = ResultBuilder.createGemFireErrorResult(e.getMessage()); + } + return result; + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommands.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommands.java deleted file mode 100644 index c5d859e..0000000 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommands.java +++ /dev/null @@ -1,420 +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.geode.management.internal.cli.commands; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -import org.springframework.shell.core.annotation.CliCommand; -import org.springframework.shell.core.annotation.CliOption; - -import org.apache.geode.cache.execute.ResultCollector; -import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.management.cli.CliMetaData; -import org.apache.geode.management.cli.ConverterHint; -import org.apache.geode.management.cli.Result; -import org.apache.geode.management.internal.cli.CliUtil; -import org.apache.geode.management.internal.cli.domain.DurableCqNamesResult; -import org.apache.geode.management.internal.cli.domain.MemberResult; -import org.apache.geode.management.internal.cli.domain.SubscriptionQueueSizeResult; -import org.apache.geode.management.internal.cli.functions.CloseDurableClientFunction; -import org.apache.geode.management.internal.cli.functions.CloseDurableCqFunction; -import org.apache.geode.management.internal.cli.functions.GetSubscriptionQueueSizeFunction; -import org.apache.geode.management.internal.cli.functions.ListDurableCqNamesFunction; -import org.apache.geode.management.internal.cli.i18n.CliStrings; -import org.apache.geode.management.internal.cli.result.ErrorResultData; -import org.apache.geode.management.internal.cli.result.InfoResultData; -import org.apache.geode.management.internal.cli.result.ResultBuilder; -import org.apache.geode.management.internal.cli.result.TabularResultData; -import org.apache.geode.management.internal.security.ResourceOperation; -import org.apache.geode.security.ResourcePermission.Operation; -import org.apache.geode.security.ResourcePermission.Resource; -import org.apache.geode.security.ResourcePermission.Target; - -/** - * The DurableClientCommands class encapsulates all GemFire shell (Gfsh) commands related to durable - * clients and cqs defined in GemFire. - * </p> - */ -@SuppressWarnings("unused") -public class DurableClientCommands implements GfshCommand { - - private static final ListDurableCqNamesFunction listDurableCqNamesFunction = - new ListDurableCqNamesFunction(); - private static final CloseDurableClientFunction closeDurableClientFunction = - new CloseDurableClientFunction(); - private static final CloseDurableCqFunction closeDurableCqFunction = new CloseDurableCqFunction(); - private static final GetSubscriptionQueueSizeFunction countDurableCqEvents = - new GetSubscriptionQueueSizeFunction(); - - @CliCommand(value = CliStrings.LIST_DURABLE_CQS, help = CliStrings.LIST_DURABLE_CQS__HELP) - @CliMetaData() - @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ) - public Result listDurableClientCqs( - @CliOption(key = CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID, mandatory = true, - help = CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID__HELP) final String durableClientId, - - @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, - help = CliStrings.LIST_DURABLE_CQS__MEMBER__HELP, - optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, - - @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, - help = CliStrings.LIST_DURABLE_CQS__GROUP__HELP, - optionContext = ConverterHint.MEMBERGROUP) final String[] group) { - Result result; - try { - - boolean noResults = true; - Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); - - if (targetMembers.isEmpty()) { - return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); - } - - final ResultCollector<?, ?> rc = - CliUtil.executeFunction(new ListDurableCqNamesFunction(), durableClientId, targetMembers); - final List<DurableCqNamesResult> results = (List<DurableCqNamesResult>) rc.getResult(); - Map<String, List<String>> memberCqNamesMap = new TreeMap<>(); - Map<String, List<String>> errorMessageNodes = new HashMap<>(); - Map<String, List<String>> exceptionMessageNodes = new HashMap<>(); - - for (DurableCqNamesResult memberResult : results) { - if (memberResult != null) { - if (memberResult.isSuccessful()) { - memberCqNamesMap.put(memberResult.getMemberNameOrId(), memberResult.getCqNamesList()); - } else { - if (memberResult.isOpPossible()) { - groupByMessage(memberResult.getExceptionMessage(), memberResult.getMemberNameOrId(), - exceptionMessageNodes); - } else { - groupByMessage(memberResult.getErrorMessage(), memberResult.getMemberNameOrId(), - errorMessageNodes); - } - } - } - } - - if (!memberCqNamesMap.isEmpty()) { - TabularResultData table = ResultBuilder.createTabularResultData(); - Set<String> members = memberCqNamesMap.keySet(); - - for (String member : members) { - boolean isFirst = true; - List<String> cqNames = memberCqNamesMap.get(member); - for (String cqName : cqNames) { - if (isFirst) { - isFirst = false; - table.accumulate(CliStrings.MEMBER, member); - } else { - table.accumulate(CliStrings.MEMBER, ""); - } - table.accumulate(CliStrings.LIST_DURABLE_CQS__NAME, cqName); - } - } - result = ResultBuilder.buildResult(table); - } else { - String errorHeader = - CliStrings.format(CliStrings.LIST_DURABLE_CQS__FAILURE__HEADER, durableClientId); - result = ResultBuilder.buildResult( - buildFailureData(null, exceptionMessageNodes, errorMessageNodes, errorHeader)); - } - } catch (Exception e) { - result = ResultBuilder.createGemFireErrorResult(e.getMessage()); - } - - return result; - } - - @CliCommand(value = CliStrings.COUNT_DURABLE_CQ_EVENTS, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__HELP) - @CliMetaData() - @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ) - public Result countDurableCqEvents( - @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, mandatory = true, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID__HELP) final String durableClientId, - @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME__HELP) final String cqName, - @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__MEMBER__HELP, - optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, - @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP, - optionContext = ConverterHint.MEMBERGROUP) final String[] group) { - - Result result; - try { - Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); - - if (targetMembers.isEmpty()) { - return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); - } - - String[] params = new String[2]; - params[0] = durableClientId; - params[1] = cqName; - final ResultCollector<?, ?> rc = - CliUtil.executeFunction(new GetSubscriptionQueueSizeFunction(), params, targetMembers); - final List<SubscriptionQueueSizeResult> funcResults = - (List<SubscriptionQueueSizeResult>) rc.getResult(); - - String queueSizeColumnName; - - if (cqName != null && !cqName.isEmpty()) { - queueSizeColumnName = CliStrings - .format(CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, cqName); - } else { - queueSizeColumnName = CliStrings.format( - CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, durableClientId); - } - result = buildTableResultForQueueSize(funcResults, queueSizeColumnName); - } catch (Exception e) { - result = ResultBuilder.createGemFireErrorResult(e.getMessage()); - } - - return result; - } - - @CliCommand(value = CliStrings.CLOSE_DURABLE_CLIENTS, - help = CliStrings.CLOSE_DURABLE_CLIENTS__HELP) - @CliMetaData() - @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE, - target = Target.QUERY) - public Result closeDurableClient( - @CliOption(key = CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID, mandatory = true, - help = CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID__HELP) final String durableClientId, - @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, - help = CliStrings.CLOSE_DURABLE_CLIENTS__MEMBER__HELP, - optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, - @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, - help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP, - optionContext = ConverterHint.MEMBERGROUP) final String[] group) { - - Result result; - try { - - Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); - - if (targetMembers.isEmpty()) { - return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); - } - - final ResultCollector<?, ?> rc = - CliUtil.executeFunction(new CloseDurableClientFunction(), durableClientId, targetMembers); - final List<MemberResult> results = (List<MemberResult>) rc.getResult(); - String failureHeader = - CliStrings.format(CliStrings.CLOSE_DURABLE_CLIENTS__FAILURE__HEADER, durableClientId); - String successHeader = - CliStrings.format(CliStrings.CLOSE_DURABLE_CLIENTS__SUCCESS, durableClientId); - result = buildResult(results, successHeader, failureHeader); - } catch (Exception e) { - result = ResultBuilder.createGemFireErrorResult(e.getMessage()); - } - return result; - } - - - @CliCommand(value = CliStrings.CLOSE_DURABLE_CQS, help = CliStrings.CLOSE_DURABLE_CQS__HELP) - @CliMetaData() - @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE, - target = Target.QUERY) - public Result closeDurableCqs(@CliOption(key = CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID, - mandatory = true, - help = CliStrings.CLOSE_DURABLE_CQS__DURABLE__CLIENT__ID__HELP) final String durableClientId, - - @CliOption(key = CliStrings.CLOSE_DURABLE_CQS__NAME, mandatory = true, - help = CliStrings.CLOSE_DURABLE_CQS__NAME__HELP) final String cqName, - - @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, - help = CliStrings.CLOSE_DURABLE_CQS__MEMBER__HELP, - optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, - - @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, - help = CliStrings.CLOSE_DURABLE_CQS__GROUP__HELP, - optionContext = ConverterHint.MEMBERGROUP) final String[] group) { - Result result; - try { - Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); - - if (targetMembers.isEmpty()) { - return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); - } - - String[] params = new String[2]; - params[0] = durableClientId; - params[1] = cqName; - - final ResultCollector<?, ?> rc = - CliUtil.executeFunction(new CloseDurableCqFunction(), params, targetMembers); - final List<MemberResult> results = (List<MemberResult>) rc.getResult(); - String failureHeader = - CliStrings.format(CliStrings.CLOSE_DURABLE_CQS__FAILURE__HEADER, cqName, durableClientId); - String successHeader = - CliStrings.format(CliStrings.CLOSE_DURABLE_CQS__SUCCESS, cqName, durableClientId); - result = buildResult(results, successHeader, failureHeader); - } catch (Exception e) { - result = ResultBuilder.createGemFireErrorResult(e.getMessage()); - } - return result; - } - - - private Result buildResult(List<MemberResult> results, String successHeader, - String failureHeader) { - Result result; - boolean failure = true; - boolean partialFailure = false; - Map<String, List<String>> errorMap = new HashMap<>(); - Map<String, List<String>> successMap = new HashMap<>(); - Map<String, List<String>> exceptionMap = new HashMap<>(); - - /* - * Aggregate the results from the members - */ - for (MemberResult memberResult : results) { - - if (memberResult.isSuccessful()) { - failure = false; - groupByMessage(memberResult.getSuccessMessage(), memberResult.getMemberNameOrId(), - successMap); - } else { - - if (memberResult.isOpPossible()) { - partialFailure = true; - groupByMessage(memberResult.getExceptionMessage(), memberResult.getMemberNameOrId(), - exceptionMap); - - } else { - groupByMessage(memberResult.getErrorMessage(), memberResult.getMemberNameOrId(), - errorMap); - } - } - } - - if (!failure && !partialFailure) { - result = ResultBuilder.buildResult(buildSuccessData(successMap)); - } else { - result = ResultBuilder - .buildResult(buildFailureData(successMap, exceptionMap, errorMap, failureHeader)); - } - return result; - } - - private Result buildTableResultForQueueSize(List<SubscriptionQueueSizeResult> results, - String queueSizeColumnName) { - Result result; - boolean failure = true; - - Map<String, List<String>> failureMap = new HashMap<>(); - Map<String, Long> memberQueueSizeTable = new TreeMap<>(); - - /* - * Aggregate the results from the members - */ - for (SubscriptionQueueSizeResult memberResult : results) { - - if (memberResult.isSuccessful()) { - failure = false; - memberQueueSizeTable.put(memberResult.getMemberNameOrId(), - memberResult.getSubscriptionQueueSize()); - } else { - groupByMessage(memberResult.getErrorMessage(), memberResult.getMemberNameOrId(), - failureMap); - } - } - - if (!failure) { - TabularResultData table = ResultBuilder.createTabularResultData(); - - Set<String> members = memberQueueSizeTable.keySet(); - - for (String member : members) { - long queueSize = memberQueueSizeTable.get(member); - table.accumulate(CliStrings.MEMBER, member); - table.accumulate(queueSizeColumnName, queueSize); - } - result = ResultBuilder.buildResult(table); - - } else { - ErrorResultData erd = ResultBuilder.createErrorResultData(); - buildErrorResult(erd, failureMap); - result = ResultBuilder.buildResult(erd); - } - return result; - } - - private void groupByMessage(String message, String memberNameOrId, - Map<String, List<String>> map) { - List<String> members = map.get(message); - - if (members == null) { - members = new LinkedList<>(); - } - members.add(memberNameOrId); - map.put(message, members); - } - - - private InfoResultData buildSuccessData(Map<String, List<String>> successMap) { - InfoResultData ird = ResultBuilder.createInfoResultData(); - Set<String> successMessages = successMap.keySet(); - - for (String successMessage : successMessages) { - ird.addLine(CliStrings.format(CliStrings.ACTION_SUCCEEDED_ON_MEMBER, successMessage)); - - List<String> successfulMembers = successMap.get(successMessage); - int num = 0; - for (String member : successfulMembers) { - ird.addLine("" + ++num + "." + member); - } - ird.addLine("\n"); - } - return ird; - } - - private ErrorResultData buildFailureData(Map<String, List<String>> successMap, - Map<String, List<String>> exceptionMap, Map<String, List<String>> errorMap, - String errorHeader) { - ErrorResultData erd = ResultBuilder.createErrorResultData(); - buildErrorResult(erd, successMap); - erd.addLine("\n"); - erd.addLine(errorHeader); - buildErrorResult(erd, exceptionMap); - buildErrorResult(erd, errorMap); - return erd; - } - - private void buildErrorResult(ErrorResultData erd, Map<String, List<String>> resultMap) { - if (resultMap != null && !resultMap.isEmpty()) { - Set<String> messages = resultMap.keySet(); - - for (String message : messages) { - erd.addLine("\n"); - erd.addLine(message); - erd.addLine(CliStrings.OCCURRED_ON_MEMBERS); - List<String> members = resultMap.get(message); - int num = 0; - for (String member : members) { - ++num; - erd.addLine("" + num + "." + member); - } - } - } - } -} - http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommandsResultBuilder.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommandsResultBuilder.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommandsResultBuilder.java new file mode 100644 index 0000000..743602a --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DurableClientCommandsResultBuilder.java @@ -0,0 +1,164 @@ +/* + * 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.geode.management.internal.cli.commands; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.domain.MemberResult; +import org.apache.geode.management.internal.cli.domain.SubscriptionQueueSizeResult; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.result.ErrorResultData; +import org.apache.geode.management.internal.cli.result.InfoResultData; +import org.apache.geode.management.internal.cli.result.ResultBuilder; +import org.apache.geode.management.internal.cli.result.TabularResultData; + +public class DurableClientCommandsResultBuilder { + public Result buildResult(List<MemberResult> results, String successHeader, + String failureHeader) { + Result result; + boolean failure = true; + boolean partialFailure = false; + Map<String, List<String>> errorMap = new HashMap<>(); + Map<String, List<String>> successMap = new HashMap<>(); + Map<String, List<String>> exceptionMap = new HashMap<>(); + + // Aggregate the results from the members + for (MemberResult memberResult : results) { + if (memberResult.isSuccessful()) { + failure = false; + groupByMessage(memberResult.getSuccessMessage(), memberResult.getMemberNameOrId(), + successMap); + } else { + if (memberResult.isOpPossible()) { + partialFailure = true; + groupByMessage(memberResult.getExceptionMessage(), memberResult.getMemberNameOrId(), + exceptionMap); + } else { + groupByMessage(memberResult.getErrorMessage(), memberResult.getMemberNameOrId(), + errorMap); + } + } + } + + if (!failure && !partialFailure) { + result = ResultBuilder.buildResult(buildSuccessData(successMap)); + } else { + result = ResultBuilder + .buildResult(buildFailureData(successMap, exceptionMap, errorMap, failureHeader)); + } + return result; + } + + Result buildTableResultForQueueSize(List<SubscriptionQueueSizeResult> results, + String queueSizeColumnName) { + Result result; + boolean failure = true; + + Map<String, List<String>> failureMap = new HashMap<>(); + Map<String, Long> memberQueueSizeTable = new TreeMap<>(); + + // Aggregate the results from the members + for (SubscriptionQueueSizeResult memberResult : results) { + if (memberResult.isSuccessful()) { + failure = false; + memberQueueSizeTable.put(memberResult.getMemberNameOrId(), + memberResult.getSubscriptionQueueSize()); + } else { + groupByMessage(memberResult.getErrorMessage(), memberResult.getMemberNameOrId(), + failureMap); + } + } + + if (!failure) { + TabularResultData table = ResultBuilder.createTabularResultData(); + Set<String> members = memberQueueSizeTable.keySet(); + + for (String member : members) { + long queueSize = memberQueueSizeTable.get(member); + table.accumulate(CliStrings.MEMBER, member); + table.accumulate(queueSizeColumnName, queueSize); + } + result = ResultBuilder.buildResult(table); + } else { + ErrorResultData erd = ResultBuilder.createErrorResultData(); + buildErrorResult(erd, failureMap); + result = ResultBuilder.buildResult(erd); + } + return result; + } + + void groupByMessage(String message, String memberNameOrId, Map<String, List<String>> map) { + List<String> members = map.get(message); + if (members == null) { + members = new LinkedList<>(); + } + members.add(memberNameOrId); + map.put(message, members); + } + + + private InfoResultData buildSuccessData(Map<String, List<String>> successMap) { + InfoResultData ird = ResultBuilder.createInfoResultData(); + Set<String> successMessages = successMap.keySet(); + + for (String successMessage : successMessages) { + ird.addLine(CliStrings.format(CliStrings.ACTION_SUCCEEDED_ON_MEMBER, successMessage)); + List<String> successfulMembers = successMap.get(successMessage); + int num = 0; + for (String member : successfulMembers) { + ird.addLine("" + ++num + "." + member); + } + ird.addLine("\n"); + } + return ird; + } + + ErrorResultData buildFailureData(Map<String, List<String>> successMap, + Map<String, List<String>> exceptionMap, Map<String, List<String>> errorMap, + String errorHeader) { + ErrorResultData erd = ResultBuilder.createErrorResultData(); + buildErrorResult(erd, successMap); + erd.addLine("\n"); + erd.addLine(errorHeader); + buildErrorResult(erd, exceptionMap); + buildErrorResult(erd, errorMap); + return erd; + } + + private void buildErrorResult(ErrorResultData erd, Map<String, List<String>> resultMap) { + if (resultMap != null && !resultMap.isEmpty()) { + Set<String> messages = resultMap.keySet(); + + for (String message : messages) { + erd.addLine("\n"); + erd.addLine(message); + erd.addLine(CliStrings.OCCURRED_ON_MEMBERS); + List<String> members = resultMap.get(message); + int num = 0; + for (String member : members) { + ++num; + erd.addLine("" + num + "." + member); + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDurableClientCQsCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDurableClientCQsCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDurableClientCQsCommand.java new file mode 100644 index 0000000..011bfde --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDurableClientCQsCommand.java @@ -0,0 +1,121 @@ +/* + * 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.geode.management.internal.cli.commands; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.management.cli.CliMetaData; +import org.apache.geode.management.cli.ConverterHint; +import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.CliUtil; +import org.apache.geode.management.internal.cli.domain.DurableCqNamesResult; +import org.apache.geode.management.internal.cli.functions.ListDurableCqNamesFunction; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.result.ResultBuilder; +import org.apache.geode.management.internal.cli.result.TabularResultData; +import org.apache.geode.management.internal.security.ResourceOperation; +import org.apache.geode.security.ResourcePermission; + +public class ListDurableClientCQsCommand implements GfshCommand { + DurableClientCommandsResultBuilder builder = new DurableClientCommandsResultBuilder(); + + @CliCommand(value = CliStrings.LIST_DURABLE_CQS, help = CliStrings.LIST_DURABLE_CQS__HELP) + @CliMetaData() + @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER, + operation = ResourcePermission.Operation.READ) + public Result listDurableClientCQs( + @CliOption(key = CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID, mandatory = true, + help = CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID__HELP) final String durableClientId, + + @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, + help = CliStrings.LIST_DURABLE_CQS__MEMBER__HELP, + optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, + + @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, + help = CliStrings.LIST_DURABLE_CQS__GROUP__HELP, + optionContext = ConverterHint.MEMBERGROUP) final String[] group) { + Result result; + try { + + boolean noResults = true; + Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId); + + if (targetMembers.isEmpty()) { + return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); + } + + final ResultCollector<?, ?> rc = + CliUtil.executeFunction(new ListDurableCqNamesFunction(), durableClientId, targetMembers); + final List<DurableCqNamesResult> results = (List<DurableCqNamesResult>) rc.getResult(); + Map<String, List<String>> memberCqNamesMap = new TreeMap<>(); + Map<String, List<String>> errorMessageNodes = new HashMap<>(); + Map<String, List<String>> exceptionMessageNodes = new HashMap<>(); + + for (DurableCqNamesResult memberResult : results) { + if (memberResult != null) { + if (memberResult.isSuccessful()) { + memberCqNamesMap.put(memberResult.getMemberNameOrId(), memberResult.getCqNamesList()); + } else { + if (memberResult.isOpPossible()) { + builder.groupByMessage(memberResult.getExceptionMessage(), + memberResult.getMemberNameOrId(), exceptionMessageNodes); + } else { + builder.groupByMessage(memberResult.getErrorMessage(), + memberResult.getMemberNameOrId(), errorMessageNodes); + } + } + } + } + + if (!memberCqNamesMap.isEmpty()) { + TabularResultData table = ResultBuilder.createTabularResultData(); + Set<String> members = memberCqNamesMap.keySet(); + + for (String member : members) { + boolean isFirst = true; + List<String> cqNames = memberCqNamesMap.get(member); + for (String cqName : cqNames) { + if (isFirst) { + isFirst = false; + table.accumulate(CliStrings.MEMBER, member); + } else { + table.accumulate(CliStrings.MEMBER, ""); + } + table.accumulate(CliStrings.LIST_DURABLE_CQS__NAME, cqName); + } + } + result = ResultBuilder.buildResult(table); + } else { + String errorHeader = + CliStrings.format(CliStrings.LIST_DURABLE_CQS__FAILURE__HEADER, durableClientId); + result = ResultBuilder.buildResult( + builder.buildFailureData(null, exceptionMessageNodes, errorMessageNodes, errorHeader)); + } + } catch (Exception e) { + result = ResultBuilder.createGemFireErrorResult(e.getMessage()); + } + return result; + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DurableClientCommandsController.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DurableClientCommandsController.java b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DurableClientCommandsController.java index 4562cd5..0e62e71 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DurableClientCommandsController.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DurableClientCommandsController.java @@ -14,10 +14,6 @@ */ package org.apache.geode.management.internal.web.controllers; -import org.apache.geode.distributed.ConfigurationProperties; -import org.apache.geode.internal.lang.StringUtils; -import org.apache.geode.management.internal.cli.i18n.CliStrings; -import org.apache.geode.management.internal.cli.util.CommandStringBuilder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,13 +21,20 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.apache.geode.distributed.ConfigurationProperties; +import org.apache.geode.internal.lang.StringUtils; +import org.apache.geode.management.internal.cli.i18n.CliStrings; +import org.apache.geode.management.internal.cli.util.CommandStringBuilder; + /** * The DurableClientCommandsController class implements GemFire Management REST API web service * endpoints for the durable client/CQs Gfsh commands. * <p/> * - * @see org.apache.geode.management.internal.cli.commands.DurableClientCommands - * @see org.apache.geode.management.internal.web.controllers.AbstractCommandsController + * @see org.apache.geode.management.internal.cli.commands.CloseDurableClientCommand + * @see org.apache.geode.management.internal.cli.commands.CloseDurableCQsCommand + * @see org.apache.geode.management.internal.cli.commands.CountDurableCQEventsCommand + * @see org.apache.geode.management.internal.cli.commands.ListDurableClientCQsCommand * @see org.springframework.stereotype.Controller * @see org.springframework.web.bind.annotation.PathVariable * @see org.springframework.web.bind.annotation.RequestMapping http://git-wip-us.apache.org/repos/asf/geode/blob/7ff95394/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java index 3456e8c..f681f5c 100644 --- a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java +++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java @@ -171,14 +171,15 @@ public class TestCommand { createTestCommand("alter disk-store --name=foo --region=xyz --disk-dirs=bar"); createTestCommand("destroy disk-store --name=foo", clusterManageDisk); - // DurableClientCommands + // CloseDurableClientCommand, CloseDurableCQsCommand, CountDurableCQEventsCommand, + // ListDurableClientCQsCommand createTestCommand("close durable-client --durable-client-id=client1", clusterManageQuery); createTestCommand("close durable-cq --durable-client-id=client1 --durable-cq-name=cq1", clusterManageQuery); createTestCommand("show subscription-queue-size --durable-client-id=client1", clusterRead); createTestCommand("list durable-cqs --durable-client-id=client1", clusterRead); - // ExportIMportSharedConfigurationCommands + // ExportImportSharedConfigurationCommands createTestCommand("export cluster-configuration --zip-file-name=mySharedConfig.zip", clusterRead); createTestCommand("import cluster-configuration --zip-file-name=value.zip", clusterManage);