geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [14/32] geode git commit: GEODE-2977: make group/name option values consistent
Date Wed, 31 May 2017 17:01:19 GMT
GEODE-2977: make group/name option values consistent

* this closes #536


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/c1ab3ffe
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/c1ab3ffe
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/c1ab3ffe

Branch: refs/heads/feature/GEODE-1279
Commit: c1ab3ffecb0c0a435fab64e94a97c2efc28ab085
Parents: 7b34cfd
Author: YehEmily <emilyyeh1997@gmail.com>
Authored: Tue May 23 12:27:40 2017 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Thu May 25 15:02:14 2017 -0700

----------------------------------------------------------------------
 .../apache/geode/cache/AttributesFactory.java   |  17 +--
 .../geode/internal/cache/BucketRegion.java      |  22 ---
 .../apache/geode/internal/lang/StringUtils.java |   2 -
 .../geode/management/internal/cli/CliUtil.java  |  21 ---
 .../internal/cli/commands/ConfigCommands.java   |  12 +-
 .../CreateAlterDestroyRegionCommands.java       |   9 +-
 .../internal/cli/commands/DeployCommands.java   |  20 ++-
 .../cli/commands/DiskStoreCommands.java         |  18 ++-
 .../cli/commands/DurableClientCommands.java     |  56 ++++----
 .../internal/cli/commands/FunctionCommands.java |  13 +-
 .../internal/cli/commands/IndexCommands.java    |  56 ++++----
 .../cli/commands/MiscellaneousCommands.java     |  28 ++--
 .../internal/cli/commands/QueueCommands.java    |  18 ++-
 .../internal/cli/commands/RegionCommands.java   |  13 +-
 .../internal/cli/commands/WanCommands.java      | 143 ++++++++++++-------
 .../internal/cli/CliUtilDUnitTest.java          |  81 +++++------
 16 files changed, 240 insertions(+), 289 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java b/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
index 69f1087..0d59279 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
@@ -1496,27 +1496,12 @@ public class AttributesFactory<K, V> {
             LocalizedStrings.AttributesFactory_TOTAL_SIZE_OF_PARTITION_REGION_MUST_BE_0
                 .toLocalizedString());
       }
-      // listeners are supported here as of v5.1
-      // if (attrs.getCacheListeners().length > 0) {
-      // throw new IllegalStateException(
-      // "Can not add cache listeners to RegionAttributes when PartitionAttributes are set.");
-      // }
-      // loaders are supported here as of v5.1
-      // if (attrs.getCacheLoader() != null) {
-      // throw new IllegalStateException(
-      // "Can not set CacheLoader in RegionAttributes when PartitionAttributes are set.");
-      // }
+
       if (!PartitionedRegionHelper.ALLOWED_DATA_POLICIES.contains(attrs.getDataPolicy())) {
         throw new IllegalStateException(
             LocalizedStrings.AttributesFactory_DATA_POLICIES_OTHER_THAN_0_ARE_NOT_ALLOWED_IN_PARTITIONED_REGIONS
                 .toLocalizedString(PartitionedRegionHelper.ALLOWED_DATA_POLICIES));
       }
-      // if ( attrs.getDataPolicy().isEmpty() && pa.getLocalMaxMemory() != 0) {
-      // throw new IllegalStateException(
-      // "A non-zero PartitionAttributes localMaxMemory setting is not compatible" +
-      // " with an empty DataPolicy. Please use DataPolicy.NORMAL instead.");
-      // }
-
       // fix bug #52033 by invoking getLocalMaxMemoryForValidation here
       if (((PartitionAttributesImpl) pa).getLocalMaxMemoryForValidation() < 0) {
         throw new IllegalStateException(

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
index 886d678..7bfffb7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
@@ -1848,28 +1848,6 @@ public class BucketRegion extends DistributedRegion implements Bucket {
     // if (!anyWithRouting) {
     Set failures = this.partitionedRegion.getDistributionManager().putOutgoing(prMsg);
 
-    // } else {
-    // // Send message to each member. We set a FilterRoutingInfo serialization
-    // // target so that serialization of the PutAllData objects held in the
-    // // message will only serialize the routing entry for the message recipient
-    // Iterator rIter = recipients.iterator();
-    // failures = new HashSet();
-    // while (rIter.hasNext()){
-    // InternalDistributedMember member = (InternalDistributedMember)rIter.next();
-    // FilterRoutingInfo.setSerializationTarget(member);
-    // try {
-    // prMsg.resetRecipients();
-    // prMsg.setRecipient(member);
-    // Set fs = this.partitionedRegion.getDistributionManager().putOutgoing(prMsg);
-    // if (fs != null && !fs.isEmpty()) {
-    // failures.addAll(fs);
-    // }
-    // } finally {
-    // FilterRoutingInfo.clearSerializationTarget();
-    // }
-    // }
-    // }
-
     return failures;
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java b/geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java
index 8a44564..298f44f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/lang/StringUtils.java
@@ -65,8 +65,6 @@ public class StringUtils extends org.apache.commons.lang.StringUtils {
     return buffer.toString();
   }
 
-
-
   /**
    * Gets the value of the specified Object as a String. If the Object is null then the first
    * non-null String value from the array of default String value is returned. If the array of

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
index c63b10b..038e069 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
@@ -281,27 +281,6 @@ public class CliUtil {
     return sb.toString();
   }
 
-  public static Set<DistributedMember> findMembersOrThrow(final String groups, final String members)
-      throws CommandResultException {
-
-    String[] groupsArray = (groups == null ? new String[] {} : groups.split(","));
-    String[] membersArray = (members == null ? new String[] {} : members.split(","));
-
-    return findMembersOrThrow(groupsArray, membersArray);
-  }
-
-  public static Set<DistributedMember> findMembersOrThrow(final String[] groups,
-      final String[] members) throws CommandResultException {
-
-    Set<DistributedMember> matchingMembers = findMembers(groups, members);
-    if (matchingMembers.isEmpty()) {
-      throw new CommandResultException(
-          ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE));
-    }
-
-    return matchingMembers;
-  }
-
   /**
    * Finds all Members (including both servers and locators) which belong to the given arrays of
    * groups or members.

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
index 6d3f50f..52a0a9d 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
@@ -199,18 +199,16 @@ public class ConfigCommands extends AbstractCommandsSupport {
   public Result exportConfig(
       @CliOption(key = {CliStrings.EXPORT_CONFIG__MEMBER},
           optionContext = ConverterHint.ALL_MEMBER_IDNAME,
-          help = CliStrings.EXPORT_CONFIG__MEMBER__HELP) String member,
+          help = CliStrings.EXPORT_CONFIG__MEMBER__HELP) String[] member,
       @CliOption(key = {CliStrings.EXPORT_CONFIG__GROUP}, optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.EXPORT_CONFIG__GROUP__HELP) String group,
+          help = CliStrings.EXPORT_CONFIG__GROUP__HELP) String[] group,
       @CliOption(key = {CliStrings.EXPORT_CONFIG__DIR},
           help = CliStrings.EXPORT_CONFIG__DIR__HELP) String dir) {
     InfoResultData infoData = ResultBuilder.createInfoResultData();
 
-    Set<DistributedMember> targetMembers;
-    try {
-      targetMembers = CliUtil.findMembersOrThrow(group, member);
-    } catch (CommandResultException crex) {
-      return crex.getResult();
+    Set<DistributedMember> targetMembers = CliUtil.findMembers(group, member);
+    if (targetMembers.isEmpty()) {
+      return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
     }
 
     try {

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
index b8ebc49..6e1a74e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
@@ -522,11 +522,10 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport {
             new Object[] {evictionMax}));
       }
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(groups, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> resultCollector =

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
index 4018beb..544a517 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
@@ -163,11 +163,10 @@ public class DeployCommands extends AbstractCommandsSupport {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(groups, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc =
@@ -224,17 +223,16 @@ public class DeployCommands extends AbstractCommandsSupport {
   @CliMetaData(relatedTopic = {CliStrings.TOPIC_GEODE_CONFIG})
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result listDeployed(@CliOption(key = {CliStrings.LIST_DEPLOYED__GROUP},
-      help = CliStrings.LIST_DEPLOYED__GROUP__HELP) String group) {
+      help = CliStrings.LIST_DEPLOYED__GROUP__HELP) String[] group) {
 
     try {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(group, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc =

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
index 4232d91..226cfaf 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
@@ -353,11 +353,10 @@ public class DiskStoreCommands extends AbstractCommandsSupport {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(groups, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc = CliUtil.executeFunction(new CreateDiskStoreFunction(),
@@ -1410,11 +1409,10 @@ public class DiskStoreCommands extends AbstractCommandsSupport {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(groups, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc = CliUtil.executeFunction(new DestroyDiskStoreFunction(),

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/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
index bcbfcf0..9cb87ac 100644
--- 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
@@ -73,21 +73,21 @@ public class DurableClientCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.LIST_DURABLE_CQS__MEMBER,
           help = CliStrings.LIST_DURABLE_CQS__MEMBER__HELP,
-          optionContext = ConverterHint.MEMBERIDNAME) final String memberNameOrId,
+          optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId,
 
       @CliOption(key = CliStrings.LIST_DURABLE_CQS__GROUP,
           help = CliStrings.LIST_DURABLE_CQS__GROUP__HELP,
-          optionContext = ConverterHint.MEMBERGROUP) final String group) {
+          optionContext = ConverterHint.MEMBERGROUP) final String[] group) {
     Result result = null;
     try {
 
       boolean noResults = true;
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
-      } catch (CommandResultException e) {
-        return e.getResult();
+      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();
@@ -153,19 +153,19 @@ public class DurableClientCommands extends AbstractCommandsSupport {
           help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME__HELP) final String cqName,
       @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__MEMBER, mandatory = false,
           help = CliStrings.COUNT_DURABLE_CQ_EVENTS__MEMBER__HELP,
-          optionContext = ConverterHint.MEMBERIDNAME) final String memberNameOrId,
+          optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId,
       @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP, mandatory = false,
           help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP,
-          optionContext = ConverterHint.MEMBERGROUP) final String group) {
+          optionContext = ConverterHint.MEMBERGROUP) final String[] group) {
 
     Result result = null;
     try {
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
-      } catch (CommandResultException e) {
-        return e.getResult();
+      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;
@@ -200,19 +200,20 @@ public class DurableClientCommands extends AbstractCommandsSupport {
           help = CliStrings.CLOSE_DURABLE_CLIENTS__CLIENT__ID__HELP) final String durableClientId,
       @CliOption(key = CliStrings.CLOSE_DURABLE_CLIENTS__MEMBER, mandatory = false,
           help = CliStrings.CLOSE_DURABLE_CLIENTS__MEMBER__HELP,
-          optionContext = ConverterHint.MEMBERIDNAME) final String memberNameOrId,
+          optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId,
       @CliOption(key = CliStrings.CLOSE_DURABLE_CLIENTS__GROUP, mandatory = false,
           help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP,
-          optionContext = ConverterHint.MEMBERGROUP) final String group) {
+          optionContext = ConverterHint.MEMBERGROUP) final String[] group) {
 
     Result result = null;
     try {
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
-      } catch (CommandResultException e) {
-        return e.getResult();
+
+      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();
@@ -240,18 +241,17 @@ public class DurableClientCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.CLOSE_DURABLE_CQS__MEMBER, mandatory = false,
           help = CliStrings.CLOSE_DURABLE_CQS__MEMBER__HELP,
-          optionContext = ConverterHint.MEMBERIDNAME) final String memberNameOrId,
+          optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId,
 
       @CliOption(key = CliStrings.CLOSE_DURABLE_CQS__GROUP, mandatory = false,
           help = CliStrings.CLOSE_DURABLE_CQS__GROUP__HELP,
-          optionContext = ConverterHint.MEMBERGROUP) final String group) {
+          optionContext = ConverterHint.MEMBERGROUP) final String[] group) {
     Result result = null;
     try {
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
-      } catch (CommandResultException e) {
-        return e.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       String[] params = new String[2];

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/FunctionCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/FunctionCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/FunctionCommands.java
index 2007e4a..8ea65ff 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/FunctionCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/FunctionCommands.java
@@ -560,19 +560,18 @@ public class FunctionCommands implements CommandMarker {
       @CliOption(key = CliStrings.LIST_FUNCTION__MATCHES,
           help = CliStrings.LIST_FUNCTION__MATCHES__HELP) String matches,
       @CliOption(key = CliStrings.LIST_FUNCTION__GROUP, optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.LIST_FUNCTION__GROUP__HELP) String groups,
+          help = CliStrings.LIST_FUNCTION__GROUP__HELP) String[] groups,
       @CliOption(key = CliStrings.LIST_FUNCTION__MEMBER, optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.LIST_FUNCTION__MEMBER__HELP) String members) {
+          help = CliStrings.LIST_FUNCTION__MEMBER__HELP) String[] members) {
     TabularResultData tabularData = ResultBuilder.createTabularResultData();
     boolean accumulatedData = false;
 
     InternalCache cache = getCache();
 
-    Set<DistributedMember> targetMembers;
-    try {
-      targetMembers = CliUtil.findMembersOrThrow(groups, members);
-    } catch (CommandResultException crex) {
-      return crex.getResult();
+    Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, members);
+
+    if (targetMembers.isEmpty()) {
+      return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
     }
 
     try {

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java
index a4ba64c..407424a 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -188,7 +189,7 @@ public class IndexCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.CREATE_INDEX__MEMBER, mandatory = false,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.CREATE_INDEX__MEMBER__HELP) final String memberNameOrID,
+          help = CliStrings.CREATE_INDEX__MEMBER__HELP) final String[] memberNameOrID,
 
       @CliOption(key = CliStrings.CREATE_INDEX__TYPE, mandatory = false,
           unspecifiedDefaultValue = "range", optionContext = ConverterHint.INDEX_TYPE,
@@ -196,7 +197,7 @@ public class IndexCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.CREATE_INDEX__GROUP, mandatory = false,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.CREATE_INDEX__GROUP__HELP) final String group) {
+          help = CliStrings.CREATE_INDEX__GROUP__HELP) final String[] group) {
 
     Result result = null;
     AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
@@ -237,8 +238,12 @@ public class IndexCommands extends AbstractCommandsSupport {
 
       IndexInfo indexInfo = new IndexInfo(indexName, indexedExpression, regionPath, idxType);
 
-      final Set<DistributedMember> targetMembers =
-          CliUtil.findMembersOrThrow(group, memberNameOrID);
+      final Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrID);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
+
       final ResultCollector<?, ?> rc =
           CliUtil.executeFunction(createIndexFunction, indexInfo, targetMembers);
 
@@ -309,16 +314,14 @@ public class IndexCommands extends AbstractCommandsSupport {
         }
         result = ResultBuilder.buildResult(erd);
       }
-    } catch (CommandResultException crex) {
-      result = crex.getResult();
     } catch (Exception e) {
       result = ResultBuilder.createGemFireErrorResult(e.getMessage());
     }
 
 
     if (xmlEntity.get() != null) {
-      persistClusterConfiguration(result, () -> getSharedConfiguration()
-          .addXmlEntity(xmlEntity.get(), group != null ? group.split(",") : null));
+      persistClusterConfiguration(result,
+          () -> getSharedConfiguration().addXmlEntity(xmlEntity.get(), group));
     }
 
     return result;
@@ -337,16 +340,16 @@ public class IndexCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.DESTROY_INDEX__MEMBER, mandatory = false,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.DESTROY_INDEX__MEMBER__HELP) final String memberNameOrID,
+          help = CliStrings.DESTROY_INDEX__MEMBER__HELP) final String[] memberNameOrID,
 
       @CliOption(key = CliStrings.DESTROY_INDEX__GROUP, mandatory = false,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.DESTROY_INDEX__GROUP__HELP) final String group) {
+          help = CliStrings.DESTROY_INDEX__GROUP__HELP) final String[] group) {
 
     Result result = null;
 
     if (StringUtils.isBlank(indexName) && StringUtils.isBlank(regionPath)
-        && StringUtils.isBlank(memberNameOrID) && StringUtils.isBlank(group)) {
+        && ArrayUtils.isEmpty(group) && ArrayUtils.isEmpty(memberNameOrID)) {
       return ResultBuilder.createUserErrorResult(
           CliStrings.format(CliStrings.PROVIDE_ATLEAST_ONE_OPTION, CliStrings.DESTROY_INDEX));
     }
@@ -364,12 +367,10 @@ public class IndexCommands extends AbstractCommandsSupport {
     }
 
     IndexInfo indexInfo = new IndexInfo(indexName, regionName);
-    Set<DistributedMember> targetMembers = null;
+    Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrID);
 
-    try {
-      targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrID);
-    } catch (CommandResultException e) {
-      return e.getResult();
+    if (targetMembers.isEmpty()) {
+      return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
     }
 
     ResultCollector rc = CliUtil.executeFunction(destroyIndexFunction, indexInfo, targetMembers);
@@ -456,8 +457,8 @@ public class IndexCommands extends AbstractCommandsSupport {
       result = ResultBuilder.buildResult(erd);
     }
     if (xmlEntity.get() != null) {
-      persistClusterConfiguration(result, () -> getSharedConfiguration()
-          .deleteXmlEntity(xmlEntity.get(), group != null ? group.split(",") : null));
+      persistClusterConfiguration(result,
+          () -> getSharedConfiguration().deleteXmlEntity(xmlEntity.get(), group));
     }
 
     return result;
@@ -539,11 +540,11 @@ public class IndexCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.CREATE_DEFINED_INDEXES__MEMBER, mandatory = false,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.CREATE_DEFINED_INDEXES__MEMBER__HELP) final String memberNameOrID,
+          help = CliStrings.CREATE_DEFINED_INDEXES__MEMBER__HELP) final String[] memberNameOrID,
 
       @CliOption(key = CliStrings.CREATE_DEFINED_INDEXES__GROUP, mandatory = false,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.CREATE_DEFINED_INDEXES__GROUP__HELP) final String group) {
+          help = CliStrings.CREATE_DEFINED_INDEXES__GROUP__HELP) final String[] group) {
 
     Result result = null;
     AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
@@ -555,10 +556,13 @@ public class IndexCommands extends AbstractCommandsSupport {
     }
 
     try {
-      final Cache cache = CacheFactory.getAnyInstance();
+      final Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrID);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
-      final Set<DistributedMember> targetMembers =
-          CliUtil.findMembersOrThrow(group, memberNameOrID);
+      final Cache cache = CacheFactory.getAnyInstance();
       final ResultCollector<?, ?> rc =
           CliUtil.executeFunction(createDefinedIndexesFunction, indexDefinitions, targetMembers);
 
@@ -622,15 +626,13 @@ public class IndexCommands extends AbstractCommandsSupport {
         }
         result = ResultBuilder.buildResult(erd);
       }
-    } catch (CommandResultException crex) {
-      result = crex.getResult();
     } catch (Exception e) {
       result = ResultBuilder.createGemFireErrorResult(e.getMessage());
     }
 
     if (xmlEntity.get() != null) {
-      persistClusterConfiguration(result, () -> getSharedConfiguration()
-          .addXmlEntity(xmlEntity.get(), group != null ? group.split(",") : null));
+      persistClusterConfiguration(result,
+          () -> getSharedConfiguration().addXmlEntity(xmlEntity.get(), group));
     }
     return result;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/MiscellaneousCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/MiscellaneousCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/MiscellaneousCommands.java
index 0d714f4..a23afd0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/MiscellaneousCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/MiscellaneousCommands.java
@@ -672,11 +672,11 @@ public class MiscellaneousCommands implements CommandMarker {
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result exportStackTrace(@CliOption(key = CliStrings.EXPORT_STACKTRACE__MEMBER,
       optionContext = ConverterHint.ALL_MEMBER_IDNAME,
-      help = CliStrings.EXPORT_STACKTRACE__HELP) String memberNameOrId,
+      help = CliStrings.EXPORT_STACKTRACE__HELP) String[] memberNameOrId,
 
       @CliOption(key = CliStrings.EXPORT_STACKTRACE__GROUP,
           optionContext = ConverterHint.ALL_MEMBER_IDNAME,
-          help = CliStrings.EXPORT_STACKTRACE__GROUP) String group,
+          help = CliStrings.EXPORT_STACKTRACE__GROUP) String[] group,
 
       @CliOption(key = CliStrings.EXPORT_STACKTRACE__FILE,
           help = CliStrings.EXPORT_STACKTRACE__FILE__HELP) String fileName,
@@ -687,29 +687,27 @@ public class MiscellaneousCommands implements CommandMarker {
 
     Result result = null;
     StringBuffer filePrefix = new StringBuffer("stacktrace");
+
+    if (fileName == null) {
+      fileName = filePrefix.append("_").append(System.currentTimeMillis()).toString();
+    }
+    final File outFile = new File(fileName);
     try {
-      if (fileName == null) {
-        fileName = filePrefix.append("_").append(System.currentTimeMillis()).toString();
-      }
-      final File outFile = new File(fileName);
       if (outFile.exists() && failIfFilePresent) {
         return ResultBuilder.createShellClientErrorResult(CliStrings.format(
             CliStrings.EXPORT_STACKTRACE__ERROR__FILE__PRESENT, outFile.getCanonicalPath()));
       }
 
+
       InternalCache cache = getCache();
       InternalDistributedSystem ads = cache.getInternalDistributedSystem();
 
       InfoResultData resultData = ResultBuilder.createInfoResultData();
 
       Map<String, byte[]> dumps = new HashMap<String, byte[]>();
-      Set<DistributedMember> targetMembers = null;
-
-      if ((group == null || group.isEmpty())
-          && (memberNameOrId == null || memberNameOrId.isEmpty())) {
-        targetMembers = CliUtil.getAllMembers(cache);
-      } else {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId);
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc =
@@ -728,9 +726,7 @@ public class MiscellaneousCommands implements CommandMarker {
       resultData.addLine(CliStrings.EXPORT_STACKTRACE__HOST + ads.getDistributedMember().getHost());
 
       result = ResultBuilder.buildResult(resultData);
-    } catch (CommandResultException crex) {
-      return crex.getResult();
-    } catch (Exception ex) {
+    } catch (IOException ex) {
       result = ResultBuilder
           .createGemFireErrorResult(CliStrings.EXPORT_STACKTRACE__ERROR + ex.getMessage());
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueueCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueueCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueueCommands.java
index 6208adb..f4dee75 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueueCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueueCommands.java
@@ -123,11 +123,10 @@ public class QueueCommands extends AbstractCommandsSupport {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(groups, null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(groups, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       AsyncEventQueueFunctionArgs aeqArgs = new AsyncEventQueueFunctionArgs(id, parallel,
@@ -188,11 +187,10 @@ public class QueueCommands extends AbstractCommandsSupport {
       TabularResultData tabularData = ResultBuilder.createTabularResultData();
       boolean accumulatedData = false;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow((String) null, (String) null);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(null, null);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       ResultCollector<?, ?> rc = CliUtil.executeFunction(new ListAsyncEventQueuesFunction(),

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RegionCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RegionCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RegionCommands.java
index 561d4b8..6f5b047 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RegionCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RegionCommands.java
@@ -80,19 +80,18 @@ public class RegionCommands implements CommandMarker {
   @ResourceOperation(resource = Resource.DATA, operation = Operation.READ)
   public Result listRegion(
       @CliOption(key = {CliStrings.LIST_REGION__GROUP}, optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.LIST_REGION__GROUP__HELP) String group,
+          help = CliStrings.LIST_REGION__GROUP__HELP) String[] group,
       @CliOption(key = {CliStrings.LIST_REGION__MEMBER}, optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.LIST_REGION__MEMBER__HELP) String memberNameOrId) {
+          help = CliStrings.LIST_REGION__MEMBER__HELP) String[] memberNameOrId) {
     Result result = null;
     try {
       Set<RegionInformation> regionInfoSet = new LinkedHashSet<RegionInformation>();
       ResultCollector<?, ?> rc = null;
 
-      Set<DistributedMember> targetMembers;
-      try {
-        targetMembers = CliUtil.findMembersOrThrow(group, memberNameOrId);
-      } catch (CommandResultException crex) {
-        return crex.getResult();
+      Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId);
+
+      if (targetMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
index feeb353..57080ba 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
@@ -78,7 +78,7 @@ public class WanCommands extends AbstractCommandsSupport {
       @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
           unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
-          help = CliStrings.CREATE_GATEWAYSENDER__MEMBER__HELP) String onMember,
+          help = CliStrings.CREATE_GATEWAYSENDER__MEMBER__HELP) String[] onMember,
 
       @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ID, mandatory = true,
           help = CliStrings.CREATE_GATEWAYSENDER__ID__HELP) String id,
@@ -145,7 +145,11 @@ public class WanCommands extends AbstractCommandsSupport {
           gatewayEventFilters, gatewayTransportFilter);
 
       Set<DistributedMember> membersToCreateGatewaySenderOn =
-          CliUtil.findMembersOrThrow(onGroups, onMember == null ? null : onMember.split(","));
+          CliUtil.findMembers(onGroups, onMember);
+
+      if (membersToCreateGatewaySenderOn.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       ResultCollector<?, ?> resultCollector =
           CliUtil.executeFunction(GatewaySenderCreateFunction.INSTANCE, gatewaySenderFunctionArgs,
@@ -170,8 +174,6 @@ public class WanCommands extends AbstractCommandsSupport {
     } catch (IllegalArgumentException e) {
       LogWrapper.getInstance().info(e.getMessage());
       result = ResultBuilder.createUserErrorResult(e.getMessage());
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     }
 
     if (xmlEntity.get() != null) {
@@ -190,11 +192,11 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.START_GATEWAYSENDER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.START_GATEWAYSENDER__GROUP__HELP) String onGroup,
+          help = CliStrings.START_GATEWAYSENDER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.START_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.START_GATEWAYSENDER__MEMBER__HELP) String onMember) {
+          help = CliStrings.START_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
     final String id = senderId.trim();
@@ -205,7 +207,12 @@ public class WanCommands extends AbstractCommandsSupport {
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       ExecutorService execService = Executors.newCachedThreadPool(new ThreadFactory() {
         AtomicInteger threadNum = new AtomicInteger();
@@ -293,8 +300,6 @@ public class WanCommands extends AbstractCommandsSupport {
       }
       execService.shutdown();
       result = ResultBuilder.buildResult(resultData);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -312,11 +317,11 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.PAUSE_GATEWAYSENDER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.PAUSE_GATEWAYSENDER__GROUP__HELP) String onGroup,
+          help = CliStrings.PAUSE_GATEWAYSENDER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.PAUSE_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.PAUSE_GATEWAYSENDER__MEMBER__HELP) String onMember) {
+          help = CliStrings.PAUSE_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
     if (senderId != null) {
@@ -331,9 +336,13 @@ public class WanCommands extends AbstractCommandsSupport {
       GatewaySenderMXBean bean = null;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = null;
 
-      dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
+
       for (DistributedMember member : dsMembers) {
         if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
           bean = service.getLocalGatewaySenderMXBean(senderId);
@@ -365,8 +374,6 @@ public class WanCommands extends AbstractCommandsSupport {
         }
       }
       result = ResultBuilder.buildResult(resultData);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -383,10 +390,10 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.RESUME_GATEWAYSENDER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.RESUME_GATEWAYSENDER__GROUP__HELP) String onGroup,
+          help = CliStrings.RESUME_GATEWAYSENDER__GROUP__HELP) String[] onGroup,
       @CliOption(key = CliStrings.RESUME_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.RESUME_GATEWAYSENDER__MEMBER__HELP) String onMember) {
+          help = CliStrings.RESUME_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
     if (senderId != null) {
@@ -402,7 +409,12 @@ public class WanCommands extends AbstractCommandsSupport {
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
+
       for (DistributedMember member : dsMembers) {
         if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
           bean = service.getLocalGatewaySenderMXBean(senderId);
@@ -434,8 +446,6 @@ public class WanCommands extends AbstractCommandsSupport {
         }
       }
       result = ResultBuilder.buildResult(resultData);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -452,11 +462,11 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.STOP_GATEWAYSENDER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.STOP_GATEWAYSENDER__GROUP__HELP) String onGroup,
+          help = CliStrings.STOP_GATEWAYSENDER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.STOP_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.STOP_GATEWAYSENDER__MEMBER__HELP) String onMember) {
+          help = CliStrings.STOP_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
     if (senderId != null)
@@ -470,7 +480,12 @@ public class WanCommands extends AbstractCommandsSupport {
       GatewaySenderMXBean bean = null;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       for (DistributedMember member : dsMembers) {
         if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
@@ -498,8 +513,6 @@ public class WanCommands extends AbstractCommandsSupport {
         }
       }
       result = ResultBuilder.buildResult(resultData);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -518,7 +531,7 @@ public class WanCommands extends AbstractCommandsSupport {
       @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
           unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
-          help = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER__HELP) String onMember,
+          help = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember,
 
       @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART,
           help = CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART__HELP) Boolean manualStart,
@@ -550,7 +563,11 @@ public class WanCommands extends AbstractCommandsSupport {
               socketBufferSize, maximumTimeBetweenPings, gatewayTransportFilters);
 
       Set<DistributedMember> membersToCreateGatewayReceiverOn =
-          CliUtil.findMembersOrThrow(onGroups, onMember == null ? null : onMember.split(","));
+          CliUtil.findMembers(onGroups, onMember);
+
+      if (membersToCreateGatewayReceiverOn.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       ResultCollector<?, ?> resultCollector =
           CliUtil.executeFunction(GatewayReceiverCreateFunction.INSTANCE,
@@ -576,8 +593,6 @@ public class WanCommands extends AbstractCommandsSupport {
     } catch (IllegalArgumentException e) {
       LogWrapper.getInstance().info(e.getMessage());
       result = ResultBuilder.createUserErrorResult(e.getMessage());
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     }
 
     if (xmlEntity.get() != null) {
@@ -653,11 +668,11 @@ public class WanCommands extends AbstractCommandsSupport {
   @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
   public Result startGatewayReceiver(@CliOption(key = CliStrings.START_GATEWAYRECEIVER__GROUP,
       optionContext = ConverterHint.MEMBERGROUP,
-      help = CliStrings.START_GATEWAYRECEIVER__GROUP__HELP) String onGroup,
+      help = CliStrings.START_GATEWAYRECEIVER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.START_GATEWAYRECEIVER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.START_GATEWAYRECEIVER__MEMBER__HELP) String onMember) {
+          help = CliStrings.START_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
     Result result = null;
 
     try {
@@ -668,7 +683,12 @@ public class WanCommands extends AbstractCommandsSupport {
       GatewayReceiverMXBean receieverBean = null;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       for (DistributedMember member : dsMembers) {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
@@ -715,11 +735,11 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.STOP_GATEWAYRECEIVER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.STOP_GATEWAYRECEIVER__GROUP__HELP) String onGroup,
+          help = CliStrings.STOP_GATEWAYRECEIVER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.STOP_GATEWAYRECEIVER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.STOP_GATEWAYRECEIVER__MEMBER__HELP) String onMember) {
+          help = CliStrings.STOP_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
 
@@ -731,7 +751,12 @@ public class WanCommands extends AbstractCommandsSupport {
       GatewayReceiverMXBean receieverBean = null;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       for (DistributedMember member : dsMembers) {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
@@ -776,9 +801,9 @@ public class WanCommands extends AbstractCommandsSupport {
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result listGateway(
       @CliOption(key = CliStrings.LIST_GATEWAY__MEMBER, optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.LIST_GATEWAY__MEMBER__HELP) String onMember,
+          help = CliStrings.LIST_GATEWAY__MEMBER__HELP) String[] onMember,
       @CliOption(key = CliStrings.LIST_GATEWAY__GROUP, optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.LIST_GATEWAY__GROUP__HELP) String onGroup) {
+          help = CliStrings.LIST_GATEWAY__GROUP__HELP) String[] onGroup) {
 
     Result result = null;
     InternalCache cache = getCache();
@@ -786,7 +811,11 @@ public class WanCommands extends AbstractCommandsSupport {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       Map<String, Map<String, GatewaySenderMXBean>> gatewaySenderBeans =
           new TreeMap<String, Map<String, GatewaySenderMXBean>>();
@@ -838,8 +867,6 @@ public class WanCommands extends AbstractCommandsSupport {
       crd.setHeader(CliStrings.HEADER_GATEWAYS);
       accumulateListGatewayResult(crd, gatewaySenderBeans, gatewayReceiverBeans);
       result = ResultBuilder.buildResult(crd);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -856,11 +883,11 @@ public class WanCommands extends AbstractCommandsSupport {
 
       @CliOption(key = CliStrings.STATUS_GATEWAYSENDER__GROUP,
           optionContext = ConverterHint.MEMBERGROUP,
-          help = CliStrings.STATUS_GATEWAYSENDER__GROUP__HELP) String onGroup,
+          help = CliStrings.STATUS_GATEWAYSENDER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.STATUS_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.STATUS_GATEWAYSENDER__MEMBER__HELP) String onMember) {
+          help = CliStrings.STATUS_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
     if (senderId != null)
@@ -881,8 +908,12 @@ public class WanCommands extends AbstractCommandsSupport {
           crd.addSection(CliStrings.SECTION_GATEWAY_SENDER_NOT_AVAILABLE)
               .addTable(CliStrings.TABLE_GATEWAY_SENDER);
 
-      Set<DistributedMember> dsMembers = null;
-      dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
+
       for (DistributedMember member : dsMembers) {
         if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
           bean = service.getLocalGatewaySenderMXBean(senderId);
@@ -897,8 +928,6 @@ public class WanCommands extends AbstractCommandsSupport {
         }
       }
       result = ResultBuilder.buildResult(crd);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -912,11 +941,11 @@ public class WanCommands extends AbstractCommandsSupport {
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result statusGatewayReceiver(@CliOption(key = CliStrings.STATUS_GATEWAYRECEIVER__GROUP,
       optionContext = ConverterHint.MEMBERGROUP,
-      help = CliStrings.STATUS_GATEWAYRECEIVER__GROUP__HELP) String onGroup,
+      help = CliStrings.STATUS_GATEWAYRECEIVER__GROUP__HELP) String[] onGroup,
 
       @CliOption(key = CliStrings.STATUS_GATEWAYRECEIVER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
-          help = CliStrings.STATUS_GATEWAYRECEIVER__MEMBER__HELP) String onMember) {
+          help = CliStrings.STATUS_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
 
     Result result = null;
 
@@ -934,7 +963,11 @@ public class WanCommands extends AbstractCommandsSupport {
           crd.addSection(CliStrings.SECTION_GATEWAY_RECEIVER_NOT_AVAILABLE)
               .addTable(CliStrings.TABLE_GATEWAY_RECEIVER);
 
-      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembers(onGroup, onMember);
+
+      if (dsMembers.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       for (DistributedMember member : dsMembers) {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
@@ -949,8 +982,6 @@ public class WanCommands extends AbstractCommandsSupport {
         buildReceiverStatus(member.getId(), null, notAvailableReceiverData);
       }
       result = ResultBuilder.buildResult(crd);
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     } catch (Exception e) {
       LogWrapper.getInstance().warning(CliStrings.GATEWAY_ERROR + CliUtil.stackTraceAsString(e));
       result = ResultBuilder.createGemFireErrorResult(CliStrings.GATEWAY_ERROR + e.getMessage());
@@ -969,7 +1000,7 @@ public class WanCommands extends AbstractCommandsSupport {
       @CliOption(key = CliStrings.DESTROY_GATEWAYSENDER__MEMBER,
           optionContext = ConverterHint.MEMBERIDNAME,
           unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
-          help = CliStrings.DESTROY_GATEWAYSENDER__MEMBER__HELP) String onMember,
+          help = CliStrings.DESTROY_GATEWAYSENDER__MEMBER__HELP) String[] onMember,
       @CliOption(key = CliStrings.DESTROY_GATEWAYSENDER__ID, mandatory = true,
           optionContext = ConverterHint.GATEWAY_SENDER_ID,
           help = CliStrings.DESTROY_GATEWAYSENDER__ID__HELP) String id) {
@@ -979,7 +1010,11 @@ public class WanCommands extends AbstractCommandsSupport {
           new GatewaySenderDestroyFunctionArgs(id);
 
       Set<DistributedMember> membersToDestroyGatewaySenderOn =
-          CliUtil.findMembersOrThrow(onGroups, onMember == null ? null : onMember.split(","));
+          CliUtil.findMembers(onGroups, onMember);
+
+      if (membersToDestroyGatewaySenderOn.isEmpty()) {
+        return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
+      }
 
       ResultCollector<?, ?> resultCollector =
           CliUtil.executeFunction(GatewaySenderDestroyFunction.INSTANCE,
@@ -1000,8 +1035,6 @@ public class WanCommands extends AbstractCommandsSupport {
     } catch (IllegalArgumentException e) {
       LogWrapper.getInstance().info(e.getMessage());
       result = ResultBuilder.createUserErrorResult(e.getMessage());
-    } catch (CommandResultException crex) {
-      result = handleCommandResultException(crex);
     }
     return result;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/c1ab3ffe/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
index d610ca0..489be28 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
@@ -261,35 +261,30 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
   }
 
   public void verifyFindAllMatchingMembers() {
-    try {
-      Set<DistributedMember> set = CliUtil.findMembersOrThrow(GROUP1, null);
-      assertNotNull(set);
-      assertEquals(2, set.size());
-      assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
-      assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
-
-      set = CliUtil.findMembersOrThrow("group1,group2", null);
-      assertNotNull(set);
-      assertEquals(4, set.size());
-      assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
-      assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
-      assertEquals(true, containsMember(set, MEMBER_1_GROUP2));
-      assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
-
-      set = CliUtil.findMembersOrThrow(null, MEMBER_1_GROUP1);
-      assertNotNull(set);
-      assertEquals(1, set.size());
-      assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
-
-      set = CliUtil.findMembersOrThrow(null, "member1_group1,member2_group2");
-      assertNotNull(set);
-      assertEquals(2, set.size());
-      assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
-      assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
-
-    } catch (CommandResultException e) {
-      Assert.fail("CliUtil failed with exception", e);
-    }
+    Set<DistributedMember> set = CliUtil.findMembers(GROUP1.split(","), null);
+    assertNotNull(set);
+    assertEquals(2, set.size());
+    assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
+    assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
+
+    set = CliUtil.findMembers(new String[] {"group1", "group2"}, null);
+    assertNotNull(set);
+    assertEquals(4, set.size());
+    assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
+    assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
+    assertEquals(true, containsMember(set, MEMBER_1_GROUP2));
+    assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
+
+    set = CliUtil.findMembers(null, MEMBER_1_GROUP1.split(","));
+    assertNotNull(set);
+    assertEquals(1, set.size());
+    assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
+
+    set = CliUtil.findMembers(null, new String[] {"member1_group1", "member2_group2"});
+    assertNotNull(set);
+    assertEquals(2, set.size());
+    assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
+    assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
   }
 
   private Object containsMember(Set<DistributedMember> set, String string) {
@@ -311,22 +306,18 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
   public void verifyExecuteFunction() {
     DunitFunction function = new DunitFunction("myfunction");
     Set<DistributedMember> set;
-    try {
-      @SuppressWarnings("rawtypes")
-      Region region1 = getCache().getRegion(COMMON_REGION);
-      region1.clear();
-      set = CliUtil.findMembersOrThrow(GROUP1, null);
-      assertEquals(2, set.size());
-      ResultCollector collector = CliUtil.executeFunction(function, "executeOnGroup", set);
-      collector.getResult();
-      assertEquals(2, region1.size());
-      assertTrue(region1.containsKey(MEMBER_1_GROUP1));
-      assertTrue(region1.containsKey(MEMBER_2_GROUP1));
-      assertEquals("executeOnGroup", region1.get(MEMBER_1_GROUP1));
-      assertEquals("executeOnGroup", region1.get(MEMBER_2_GROUP1));
-    } catch (CommandResultException e) {
-      Assert.fail("Error during querying members", e);
-    }
+    @SuppressWarnings("rawtypes")
+    Region region1 = getCache().getRegion(COMMON_REGION);
+    region1.clear();
+    set = CliUtil.findMembers(GROUP1.split(","), null);
+    assertEquals(2, set.size());
+    ResultCollector collector = CliUtil.executeFunction(function, "executeOnGroup", set);
+    collector.getResult();
+    assertEquals(2, region1.size());
+    assertTrue(region1.containsKey(MEMBER_1_GROUP1));
+    assertTrue(region1.containsKey(MEMBER_2_GROUP1));
+    assertEquals("executeOnGroup", region1.get(MEMBER_1_GROUP1));
+    assertEquals("executeOnGroup", region1.get(MEMBER_2_GROUP1));
   }
 
   public void getRegionAssociatedMembers() {


Mime
View raw message