geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstew...@apache.org
Subject [3/6] geode git commit: GEODE-2919: Provide finer grained security
Date Fri, 23 Jun 2017 22:49:00 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/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 68dbbf0..3222666 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
@@ -14,6 +14,17 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -31,7 +42,6 @@ import org.apache.geode.management.internal.cli.domain.RegionInformation;
 import org.apache.geode.management.internal.cli.functions.GetRegionDescriptionFunction;
 import org.apache.geode.management.internal.cli.functions.GetRegionsFunction;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
-import org.apache.geode.management.internal.cli.result.CommandResultException;
 import org.apache.geode.management.internal.cli.result.CompositeResultData;
 import org.apache.geode.management.internal.cli.result.CompositeResultData.SectionResultData;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
@@ -40,17 +50,6 @@ import org.apache.geode.management.internal.cli.util.RegionAttributesNames;
 import org.apache.geode.management.internal.security.ResourceOperation;
 import org.apache.geode.security.ResourcePermission.Operation;
 import org.apache.geode.security.ResourcePermission.Resource;
-import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
 
 /**
  * Class containing implementation of commands based on region:
@@ -67,8 +66,8 @@ public class RegionCommands implements GfshCommand {
       new GetRegionDescriptionFunction();
 
   @CliCommand(value = {CliStrings.LIST_REGION}, help = CliStrings.LIST_REGION__HELP)
-  @CliMetaData(shellOnly = false, relatedTopic = CliStrings.TOPIC_GEODE_REGION)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.READ)
+  @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_REGION)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result listRegion(
       @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
           optionContext = ConverterHint.MEMBERGROUP,
@@ -78,8 +77,8 @@ public class RegionCommands implements GfshCommand {
           help = CliStrings.LIST_REGION__MEMBER__HELP) String[] memberNameOrId) {
     Result result = null;
     try {
-      Set<RegionInformation> regionInfoSet = new LinkedHashSet<RegionInformation>();
-      ResultCollector<?, ?> rc = null;
+      Set<RegionInformation> regionInfoSet = new LinkedHashSet<>();
+      ResultCollector<?, ?> rc;
 
       Set<DistributedMember> targetMembers = CliUtil.findMembers(group, memberNameOrId);
 
@@ -93,11 +92,8 @@ public class RegionCommands implements GfshCommand {
       ArrayList<?> resultList = (ArrayList<?>) rc.getResult();
 
       if (resultList != null) {
-        Iterator<?> iters = resultList.iterator();
-
-        while (iters.hasNext()) {
-          Object resultObj = iters.next();
 
+        for (Object resultObj : resultList) {
           if (resultObj != null) {
             if (resultObj instanceof Object[]) {
               Object[] resultObjectArray = (Object[]) resultObj;
@@ -110,15 +106,13 @@ public class RegionCommands implements GfshCommand {
           }
         }
 
-        Set<String> regionNames = new TreeSet<String>();
+        Set<String> regionNames = new TreeSet<>();
 
         for (RegionInformation regionInfo : regionInfoSet) {
           regionNames.add(regionInfo.getName());
           Set<String> subRegionNames = regionInfo.getSubRegionNames();
 
-          for (String subRegionName : subRegionNames) {
-            regionNames.add(subRegionName);
-          }
+          regionNames.addAll(subRegionNames);
         }
 
         for (String regionName : regionNames) {
@@ -143,14 +137,13 @@ public class RegionCommands implements GfshCommand {
   }
 
   @CliCommand(value = {CliStrings.DESCRIBE_REGION}, help = CliStrings.DESCRIBE_REGION__HELP)
-  @CliMetaData(shellOnly = false,
-      relatedTopic = {CliStrings.TOPIC_GEODE_REGION, CliStrings.TOPIC_GEODE_CONFIG})
+  @CliMetaData(relatedTopic = {CliStrings.TOPIC_GEODE_REGION, CliStrings.TOPIC_GEODE_CONFIG})
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result describeRegion(
       @CliOption(key = CliStrings.DESCRIBE_REGION__NAME, optionContext = ConverterHint.REGION_PATH,
           help = CliStrings.DESCRIBE_REGION__NAME__HELP, mandatory = true) String regionName) {
 
-    Result result = null;
+    Result result;
     try {
 
       if (regionName == null || regionName.isEmpty()) {
@@ -170,7 +163,7 @@ public class RegionCommands implements GfshCommand {
       // The returned result could be a region description with per member and /or single local
       // region
       Object[] results = resultList.toArray();
-      List<RegionDescription> regionDescriptionList = new ArrayList<RegionDescription>();
+      List<RegionDescription> regionDescriptionList = new ArrayList<>();
 
       for (int i = 0; i < results.length; i++) {
 
@@ -204,11 +197,8 @@ public class RegionCommands implements GfshCommand {
       }
 
       CompositeResultData crd = ResultBuilder.createCompositeResultData();
-      Iterator<RegionDescription> iters = regionDescriptionList.iterator();
-
-      while (iters.hasNext()) {
-        RegionDescription regionDescription = iters.next();
 
+      for (RegionDescription regionDescription : regionDescriptionList) {
         // No point in displaying the scope for PR's
         if (regionDescription.isPartition()) {
           regionDescription.getCndRegionAttributes().remove(RegionAttributesNames.SCOPE);
@@ -228,7 +218,7 @@ public class RegionCommands implements GfshCommand {
             regionDescription.getDataPolicy().toString().toLowerCase().replace('_', ' ');
         regionSection.addData("Data Policy", dataPolicy);
 
-        String memberType = "";
+        String memberType;
 
         if (regionDescription.isAccessor()) {
           memberType = CliStrings.DESCRIBE_REGION__ACCESSOR__MEMBER;
@@ -265,8 +255,6 @@ public class RegionCommands implements GfshCommand {
         Set<String> members = regDescPerMemberMap.keySet();
 
         TabularResultData table = regionSection.addSection().addTable();
-        // table.setHeader(CliStrings.format(CliStrings.DESCRIBE_REGION__NONDEFAULT__PERMEMBERATTRIBUTES__HEADER,
-        // memberType));
 
         boolean setHeader = false;
         for (String member : members) {
@@ -291,9 +279,9 @@ public class RegionCommands implements GfshCommand {
 
           if (!(ndRa.isEmpty() && ndEa.isEmpty() && ndPa.isEmpty()) || fpaList != null) {
             setHeader = true;
-            boolean memberNameAdded = false;
+            boolean memberNameAdded;
             memberNameAdded = writeAttributesToTable(table,
-                CliStrings.DESCRIBE_REGION__ATTRIBUTE__TYPE__REGION, ndRa, member, memberNameAdded);
+                CliStrings.DESCRIBE_REGION__ATTRIBUTE__TYPE__REGION, ndRa, member, false);
             memberNameAdded =
                 writeAttributesToTable(table, CliStrings.DESCRIBE_REGION__ATTRIBUTE__TYPE__EVICTION,
                     ndEa, member, memberNameAdded);
@@ -302,12 +290,10 @@ public class RegionCommands implements GfshCommand {
                 memberNameAdded);
 
             writeFixedPartitionAttributesToTable(table, "", fpaList, member, memberNameAdded);
-            // Fix for #46767
-            // writeAttributeToTable(table, "", "", "", "");
           }
         }
 
-        if (setHeader == true) {
+        if (setHeader) {
           table.setHeader(CliStrings.format(
               CliStrings.DESCRIBE_REGION__NONDEFAULT__PERMEMBERATTRIBUTES__HEADER, memberType));
         }
@@ -332,10 +318,7 @@ public class RegionCommands implements GfshCommand {
       boolean isTypeAdded = false;
       final String blank = "";
 
-      Iterator<String> iters = attributes.iterator();
-
-      while (iters.hasNext()) {
-        String attributeName = iters.next();
+      for (String attributeName : attributes) {
         String attributeValue = attributesMap.get(attributeName);
         String type, memName;
 
@@ -403,10 +386,7 @@ public class RegionCommands implements GfshCommand {
       boolean isTypeAdded = false;
       final String blank = "";
 
-      Iterator<String> iters = attributes.iterator();
-
-      while (iters.hasNext()) {
-        String attributeName = iters.next();
+      for (String attributeName : attributes) {
         String attributeValue = attributesMap.get(attributeName);
         String type, memName;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/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 a6745fd..c6fb709 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
@@ -14,6 +14,26 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.management.ObjectName;
+
+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.internal.cache.InternalCache;
@@ -44,37 +64,20 @@ import org.apache.geode.management.internal.configuration.domain.XmlEntity;
 import org.apache.geode.management.internal.security.ResourceOperation;
 import org.apache.geode.security.ResourcePermission.Operation;
 import org.apache.geode.security.ResourcePermission.Resource;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.management.ObjectName;
+import org.apache.geode.security.ResourcePermission.Target;
 
 public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.CREATE_GATEWAYSENDER, help = CliStrings.CREATE_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result createGatewaySender(@CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
       optionContext = ConverterHint.MEMBERGROUP,
       help = CliStrings.CREATE_GATEWAYSENDER__GROUP__HELP) String[] onGroups,
 
       @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS},
           optionContext = ConverterHint.MEMBERIDNAME,
-          unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
           help = CliStrings.CREATE_GATEWAYSENDER__MEMBER__HELP) String[] onMember,
 
       @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ID, mandatory = true,
@@ -131,7 +134,7 @@ public class WanCommands implements GfshCommand {
       @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__GATEWAYTRANSPORTFILTER,
           help = CliStrings.CREATE_GATEWAYSENDER__GATEWAYTRANSPORTFILTER__HELP) String[] gatewayTransportFilter) {
 
-    Result result = null;
+    Result result;
 
     AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
     try {
@@ -182,7 +185,8 @@ public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.START_GATEWAYSENDER, help = CliStrings.START_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result startGatewaySender(@CliOption(key = CliStrings.START_GATEWAYSENDER__ID,
       mandatory = true, optionContext = ConverterHint.GATEWAY_SENDER_ID,
       help = CliStrings.START_GATEWAYSENDER__ID__HELP) String senderId,
@@ -195,7 +199,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.START_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
     final String id = senderId.trim();
 
     try {
@@ -222,45 +226,41 @@ public class WanCommands implements GfshCommand {
         }
       });
 
-      List<Callable<List>> callables = new ArrayList<Callable<List>>();
+      List<Callable<List>> callables = new ArrayList<>();
 
       for (final DistributedMember member : dsMembers) {
 
-        callables.add(new Callable<List>() {
-
-          public List call() throws Exception {
+        callables.add(() -> {
 
-            GatewaySenderMXBean bean = null;
-            ArrayList<String> statusList = new ArrayList<String>();
-            if (cache.getDistributedSystem().getDistributedMember().getId()
-                .equals(member.getId())) {
-              bean = service.getLocalGatewaySenderMXBean(id);
-            } else {
-              ObjectName objectName = service.getGatewaySenderMBeanName(member, id);
-              bean = service.getMBeanProxy(objectName, GatewaySenderMXBean.class);
-            }
-            if (bean != null) {
-              if (bean.isRunning()) {
-                statusList.add(member.getId());
-                statusList.add(CliStrings.GATEWAY_ERROR);
-                statusList.add(
-                    CliStrings.format(CliStrings.GATEWAY_SENDER_0_IS_ALREADY_STARTED_ON_MEMBER_1,
-                        id, member.getId()));
-              } else {
-                bean.start();
-                statusList.add(member.getId());
-                statusList.add(CliStrings.GATEWAY_OK);
-                statusList.add(CliStrings.format(CliStrings.GATEWAY_SENDER_0_IS_STARTED_ON_MEMBER_1,
-                    id, member.getId()));
-              }
-            } else {
+          GatewaySenderMXBean bean;
+          ArrayList<String> statusList = new ArrayList<>();
+          if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
+            bean = service.getLocalGatewaySenderMXBean(id);
+          } else {
+            ObjectName objectName = service.getGatewaySenderMBeanName(member, id);
+            bean = service.getMBeanProxy(objectName, GatewaySenderMXBean.class);
+          }
+          if (bean != null) {
+            if (bean.isRunning()) {
               statusList.add(member.getId());
               statusList.add(CliStrings.GATEWAY_ERROR);
               statusList.add(CliStrings.format(
-                  CliStrings.GATEWAY_SENDER_0_IS_NOT_AVAILABLE_ON_MEMBER_1, id, member.getId()));
+                  CliStrings.GATEWAY_SENDER_0_IS_ALREADY_STARTED_ON_MEMBER_1, id, member.getId()));
+            } else {
+              bean.start();
+              statusList.add(member.getId());
+              statusList.add(CliStrings.GATEWAY_OK);
+              statusList.add(CliStrings.format(CliStrings.GATEWAY_SENDER_0_IS_STARTED_ON_MEMBER_1,
+                  id, member.getId()));
             }
-            return statusList;
+          } else {
+            statusList.add(member.getId());
+            statusList.add(CliStrings.GATEWAY_ERROR);
+            statusList.add(CliStrings.format(
+                CliStrings.GATEWAY_SENDER_0_IS_NOT_AVAILABLE_ON_MEMBER_1, id, member.getId()));
           }
+          return statusList;
+
         });
       }
 
@@ -276,21 +276,15 @@ public class WanCommands implements GfshCommand {
 
       for (Future<List> future : futures) {
         DistributedMember member = memberIterator.next();
-        List<String> memberStatus = null;
+        List<String> memberStatus;
         try {
           memberStatus = future.get();
           accumulateStartResult(resultData, memberStatus.get(0), memberStatus.get(1),
               memberStatus.get(2));
-        } catch (InterruptedException ite) {
+        } catch (InterruptedException | ExecutionException ite) {
           accumulateStartResult(resultData, member.getId(), CliStrings.GATEWAY_ERROR,
               CliStrings.format(CliStrings.GATEWAY_SENDER_0_COULD_NOT_BE_STARTED_ON_MEMBER_DUE_TO_1,
                   id, ite.getMessage()));
-          continue;
-        } catch (ExecutionException ee) {
-          accumulateStartResult(resultData, member.getId(), CliStrings.GATEWAY_ERROR,
-              CliStrings.format(CliStrings.GATEWAY_SENDER_0_COULD_NOT_BE_STARTED_ON_MEMBER_DUE_TO_1,
-                  id, ee.getMessage()));
-          continue;
         }
       }
       execService.shutdown();
@@ -305,7 +299,8 @@ public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.PAUSE_GATEWAYSENDER, help = CliStrings.PAUSE_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result pauseGatewaySender(@CliOption(key = CliStrings.PAUSE_GATEWAYSENDER__ID,
       mandatory = true, optionContext = ConverterHint.GATEWAY_SENDER_ID,
       help = CliStrings.PAUSE_GATEWAYSENDER__ID__HELP) String senderId,
@@ -318,7 +313,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.PAUSE_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
     if (senderId != null) {
       senderId = senderId.trim();
     }
@@ -328,7 +323,7 @@ public class WanCommands implements GfshCommand {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewaySenderMXBean bean = null;
+      GatewaySenderMXBean bean;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
@@ -378,7 +373,8 @@ public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.RESUME_GATEWAYSENDER, help = CliStrings.RESUME_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result resumeGatewaySender(@CliOption(key = CliStrings.RESUME_GATEWAYSENDER__ID,
       mandatory = true, optionContext = ConverterHint.GATEWAY_SENDER_ID,
       help = CliStrings.RESUME_GATEWAYSENDER__ID__HELP) String senderId,
@@ -390,7 +386,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.RESUME_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
     if (senderId != null) {
       senderId = senderId.trim();
     }
@@ -400,7 +396,7 @@ public class WanCommands implements GfshCommand {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewaySenderMXBean bean = null;
+      GatewaySenderMXBean bean;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
@@ -450,7 +446,8 @@ public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.STOP_GATEWAYSENDER, help = CliStrings.STOP_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result stopGatewaySender(@CliOption(key = CliStrings.STOP_GATEWAYSENDER__ID,
       mandatory = true, optionContext = ConverterHint.GATEWAY_SENDER_ID,
       help = CliStrings.STOP_GATEWAYSENDER__ID__HELP) String senderId,
@@ -463,7 +460,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.STOP_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
     if (senderId != null)
       senderId = senderId.trim();
 
@@ -472,7 +469,7 @@ public class WanCommands implements GfshCommand {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewaySenderMXBean bean = null;
+      GatewaySenderMXBean bean;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
@@ -518,14 +515,14 @@ public class WanCommands implements GfshCommand {
   @CliCommand(value = CliStrings.CREATE_GATEWAYRECEIVER,
       help = CliStrings.CREATE_GATEWAYRECEIVER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result createGatewayReceiver(@CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
       optionContext = ConverterHint.MEMBERGROUP,
       help = CliStrings.CREATE_GATEWAYRECEIVER__GROUP__HELP) String[] onGroups,
 
       @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS},
           optionContext = ConverterHint.MEMBERIDNAME,
-          unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
           help = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember,
 
       @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART,
@@ -549,7 +546,7 @@ public class WanCommands implements GfshCommand {
       @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__GATEWAYTRANSPORTFILTER,
           help = CliStrings.CREATE_GATEWAYRECEIVER__GATEWAYTRANSPORTFILTER__HELP) String[] gatewayTransportFilters) {
 
-    Result result = null;
+    Result result;
 
     AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
     try {
@@ -601,12 +598,13 @@ public class WanCommands implements GfshCommand {
   @CliCommand(value = CliStrings.LOAD_BALANCE_GATEWAYSENDER,
       help = CliStrings.LOAD_BALANCE_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result loadBalanceGatewaySender(@CliOption(key = CliStrings.LOAD_BALANCE_GATEWAYSENDER__ID,
       mandatory = true, optionContext = ConverterHint.GATEWAY_SENDER_ID,
       help = CliStrings.LOAD_BALANCE_GATEWAYSENDER__ID__HELP) String senderId) {
 
-    Result result = null;
+    Result result;
     if (senderId != null) {
       senderId = senderId.trim();
     }
@@ -623,7 +621,7 @@ public class WanCommands implements GfshCommand {
       } else {
         boolean gatewaySenderExists = false;
         for (DistributedMember member : dsMembers) {
-          GatewaySenderMXBean bean = null;
+          GatewaySenderMXBean bean;
           if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
             bean = service.getLocalGatewaySenderMXBean(senderId);
           } else {
@@ -660,7 +658,8 @@ public class WanCommands implements GfshCommand {
   @CliCommand(value = CliStrings.START_GATEWAYRECEIVER,
       help = CliStrings.START_GATEWAYRECEIVER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result startGatewayReceiver(@CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
       optionContext = ConverterHint.MEMBERGROUP,
       help = CliStrings.START_GATEWAYRECEIVER__GROUP__HELP) String[] onGroup,
@@ -668,14 +667,14 @@ public class WanCommands implements GfshCommand {
       @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS},
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.START_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
-    Result result = null;
+    Result result;
 
     try {
       InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewayReceiverMXBean receieverBean = null;
+      GatewayReceiverMXBean receiverBean;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
@@ -689,15 +688,15 @@ public class WanCommands implements GfshCommand {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
 
         if (gatewayReceiverObjectName != null) {
-          receieverBean =
+          receiverBean =
               service.getMBeanProxy(gatewayReceiverObjectName, GatewayReceiverMXBean.class);
-          if (receieverBean != null) {
-            if (receieverBean.isRunning()) {
+          if (receiverBean != null) {
+            if (receiverBean.isRunning()) {
               accumulateStartResult(resultData, member.getId(), CliStrings.GATEWAY_ERROR,
                   CliStrings.format(CliStrings.GATEWAY_RECEIVER_IS_ALREADY_STARTED_ON_MEMBER_0,
                       new Object[] {member.getId()}));
             } else {
-              receieverBean.start();
+              receiverBean.start();
               accumulateStartResult(resultData, member.getId(), CliStrings.GATEWAY_OK,
                   CliStrings.format(CliStrings.GATEWAY_RECEIVER_IS_STARTED_ON_MEMBER_0,
                       new Object[] {member.getId()}));
@@ -725,7 +724,8 @@ public class WanCommands implements GfshCommand {
 
   @CliCommand(value = CliStrings.STOP_GATEWAYRECEIVER, help = CliStrings.STOP_GATEWAYRECEIVER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result stopGatewayReceiver(
 
       @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
@@ -736,14 +736,14 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.STOP_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
 
     try {
       InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewayReceiverMXBean receieverBean = null;
+      GatewayReceiverMXBean receiverBean;
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
 
@@ -757,11 +757,11 @@ public class WanCommands implements GfshCommand {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
 
         if (gatewayReceiverObjectName != null) {
-          receieverBean =
+          receiverBean =
               service.getMBeanProxy(gatewayReceiverObjectName, GatewayReceiverMXBean.class);
-          if (receieverBean != null) {
-            if (receieverBean.isRunning()) {
-              receieverBean.stop();
+          if (receiverBean != null) {
+            if (receiverBean.isRunning()) {
+              receiverBean.stop();
               accumulateStartResult(resultData, member.getId(), CliStrings.GATEWAY_OK,
                   CliStrings.format(CliStrings.GATEWAY_RECEIVER_IS_STOPPED_ON_MEMBER_0,
                       new Object[] {member.getId()}));
@@ -802,7 +802,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERGROUP,
           help = CliStrings.LIST_GATEWAY__GROUP__HELP) String[] onGroup) {
 
-    Result result = null;
+    Result result;
     InternalCache cache = getCache();
     try {
       SystemManagementService service =
@@ -814,10 +814,8 @@ public class WanCommands implements GfshCommand {
         return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
       }
 
-      Map<String, Map<String, GatewaySenderMXBean>> gatewaySenderBeans =
-          new TreeMap<String, Map<String, GatewaySenderMXBean>>();
-      Map<String, GatewayReceiverMXBean> gatewayReceiverBeans =
-          new TreeMap<String, GatewayReceiverMXBean>();
+      Map<String, Map<String, GatewaySenderMXBean>> gatewaySenderBeans = new TreeMap<>();
+      Map<String, GatewayReceiverMXBean> gatewayReceiverBeans = new TreeMap<>();
 
       DistributedSystemMXBean dsMXBean = service.getDistributedSystemMXBean();
       for (DistributedMember member : dsMembers) {
@@ -837,8 +835,7 @@ public class WanCommands implements GfshCommand {
                     gatewaySenderBeans.get(senderBean.getSenderId());
                 memberToBeanMap.put(member.getId(), senderBean);
               } else {
-                Map<String, GatewaySenderMXBean> memberToBeanMap =
-                    new TreeMap<String, GatewaySenderMXBean>();
+                Map<String, GatewaySenderMXBean> memberToBeanMap = new TreeMap<>();
                 memberToBeanMap.put(member.getId(), senderBean);
                 gatewaySenderBeans.put(senderBean.getSenderId(), memberToBeanMap);
               }
@@ -848,11 +845,11 @@ public class WanCommands implements GfshCommand {
         // gateway receivers : a member can have only one gateway receiver
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
         if (gatewayReceiverObjectName != null) {
-          GatewayReceiverMXBean receieverBean = null;
-          receieverBean =
+          GatewayReceiverMXBean receiverBean;
+          receiverBean =
               service.getMBeanProxy(gatewayReceiverObjectName, GatewayReceiverMXBean.class);
-          if (receieverBean != null) {
-            gatewayReceiverBeans.put(member.getId(), receieverBean);
+          if (receiverBean != null) {
+            gatewayReceiverBeans.put(member.getId(), receiverBean);
           }
         }
       }
@@ -886,7 +883,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.STATUS_GATEWAYSENDER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
     if (senderId != null)
       senderId = senderId.trim();
     try {
@@ -894,7 +891,7 @@ public class WanCommands implements GfshCommand {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      GatewaySenderMXBean bean = null;
+      GatewaySenderMXBean bean;
 
       CompositeResultData crd = ResultBuilder.createCompositeResultData();
       TabularResultData availableSenderData =
@@ -944,7 +941,7 @@ public class WanCommands implements GfshCommand {
           optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.STATUS_GATEWAYRECEIVER__MEMBER__HELP) String[] onMember) {
 
-    Result result = null;
+    Result result;
 
     try {
       InternalCache cache = getCache();
@@ -969,10 +966,10 @@ public class WanCommands implements GfshCommand {
       for (DistributedMember member : dsMembers) {
         ObjectName gatewayReceiverObjectName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
         if (gatewayReceiverObjectName != null) {
-          GatewayReceiverMXBean receieverBean =
+          GatewayReceiverMXBean receiverBean =
               service.getMBeanProxy(gatewayReceiverObjectName, GatewayReceiverMXBean.class);
-          if (receieverBean != null) {
-            buildReceiverStatus(member.getId(), receieverBean, availableReceiverData);
+          if (receiverBean != null) {
+            buildReceiverStatus(member.getId(), receiverBean, availableReceiverData);
             continue;
           }
         }
@@ -989,19 +986,19 @@ public class WanCommands implements GfshCommand {
   @CliCommand(value = CliStrings.DESTROY_GATEWAYSENDER,
       help = CliStrings.DESTROY_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
-  @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
+  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.MANAGE,
+      target = Target.GATEWAY)
   public Result destroyGatewaySender(
       @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
           optionContext = ConverterHint.MEMBERGROUP,
           help = CliStrings.DESTROY_GATEWAYSENDER__GROUP__HELP) String[] onGroups,
       @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS},
           optionContext = ConverterHint.MEMBERIDNAME,
-          unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
           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) {
-    Result result = null;
+    Result result;
     try {
       GatewaySenderDestroyFunctionArgs gatewaySenderDestroyFunctionArgs =
           new GatewaySenderDestroyFunctionArgs(id);
@@ -1128,7 +1125,7 @@ public class WanCommands implements GfshCommand {
 
 
   private Result handleCommandResultException(CommandResultException crex) {
-    Result result = null;
+    Result result;
     if (crex.getResult() != null) {
       result = crex.getResult();
     } else {

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/lifecycle/StartPulseCommand.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/lifecycle/StartPulseCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/lifecycle/StartPulseCommand.java
index b5c6148..fbf32d8 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/lifecycle/StartPulseCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/lifecycle/StartPulseCommand.java
@@ -16,6 +16,15 @@ package org.apache.geode.management.internal.cli.commands.lifecycle;
 
 import static org.apache.geode.internal.Assert.assertState;
 
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+
+import javax.management.ObjectName;
+
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
 import org.apache.geode.SystemFailure;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.management.cli.CliMetaData;
@@ -25,13 +34,6 @@ import org.apache.geode.management.internal.cli.commands.GfshCommand;
 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.shell.OperationInvoker;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URI;
-import javax.management.ObjectName;
 
 public class StartPulseCommand implements GfshCommand {
 
@@ -85,7 +87,7 @@ public class StartPulseCommand implements GfshCommand {
 
   private void browse(URI uri) throws IOException {
     assertState(Desktop.isDesktopSupported(),
-        String.format(CliStrings.DESKSTOP_APP_RUN_ERROR_MESSAGE, System.getProperty("os.name")));
+        String.format(CliStrings.DESKTOP_APP_RUN_ERROR_MESSAGE, System.getProperty("os.name")));
     Desktop.getDesktop().browse(uri);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContinuousQueryFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContinuousQueryFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContinuousQueryFunction.java
new file mode 100644
index 0000000..1f06a41
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContinuousQueryFunction.java
@@ -0,0 +1,148 @@
+/*
+ * 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.functions;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.execute.Function;
+import org.apache.geode.cache.execute.FunctionContext;
+import org.apache.geode.internal.InternalEntity;
+import org.apache.geode.internal.cache.CacheServerImpl;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
+import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
+import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy;
+import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
+
+/**
+ * @since GemFire 8.0
+ */
+public class ContinuousQueryFunction implements Function, InternalEntity {
+  private static final long serialVersionUID = 1L;
+
+  public static final String ID = ContinuousQueryFunction.class.getName();
+
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
+  @Override
+  public void execute(FunctionContext context) {
+    try {
+      String clientID = (String) context.getArguments();
+      InternalCache cache = getCache();
+      if (cache.getCacheServers().size() > 0) {
+        CacheServerImpl server = (CacheServerImpl) cache.getCacheServers().iterator().next();
+        if (server != null) {
+          AcceptorImpl acceptorImpl = server.getAcceptor();
+          if (acceptorImpl != null) {
+            CacheClientNotifier cacheClientNotifier = acceptorImpl.getCacheClientNotifier();
+            if (cacheClientNotifier != null) {
+              Collection<CacheClientProxy> cacheClientProxySet =
+                  cacheClientNotifier.getClientProxies();
+              ClientInfo clientInfo = null;
+              boolean foundClientinCCP = false;
+              Iterator<CacheClientProxy> it = cacheClientProxySet.iterator();
+              while (it.hasNext()) {
+
+                CacheClientProxy ccp = it.next();
+                if (ccp != null) {
+                  String clientIdFromProxy = ccp.getProxyID().getDSMembership();
+                  if (clientIdFromProxy != null && clientIdFromProxy.equals(clientID)) {
+                    foundClientinCCP = true;
+                    String durableId = ccp.getProxyID().getDurableId();
+                    boolean isPrimary = ccp.isPrimary();
+                    clientInfo = new ClientInfo(
+                        (durableId != null && durableId.length() > 0 ? "Yes" : "No"),
+                        (isPrimary == true
+                            ? cache.getDistributedSystem().getDistributedMember().getId() : ""),
+                        (isPrimary == false
+                            ? cache.getDistributedSystem().getDistributedMember().getId() : ""));
+                    break;
+
+                  }
+                }
+              }
+
+              // try getting from server connections
+              if (foundClientinCCP == false) {
+                ServerConnection[] serverConnections = acceptorImpl.getAllServerConnectionList();
+
+                for (ServerConnection conn : serverConnections) {
+                  ClientProxyMembershipID cliIdFrmProxy = conn.getProxyID();
+
+                  if (clientID.equals(cliIdFrmProxy.getDSMembership())) {
+                    String durableId = cliIdFrmProxy.getDurableId();
+                    clientInfo =
+                        new ClientInfo((durableId != null && durableId.length() > 0 ? "Yes" : "No"),
+                            "N.A.", "N.A.");
+                  }
+
+                }
+              }
+              context.getResultSender().lastResult(clientInfo);
+            }
+          }
+        }
+      }
+    } catch (Exception e) {
+      context.getResultSender()
+          .lastResult("Exception in ContinuousQueryFunction =" + e.getMessage());
+    }
+    context.getResultSender().lastResult(null);
+  }
+
+  @Override
+  public String getId() {
+    return ContinuousQueryFunction.ID;
+  }
+
+  @Override
+  public boolean hasResult() {
+    return true;
+  }
+
+  @Override
+  public boolean optimizeForWrite() {
+    return false;
+  }
+
+  @Override
+  public boolean isHA() {
+    return false;
+  }
+
+  public class ClientInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public String isDurable;
+    public String primaryServer;
+    public String secondaryServer;
+
+    public ClientInfo(String IsClientDurable, String primaryServerId, String secondaryServerId) {
+      isDurable = IsClientDurable;
+      primaryServer = primaryServerId;
+      secondaryServer = secondaryServerId;
+    }
+
+    @Override
+    public String toString() {
+      return "ClientInfo [isDurable=" + isDurable + ", primaryServer=" + primaryServer
+          + ", secondaryServer=" + secondaryServer + "]";
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
deleted file mode 100644
index 47890e1..0000000
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
+++ /dev/null
@@ -1,150 +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.functions;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Iterator;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.cache.execute.Function;
-import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.internal.InternalEntity;
-import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
-import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
-import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy;
-import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
-import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
-
-/**
- * TODO: rename ContunuousQueryFunction
- * 
- * @since GemFire 8.0
- */
-public class ContunuousQueryFunction implements Function, InternalEntity {
-  private static final long serialVersionUID = 1L;
-
-  public static final String ID = ContunuousQueryFunction.class.getName();
-
-  private InternalCache getCache() {
-    return (InternalCache) CacheFactory.getAnyInstance();
-  }
-
-  @Override
-  public void execute(FunctionContext context) {
-    try {
-      String clientID = (String) context.getArguments();
-      InternalCache cache = getCache();
-      if (cache.getCacheServers().size() > 0) {
-        CacheServerImpl server = (CacheServerImpl) cache.getCacheServers().iterator().next();
-        if (server != null) {
-          AcceptorImpl acceptorImpl = server.getAcceptor();
-          if (acceptorImpl != null) {
-            CacheClientNotifier cacheClientNotifier = acceptorImpl.getCacheClientNotifier();
-            if (cacheClientNotifier != null) {
-              Collection<CacheClientProxy> cacheClientProxySet =
-                  cacheClientNotifier.getClientProxies();
-              ClientInfo clientInfo = null;
-              boolean foundClientinCCP = false;
-              Iterator<CacheClientProxy> it = cacheClientProxySet.iterator();
-              while (it.hasNext()) {
-
-                CacheClientProxy ccp = it.next();
-                if (ccp != null) {
-                  String clientIdFromProxy = ccp.getProxyID().getDSMembership();
-                  if (clientIdFromProxy != null && clientIdFromProxy.equals(clientID)) {
-                    foundClientinCCP = true;
-                    String durableId = ccp.getProxyID().getDurableId();
-                    boolean isPrimary = ccp.isPrimary();
-                    clientInfo = new ClientInfo(
-                        (durableId != null && durableId.length() > 0 ? "Yes" : "No"),
-                        (isPrimary == true
-                            ? cache.getDistributedSystem().getDistributedMember().getId() : ""),
-                        (isPrimary == false
-                            ? cache.getDistributedSystem().getDistributedMember().getId() : ""));
-                    break;
-
-                  }
-                }
-              }
-
-              // try getting from server connections
-              if (foundClientinCCP == false) {
-                ServerConnection[] serverConnections = acceptorImpl.getAllServerConnectionList();
-
-                for (ServerConnection conn : serverConnections) {
-                  ClientProxyMembershipID cliIdFrmProxy = conn.getProxyID();
-
-                  if (clientID.equals(cliIdFrmProxy.getDSMembership())) {
-                    String durableId = cliIdFrmProxy.getDurableId();
-                    clientInfo =
-                        new ClientInfo((durableId != null && durableId.length() > 0 ? "Yes" : "No"),
-                            "N.A.", "N.A.");
-                  }
-
-                }
-              }
-              context.getResultSender().lastResult(clientInfo);
-            }
-          }
-        }
-      }
-    } catch (Exception e) {
-      context.getResultSender()
-          .lastResult("Exception in ContunuousQueryFunction =" + e.getMessage());
-    }
-    context.getResultSender().lastResult(null);
-  }
-
-  @Override
-  public String getId() {
-    return ContunuousQueryFunction.ID;
-  }
-
-  @Override
-  public boolean hasResult() {
-    return true;
-  }
-
-  @Override
-  public boolean optimizeForWrite() {
-    return false;
-  }
-
-  @Override
-  public boolean isHA() {
-    return false;
-  }
-
-  public class ClientInfo implements Serializable {
-    private static final long serialVersionUID = 1L;
-    public String isDurable;
-    public String primaryServer;
-    public String secondaryServer;
-
-    public ClientInfo(String IsClientDurable, String primaryServerId, String secondaryServerId) {
-      isDurable = IsClientDurable;
-      primaryServer = primaryServerId;
-      secondaryServer = secondaryServerId;
-    }
-
-    @Override
-    public String toString() {
-      return "ClientInfo [isDurable=" + isDurable + ", primaryServer=" + primaryServer
-          + ", secondaryServer=" + secondaryServer + "]";
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
index 573b82e..3af79eb 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/RegionFunctionArgs.java
@@ -13,12 +13,6 @@
  * the License.
  */
 
-/**
- * Used to carry arguments between gfsh region command implementations and the functions that do the
- * work for those commands.
- * 
- * @since GemFire 7.0
- */
 package org.apache.geode.management.internal.cli.functions;
 
 import java.io.Serializable;
@@ -35,6 +29,12 @@ import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.management.internal.cli.CliUtil;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 
+/**
+ * Used to carry arguments between gfsh region command implementations and the functions that do the
+ * work for those commands.
+ *
+ * @since GemFire 7.0
+ */
 public class RegionFunctionArgs implements Serializable {
   private static final long serialVersionUID = -5158224572470173267L;
 
@@ -122,7 +122,7 @@ public class RegionFunctionArgs implements Serializable {
       this.enableSubscriptionConflation = enableSubscriptionConflation;
     }
     if (cacheListeners != null) {
-      this.cacheListeners = new LinkedHashSet<String>();
+      this.cacheListeners = new LinkedHashSet<>();
       this.cacheListeners.addAll(Arrays.asList(cacheListeners));
     } else {
       this.cacheListeners = null;
@@ -130,13 +130,13 @@ public class RegionFunctionArgs implements Serializable {
     this.cacheLoader = cacheLoader;
     this.cacheWriter = cacheWriter;
     if (asyncEventQueueIds != null) {
-      this.asyncEventQueueIds = new LinkedHashSet<String>();
+      this.asyncEventQueueIds = new LinkedHashSet<>();
       this.asyncEventQueueIds.addAll(Arrays.asList(asyncEventQueueIds));
     } else {
       this.asyncEventQueueIds = null;
     }
     if (gatewaySenderIds != null) {
-      this.gatewaySenderIds = new LinkedHashSet<String>();
+      this.gatewaySenderIds = new LinkedHashSet<>();
       this.gatewaySenderIds.addAll(Arrays.asList(gatewaySenderIds));
     } else {
       this.gatewaySenderIds = null;
@@ -527,7 +527,7 @@ public class RegionFunctionArgs implements Serializable {
     }
 
     public ExpirationAttributes convertToExpirationAttributes() {
-      ExpirationAttributes expirationAttr = null;
+      ExpirationAttributes expirationAttr;
       if (action != null) {
         expirationAttr = new ExpirationAttributes(time, action);
       } else {
@@ -590,8 +590,8 @@ public class RegionFunctionArgs implements Serializable {
       }
     }
 
-    public static enum ExpirationFor {
-      REGION_IDLE, REGION_TTL, ENTRY_IDLE, ENTRY_TTL;
+    public enum ExpirationFor {
+      REGION_IDLE, REGION_TTL, ENTRY_IDLE, ENTRY_TTL
     }
   }
 
@@ -615,7 +615,7 @@ public class RegionFunctionArgs implements Serializable {
     private String partitionResolver;
 
     private boolean hasPartitionAttributes;
-    private final Set<String> userSpecifiedPartitionAttributes = new HashSet<String>();
+    private final Set<String> userSpecifiedPartitionAttributes = new HashSet<>();
 
     public PartitionArgs(String prColocatedWith, Integer prLocalMaxMemory, Long prRecoveryDelay,
         Integer prRedundantCopies, Long prStartupRecoveryDelay, Long prTotalMaxMemory,

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java
index 630c2bc..1f9a607 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java
@@ -17,7 +17,6 @@ package org.apache.geode.management.internal.cli.functions;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.CancellationException;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -25,7 +24,6 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.cache.execute.FunctionException;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
@@ -61,7 +59,7 @@ public class UserFunctionExecution implements Function, InternalEntity {
           if (argumentsString != null && argumentsString.length() > 0) {
             functionArgs = argumentsString.split(",");
           }
-          Set<String> filters = new HashSet<String>();
+          Set<String> filters = new HashSet<>();
           ResultCollector resultCollectorInstance = null;
           if (resultCollectorName != null && resultCollectorName.length() > 0) {
             resultCollectorInstance = (ResultCollector) ClassPathLoader.getLatest()
@@ -94,29 +92,29 @@ public class UserFunctionExecution implements Function, InternalEntity {
               if (functionArgs != null && functionArgs.length > 0) {
                 execution = execution.setArguments(functionArgs);
               }
-              if (filters != null && filters.size() > 0) {
+              if (filters.size() > 0) {
                 execution = execution.withFilter(filters);
               }
 
               List<Object> results = (List<Object>) execution.execute(function).getResult();
 
-              StringBuilder resultMessege = new StringBuilder();
+              StringBuilder resultMessage = new StringBuilder();
               if (results != null) {
                 for (Object resultObj : results) {
                   if (resultObj != null) {
                     if (resultObj instanceof String) {
-                      resultMessege.append(((String) resultObj));
-                      resultMessege.append(GfshParser.LINE_SEPARATOR);
+                      resultMessage.append(((String) resultObj));
+                      resultMessage.append(GfshParser.LINE_SEPARATOR);
                     } else if (resultObj instanceof Exception) {
-                      resultMessege.append(((IllegalArgumentException) resultObj).getMessage());
+                      resultMessage.append(((IllegalArgumentException) resultObj).getMessage());
                     } else {
-                      resultMessege.append(resultObj);
-                      resultMessege.append(GfshParser.LINE_SEPARATOR);
+                      resultMessage.append(resultObj);
+                      resultMessage.append(GfshParser.LINE_SEPARATOR);
                     }
                   }
                 }
               }
-              context.getResultSender().lastResult(resultMessege);
+              context.getResultSender().lastResult(resultMessage);
             } else {
               context.getResultSender()
                   .lastResult(CliStrings.format(
@@ -126,27 +124,7 @@ public class UserFunctionExecution implements Function, InternalEntity {
             }
           }
 
-        } catch (ClassNotFoundException e) {
-          context.getResultSender()
-              .lastResult(CliStrings.format(
-                  CliStrings.EXECUTE_FUNCTION__MSG__RESULT_COLLECTOR_0_NOT_FOUND_ERROR_1,
-                  resultCollectorName, e.getMessage()));
-        } catch (FunctionException e) {
-          context.getResultSender()
-              .lastResult(CliStrings.format(
-                  CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_ON_MEMBER_1_DETAILS_2,
-                  functionId, member.getId(), e.getMessage()));
-        } catch (CancellationException e) {
-          context.getResultSender()
-              .lastResult(CliStrings.format(
-                  CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_ON_MEMBER_1_DETAILS_2,
-                  functionId, member.getId(), e.getMessage()));
-        } catch (InstantiationException e) {
-          context.getResultSender()
-              .lastResult(CliStrings.format(
-                  CliStrings.EXECUTE_FUNCTION__MSG__RESULT_COLLECTOR_0_NOT_FOUND_ERROR_1,
-                  resultCollectorName, e.getMessage()));
-        } catch (IllegalAccessException e) {
+        } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
           context.getResultSender()
               .lastResult(CliStrings.format(
                   CliStrings.EXECUTE_FUNCTION__MSG__RESULT_COLLECTOR_0_NOT_FOUND_ERROR_1,

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
index 0f74edd..3d4d53f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
@@ -140,7 +140,7 @@ public class CliStrings {
   public static final String TOPIC_GFSH__DESC = "The Geode Shell";
   public static final String TOPIC_SHARED_CONFIGURATION = "Cluster Configuration";
   public static final String TOPIC_SHARED_CONFIGURATION_HELP =
-      "Configuration for cluster and various groups. It consists of cache.xml, geode properties and deployed jars.\nChanges due to gfshs command are persisted to the locator hosting the cluster configuration service.";
+      "Configuration for cluster and various groups. It consists of cache.xml, geode properties and deployed jars.\nChanges due to gfsh command are persisted to the locator hosting the cluster configuration service.";
   public static final String TOPIC_LOGS = "Logs";
   public static final String TOPIC_LOGS__DESC = "Generate log contents as per the need";
   public static final String TOPIC_CLIENT = "Client";
@@ -150,7 +150,7 @@ public class CliStrings {
    * ********* String Constants other than command name, options & help ******
    * *************************************************************************/
 
-  public static final String DESKSTOP_APP_RUN_ERROR_MESSAGE =
+  public static final String DESKTOP_APP_RUN_ERROR_MESSAGE =
       "Running desktop applications is not supported on %1$s.";
   public static final String GEODE_HOME_NOT_FOUND_ERROR_MESSAGE =
       "The GEODE environment variable was not defined.  Please set the GEODE environment variable to the directory where GEODE is installed.";
@@ -203,7 +203,7 @@ public class CliStrings {
   public static final String NO_CLIENT_FOUND = "No client found on this server";
   public static final String NO_CLIENT_FOUND_WITH_CLIENT_ID =
       "No client found with client-id : {0}";
-  public static final String ACTION_SUCCCEEDED_ON_MEMBER = "{0} on following members.";
+  public static final String ACTION_SUCCEEDED_ON_MEMBER = "{0} on following members.";
   public static final String OCCURRED_ON_MEMBERS = "Occurred on members";
   public static final String SHARED_CONFIGURATION_NOT_STARTED =
       "Cluster configuration service is enabled but has not started yet.";
@@ -216,8 +216,8 @@ public class CliStrings {
   public static final String GFSHPARSER__MSG__REQUIRED_ARGUMENT_0 = "Required Argument: \"{0}\"";
   public static final String GFSHPARSER__MSG__VALUE_REQUIRED_FOR_OPTION_0 =
       "Value is required for parameter \"{0}\"";
-  public static final String GFSHPARSER__MSG__AMBIGIOUS_COMMAND_0_FOR_ASSISTANCE_USE_1_OR_HINT_HELP =
-      "Ambigious command \"{0}\" (for assistance press \"{1}\" or type \"hint\" or \"help <command name>\" & then hit ENTER)";
+  public static final String GFSHPARSER__MSG__AMBIGUOUS_COMMAND_0_FOR_ASSISTANCE_USE_1_OR_HINT_HELP =
+      "Ambiguous command \"{0}\" (for assistance press \"{1}\" or type \"hint\" or \"help <command name>\" & then hit ENTER)";
   public static final String GFSHPARSER__MSG__COMMAND_ARGUMENT_0_IS_REQUIRED_USE_HELP =
       "Command parameter \"{0}\" is required. Use \"help <command name>\" for assistance.";
   public static final String GFSHPARSER__MSG__COMMAND_OPTION_0_IS_REQUIRED_USE_HELP =
@@ -583,7 +583,7 @@ public class CliStrings {
       "The gfsecurity.properties file for configuring gfsh to connect to the Locator/Manager. The file's path can be absolute or relative to gfsh directory.";
   public static final String CONNECT__USE_SSL = "use-ssl";
   public static final String CONNECT__USE_SSL__HELP =
-      "Whether to use SSL for communication with Locator and/or JMX Manager. If set to \"true\", will also read \"gfsecurity.properties\". SSL Options take precedence over proeprties file. If none are specified, defaults will be used. The default value for this options is \"false\".";
+      "Whether to use SSL for communication with Locator and/or JMX Manager. If set to \"true\", will also read \"gfsecurity.properties\". SSL Options take precedence over properties file. If none are specified, defaults will be used. The default value for this options is \"false\".";
   public static final String CONNECT__MSG__CONNECTING_TO_MANAGER_AT_0 =
       "Connecting to Manager at {0} ..";
   public static final String CONNECT__MSG__CONNECTING_TO_MANAGER_HTTP_SERVICE_AT_0 =
@@ -1326,7 +1326,7 @@ public class CliStrings {
   public static final String EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_0_ON_MEMBER_1_ON_REGION_2_DETAILS_3 =
       "While executing function : {0} on member : {1} one region : {2} error occurred : {3}";
   public static final String EXECUTE_FUNCTION__MSG__MEMBER_SHOULD_NOT_HAVE_FILTER_FOR_EXECUTION =
-      "Filters for executing on \"member\"/\"mebers of group\" is not supported.";
+      "Filters for executing on \"member\"/\"members of group\" is not supported.";
 
   /* exit command */
   public static final String EXIT = "exit";
@@ -1366,7 +1366,7 @@ public class CliStrings {
   public static final String EXPORT_DATA__MEMBER__NOT__FOUND = "Member {0} not found";
   public static final String EXPORT_DATA__REGION__NOT__FOUND = "Region {0} not found";
   public static final String EXPORT_DATA__SUCCESS__MESSAGE =
-      "Data succesfully exported from region : {0} to file : {1} on host : {2}";
+      "Data successfully exported from region : {0} to file : {1} on host : {2}";
 
   /* export logs command */
   public static final String EXPORT_LOGS = "export logs";
@@ -1607,7 +1607,7 @@ public class CliStrings {
   public static final String DESCRIBE_CLIENT_COLUMN_DURABLE = "Is Durable";
   public static final String DESCRIBE_CLIENT_MIN_CONN = "Minimum Connections";
   public static final String DESCRIBE_CLIENT_MAX_CONN = "Maximum Connections";
-  public static final String DESCRIBE_CLIENT_REDUDANCY = "Redudancy";
+  public static final String DESCRIBE_CLIENT_REDUNDANCY = "Redundancy";
   public static final String DESCRIBE_CLIENT_CQs = "Num of CQs";
 
 
@@ -1722,7 +1722,7 @@ public class CliStrings {
       "Group of members on which to run the netstat command.";
   public static final String NETSTAT__FILE = "file";
   public static final String NETSTAT__FILE__HELP =
-      "Text file to which output from the netstat command will be written. A \".txt\" extention will be added if it's not already a part of the specified name.";
+      "Text file to which output from the netstat command will be written. A \".txt\" extension will be added if it's not already a part of the specified name.";
   public static final String NETSTAT__WITHLSOF = "with-lsof";
   public static final String NETSTAT__WITHLSOF__HELP =
       "Whether lsof (list open files) command output should also be displayed. Not applicable for \"Microsoft Windows(TM)\" hosts.";
@@ -1848,9 +1848,9 @@ public class CliStrings {
   public static final String REBALANCE__MSG__NO_REBALANCING_REGIONS_ON_DS =
       "Distributed system has no regions that can be rebalanced";
   public static final String REBALANCE__MSG__EXCEPTION_IN_REBALANCE_FOR_MEMBER_0_Exception =
-      "Excpetion occurred while rebalancing on member : {0} . Exception is ";
+      "Exception occurred while rebalancing on member : {0} . Exception is ";
   public static final String REBALANCE__MSG__EXCEPTION_IN_REBALANCE_FOR_MEMBER_0_Exception_1 =
-      "Excpetion occurred while rebalancing on member : {0} . Exception is : {1}";
+      "Exception occurred while rebalancing on member : {0} . Exception is : {1}";
   public static final String REBALANCE__MSG__ERROR_IN_RETRIEVING_MBEAN =
       "Could not retrieve MBean for region : {0}";
   public static final String REBALANCE__MSG__NO_EXECUTION_FOR_REGION_0_ON_MEMBERS_1 =
@@ -1864,7 +1864,7 @@ public class CliStrings {
       "Rebalance will continue in background";
   public static final String REBALANCE__MSG__REGION_NOT_ASSOCIATED_WITH_MORE_THAN_ONE_MEMBER =
       "No regions associated with more than 1 members";
-  public static final String REBALANCE__MSG__EXCEPTION_OCCRED_WHILE_REBALANCING_0 =
+  public static final String REBALANCE__MSG__EXCEPTION_OCCURRED_WHILE_REBALANCING_0 =
       "Exception occurred while rebelancing. Reason : {0}";
 
   /* remove command */
@@ -1954,7 +1954,7 @@ public class CliStrings {
       + "3. APP_LAST_EXIT_STATUS            Numeric value for last command exit status. One of: 0 (success), 1 (error), 2 (crash) (read only)\n"
       + "4. APP_COLLECTION_LIMIT            Number of items in the embedded collection of a result to be iterated. Valid values are: 1-100.\n"
       + "5. APP_QUERY_RESULTS_DISPLAY_MODE  How command results should be shown. Valid values are: table and catalog.\n"
-      + "6. APP_QUIET_EXECUTION.            Whether commands should be excuted in quiet mode. Valid values are: true and false.\n";
+      + "6. APP_QUIET_EXECUTION.            Whether commands should be executed in quiet mode. Valid values are: true and false.\n";
 
   /* 'sh' command */
   public static final String SH = "sh";
@@ -2593,11 +2593,11 @@ public class CliStrings {
 
   public static final String START_SERVER__MAX__CONNECTIONS = "max-connections";
   public static final String START_SERVER__MAX__CONNECTIONS__HELP =
-      "Sets the maxium number of client connections allowed. When the maximum is reached the cache server will stop accepting connections";
+      "Sets the maximum number of client connections allowed. When the maximum is reached the cache server will stop accepting connections";
 
   public static final String START_SERVER__MAX__THREADS = "max-threads";
   public static final String START_SERVER__MAX__THREADS__HELP =
-      "Sets the maxium number of threads allowed in this cache server to service client requests. The default of 0 causes the cache server to dedicate a thread for every client connection";
+      "Sets the maximum number of threads allowed in this cache server to service client requests. The default of 0 causes the cache server to dedicate a thread for every client connection";
 
   public static final String START_SERVER__MAX__MESSAGE__COUNT = "max-message-count";
   public static final String START_SERVER__MAX__MESSAGE__COUNT__HELP =
@@ -2699,7 +2699,7 @@ public class CliStrings {
   public static final String STATUS_SERVER__PID__HELP =
       "Process ID (PID) of the running Geode Cache Server. Deprecated: Since Geode1.2. Requires the JDK tools.jar which is not included on the classpath by default. Use --dir instead.";
 
-  /* stop gateway-reciver */
+  /* stop gateway-receiver */
   public static final String STOP_GATEWAYRECEIVER = "stop gateway-receiver";
   public static final String STOP_GATEWAYRECEIVER__HELP =
       "Stop the Gateway Receiver on a member or members.";
@@ -2797,7 +2797,7 @@ public class CliStrings {
   public static final String UPGRADE_OFFLINE_DISK_STORE__UPGRADE_ATTEMPTED_BUT_NOTHING_TO_UPGRADE =
       "Upgradation was attempted but nothing to upgrade.";
   public static final String UPGRADE_OFFLINE_DISK_STORE__ERROR_WHILE_UPGRADATION_REASON_0 =
-      "Error occurred while perfoming disk store upgrade. Reason: \"{0}\"";
+      "Error occurred while performing disk store upgrade. Reason: \"{0}\"";
   public static final String UPGRADE_OFFLINE_DISK_STORE__MSG__CANNOT_LOCATE_0_DISKSTORE_IN_1 =
       "Cannot locate disk store \"{0}\" in directory : \"{1}\"";
   public static final String UPGRADE_OFFLINE_DISK_STORE__MSG__DISKSTORE_IN_USE_COMPACT_DISKSTORE_CAN_BE_USED =
@@ -2914,7 +2914,7 @@ public class CliStrings {
   public static final String GATEWAY_RECEIVER_IS_NOT_RUNNING_ON_MEMBER_0 =
       "GatewayReceiver is not running on member {0}";
   public static final String GATEWAYS_ARE_NOT_AVAILABLE_IN_CLUSTER =
-      "GatewaySenders or GatewayRecievers are not available in cluster";
+      "GatewaySenders or GatewayReceivers are not available in cluster";
   public static final String GATEWAY_SENDER_0_COULD_NOT_BE_INVOKED_DUE_TO_1 =
       "Could not invoke start gateway sender {0} operation on members due to {1}";
   public static final String GATEWAY_SENDER_0_COULD_NOT_BE_STARTED_ON_MEMBER_DUE_TO_1 =
@@ -3010,9 +3010,9 @@ public class CliStrings {
   public static final String COUNT_DURABLE_CQ_EVENTS__NO__CQS__REGISTERED =
       "No cq's registered on this member";
   public static final String COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CQ =
-      "subcription-queue-size for durable-cq : \"{0}\".";
+      "subscription-queue-size for durable-cq : \"{0}\".";
   public static final String COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT =
-      "subcription-queue-size for durable-client : \"{0}\".";
+      "subscription-queue-size for durable-client : \"{0}\".";
 
   /***
    * Cluster Configuration commands
@@ -3180,6 +3180,6 @@ public class CliStrings {
   }
 
 
-  public static final String IGNORE_INTERCEPTORS = "ignoreInterCeptors";
+  public static final String IGNORE_INTERCEPTORS = "ignoreInterceptors";
 
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java
index e9c2736..2464b00 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java
@@ -14,6 +14,14 @@
  */
 package org.apache.geode.management.internal.cli.remote;
 
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Properties;
+
+import org.springframework.shell.core.Parser;
+import org.springframework.shell.event.ParseResult;
+
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.internal.security.SecurityServiceFactory;
 import org.apache.geode.management.cli.CommandProcessingException;
@@ -27,13 +35,6 @@ import org.apache.geode.management.internal.cli.util.CommentSkipHelper;
 import org.apache.geode.management.internal.security.ResourceOperation;
 import org.apache.geode.security.NotAuthorizedException;
 import org.apache.geode.security.ResourcePermission;
-import org.springframework.shell.core.Parser;
-import org.springframework.shell.event.ParseResult;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Properties;
 
 /**
  * @since GemFire 7.0
@@ -85,7 +86,7 @@ public class CommandProcessor {
   }
 
   public Result executeCommand(CommandStatement cmdStmt) {
-    Object result = null;
+    Object result;
     Result commandResult = null;
 
     CommentSkipHelper commentSkipper = new CommentSkipHelper();

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/main/java/org/apache/geode/management/internal/security/MBeanServerWrapper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/security/MBeanServerWrapper.java b/geode-core/src/main/java/org/apache/geode/management/internal/security/MBeanServerWrapper.java
index 47260bc..7c3ecb8 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/security/MBeanServerWrapper.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/security/MBeanServerWrapper.java
@@ -14,17 +14,9 @@
  */
 package org.apache.geode.management.internal.security;
 
-import org.apache.commons.lang.StringUtils;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.management.internal.ManagementConstants;
-import org.apache.geode.security.GemFireSecurityException;
-import org.apache.geode.security.ResourcePermission;
-import org.apache.geode.security.ResourcePermission.Resource;
-import org.apache.geode.security.ResourcePermission.Operation;
-import org.apache.geode.security.ResourcePermission.Target;
-
 import java.io.ObjectInputStream;
 import java.util.Set;
+
 import javax.management.Attribute;
 import javax.management.AttributeList;
 import javax.management.AttributeNotFoundException;
@@ -51,6 +43,16 @@ import javax.management.ReflectionException;
 import javax.management.loading.ClassLoaderRepository;
 import javax.management.remote.MBeanServerForwarder;
 
+import org.apache.commons.lang.StringUtils;
+
+import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.management.internal.ManagementConstants;
+import org.apache.geode.security.GemFireSecurityException;
+import org.apache.geode.security.ResourcePermission;
+import org.apache.geode.security.ResourcePermission.Operation;
+import org.apache.geode.security.ResourcePermission.Resource;
+import org.apache.geode.security.ResourcePermission.Target;
+
 /**
  * This class intercepts all MBean requests for GemFire MBeans and passed it to
  * ManagementInterceptor for authorization
@@ -217,15 +219,13 @@ public class MBeanServerWrapper implements MBeanServerForwarder {
     ResourcePermission ctx = getOperationContext(name, operationName, true);
     this.securityService.authorize(ctx);
 
-    Object result = mbs.invoke(name, operationName, params, signature);
-
-    return result;
+    return mbs.invoke(name, operationName, params, signature);
   }
 
   // TODO: cache this
   private ResourcePermission getOperationContext(ObjectName objectName, String featureName,
       boolean isOp) throws InstanceNotFoundException, ReflectionException {
-    MBeanInfo beanInfo = null;
+    MBeanInfo beanInfo;
     try {
       beanInfo = mbs.getMBeanInfo(objectName);
     } catch (IntrospectionException e) {
@@ -238,7 +238,7 @@ public class MBeanServerWrapper implements MBeanServerForwarder {
     // find the context in the beanInfo if defined in the class level
     result = getOperationContext(beanInfo.getDescriptor(), result);
 
-    MBeanFeatureInfo[] featureInfos = null;
+    MBeanFeatureInfo[] featureInfos;
     if (isOp) {
       featureInfos = beanInfo.getOperations();
     } else {
@@ -262,8 +262,7 @@ public class MBeanServerWrapper implements MBeanServerForwarder {
     String targetCode = (String) descriptor.getFieldValue("target");
     if (resource != null && operationCode != null) {
       if (StringUtils.isBlank(targetCode)) {
-        return new ResourcePermission(Resource.valueOf(resource), Operation.valueOf(operationCode),
-            targetCode);
+        return new ResourcePermission(Resource.valueOf(resource), Operation.valueOf(operationCode));
       } else {
         return new ResourcePermission(Resource.valueOf(resource), Operation.valueOf(operationCode),
             Target.valueOf(targetCode).getName());
@@ -358,21 +357,20 @@ public class MBeanServerWrapper implements MBeanServerForwarder {
 
   @SuppressWarnings("deprecation")
   @Override
-  public ObjectInputStream deserialize(ObjectName name, byte[] data)
-      throws InstanceNotFoundException, OperationsException {
+  public ObjectInputStream deserialize(ObjectName name, byte[] data) throws OperationsException {
     return mbs.deserialize(name, data);
   }
 
   @Override
   public ObjectInputStream deserialize(String className, byte[] data)
       throws OperationsException, ReflectionException {
-    return deserialize(className, data);
+    return mbs.deserialize(className, data);
   }
 
   @SuppressWarnings("deprecation")
   @Override
   public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data)
-      throws InstanceNotFoundException, OperationsException, ReflectionException {
+      throws OperationsException, ReflectionException {
     return mbs.deserialize(className, loaderName, data);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/test/java/org/apache/geode/management/MemberMBeanAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/MemberMBeanAttributesDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/MemberMBeanAttributesDUnitTest.java
index 94b049e..97f766e 100644
--- a/geode-core/src/test/java/org/apache/geode/management/MemberMBeanAttributesDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/MemberMBeanAttributesDUnitTest.java
@@ -14,18 +14,15 @@
  */
 package org.apache.geode.management;
 
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.lang.management.ManagementFactory;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.RegionShortcut;
@@ -37,6 +34,8 @@ import org.apache.geode.internal.process.ProcessUtils;
 import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.categories.FlakyTest;
 
 /**
  * This test class checks around 89 attributes of Member MBeans
@@ -81,8 +80,8 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   @Test
   public void testReplRegionAttributes() throws Exception {
     initManagement(false);
-    setupForReplicateRegonAttributes(managedNodeList.get(0), 1);
-    setupForReplicateRegonAttributes(managedNodeList.get(1), 201);
+    setupForReplicateRegionAttributes(managedNodeList.get(0), 1);
+    setupForReplicateRegionAttributes(managedNodeList.get(1), 201);
     sample(managedNodeList.get(1));// Sample now
     isReplicatedRegionAttrsOK(managedNodeList.get(1));
 
@@ -92,7 +91,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   @Test
   public void testPRRegionAttributes() throws Exception {
     initManagement(false);
-    setupForPartitionedRegonAttributes(managedNodeList.get(0), 1);
+    setupForPartitionedRegionAttributes(managedNodeList.get(0), 1);
     sample(managedNodeList.get(0));// Sample now
     isPartitionedRegionAttrsOK(managedNodeList.get(0));
 
@@ -112,7 +111,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   }
 
 
-  public void setupForReplicateRegonAttributes(VM vm1, final int offset) throws Exception {
+  public void setupForReplicateRegionAttributes(VM vm1, final int offset) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
@@ -144,7 +143,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
 
   }
 
-  public void setupForPartitionedRegonAttributes(VM vm1, final int offset) throws Exception {
+  public void setupForPartitionedRegionAttributes(VM vm1, final int offset) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
@@ -177,7 +176,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
   @SuppressWarnings("serial")
-  public void isPartitionedRegionAttrsOK(VM vm1) throws Exception {
+  public void isPartitionedRegionAttrsOK(VM vm1) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         MemberMXBean bean = managementService.getMemberMXBean();
@@ -197,7 +196,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
   @SuppressWarnings("serial")
-  public void isReplicatedRegionAttrsOK(VM vm1) throws Exception {
+  public void isReplicatedRegionAttrsOK(VM vm1) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         MemberMXBean bean = managementService.getMemberMXBean();
@@ -220,7 +219,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
   @SuppressWarnings("serial")
-  public void isOSRelatedAttrsOK(VM vm1) throws Exception {
+  public void isOSRelatedAttrsOK(VM vm1) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         MemberMXBean bean = managementService.getMemberMXBean();
@@ -259,7 +258,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   }
 
   @SuppressWarnings("serial")
-  public void isConfigRelatedAttrsOK(VM vm1) throws Exception {
+  public void isConfigRelatedAttrsOK(VM vm1) {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
         MemberMXBean bean = managementService.getMemberMXBean();

http://git-wip-us.apache.org/repos/asf/geode/blob/451d12e8/geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java
index 4a6d16a..e430b49 100644
--- a/geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java
@@ -30,12 +30,12 @@ import org.apache.geode.distributed.internal.DistributionStats;
 import org.apache.geode.distributed.internal.locks.DLockStats;
 import org.apache.geode.internal.NanoTimer;
 import org.apache.geode.internal.OSProcess;
-import org.apache.geode.internal.statistics.VMStatsContract;
 import org.apache.geode.internal.cache.CachePerfStats;
 import org.apache.geode.internal.cache.DiskStoreStats;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.PartitionedRegionStats;
 import org.apache.geode.internal.cache.execute.FunctionServiceStats;
+import org.apache.geode.internal.statistics.VMStatsContract;
 import org.apache.geode.internal.stats50.VMStats50;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.internal.beans.MemberMBeanBridge;
@@ -165,7 +165,7 @@ public class MemberLevelStatsJUnitTest extends MBeanStatsTestCase {
 
     sample();
 
-    assertEquals(1, getInitialImagesInProgres());
+    assertEquals(1, getInitialImagesInProgress());
     cachePerfStats.endGetInitialImage(startGIITime);
     cachePerfStats.endCacheListenerCall(startCacheListenerTime);
     cachePerfStats.endCacheWriterCall(startCacheWriterTime);
@@ -389,8 +389,8 @@ public class MemberLevelStatsJUnitTest extends MBeanStatsTestCase {
     return bridge.getInitialImageTime();
   }
 
-  private int getInitialImagesInProgres() {
-    return bridge.getInitialImagesInProgres();
+  private int getInitialImagesInProgress() {
+    return bridge.getInitialImagesInProgress();
   }
 
   private float getBytesReceivedRate() {


Mime
View raw message