geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [05/20] incubator-geode git commit: GEODE-907: Converted core functionality to use jackson
Date Wed, 24 Feb 2016 22:07:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterRegionsService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterRegionsService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterRegionsService.java
index 5d47d3f..ff94b20 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterRegionsService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterRegionsService.java
@@ -19,30 +19,26 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.controllers.PulseController;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.PulseConstants;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
-import com.vmware.gemfire.tools.pulse.internal.controllers.PulseController;
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.PulseConstants;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
-
 /**
  * Class ClusterRegionsService
  * 
@@ -57,43 +53,36 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class ClusterRegionsService implements PulseService {
 
+  private final ObjectMapper mapper = new ObjectMapper();
+
   // String constants used for forming a json response
   private final String ENTRY_SIZE = "entrySize";
 
   // Comparator based upon regions entry count
-  private static Comparator<Cluster.Region> regionEntryCountComparator = new Comparator<Cluster.Region>() {
-    @Override
-    public int compare(Cluster.Region r1, Cluster.Region r2) {
-      long r1Cnt = r1.getSystemRegionEntryCount();
-      long r2Cnt = r2.getSystemRegionEntryCount();
-      if (r1Cnt < r2Cnt) {
-        return -1;
-      } else if (r1Cnt > r2Cnt) {
-        return 1;
-      } else {
-        return 0;
-      }
+  private static Comparator<Cluster.Region> regionEntryCountComparator = (r1, r2) -> {
+    long r1Cnt = r1.getSystemRegionEntryCount();
+    long r2Cnt = r2.getSystemRegionEntryCount();
+    if (r1Cnt < r2Cnt) {
+      return -1;
+    } else if (r1Cnt > r2Cnt) {
+      return 1;
+    } else {
+      return 0;
     }
   };
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
-
-    String userName = request.getUserPrincipal().getName();
-
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-      // getting cluster's Regions
-      responseJSON.put("regions", getRegionJson(cluster));
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
-    }
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    // getting cluster's Regions
+    responseJSON.put("regions", getRegionJson(cluster));
+
+    // Send json response
+    return responseJSON;
   }
 
   /**
@@ -104,7 +93,7 @@ public class ClusterRegionsService implements PulseService {
    * @param cluster
    * @return JSONObject Array List
    */
-  private List<JSONObject> getRegionJson(Cluster cluster) throws JSONException {
+  private ArrayNode getRegionJson(Cluster cluster) {
 
     Long totalHeapSize = cluster.getTotalHeapSize();
     Long totalDiskUsage = cluster.getTotalBytesOnDisk();
@@ -116,10 +105,10 @@ public class ClusterRegionsService implements PulseService {
 
     Collections.sort(clusterRegionsList, regionEntryCountComparator);
 
-    List<JSONObject> regionListJson = new ArrayList<JSONObject>();
+    ArrayNode regionListJson = mapper.createArrayNode();
     for (int count = 0; count < clusterRegionsList.size(); count++) {
       Cluster.Region reg = clusterRegionsList.get(count);
-      JSONObject regionJSON = new JSONObject();
+      ObjectNode regionJSON = mapper.createObjectNode();
 
       regionJSON.put("name", reg.getName());
       regionJSON.put("totalMemory", totalHeapSize);
@@ -133,7 +122,7 @@ public class ClusterRegionsService implements PulseService {
 
       Cluster.Member[] clusterMembersList = cluster.getMembers();
 
-      JSONArray memberNameArray = new JSONArray();
+      ArrayNode memberNameArray = mapper.createArrayNode();
       for (String memberName : reg.getMemberName()) {
         for (Cluster.Member member : clusterMembersList) {
           String name = member.getName();
@@ -142,10 +131,10 @@ public class ClusterRegionsService implements PulseService {
           id = id.replace(":", "-");
 
           if ((memberName.equals(id)) || (memberName.equals(name))) {
-            JSONObject regionMember = new JSONObject();
+            ObjectNode regionMember = mapper.createObjectNode();
             regionMember.put("id", member.getId());
             regionMember.put("name", member.getName());
-            memberNameArray.put(regionMember);
+            memberNameArray.add(regionMember);
             break;
           }
         }
@@ -186,8 +175,7 @@ public class ClusterRegionsService implements PulseService {
         regionJSON.put("compressionCodec", this.VALUE_NA);
       }
 
-      if (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController
-          .getPulseProductSupport())) {
+      if (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController.getPulseProductSupport())) {
         // Convert region path to dot separated region path
         regionJSON.put("regionPath",
             StringUtils.getTableNameFromRegionName(reg.getFullPath()));
@@ -198,30 +186,17 @@ public class ClusterRegionsService implements PulseService {
         regionJSON.put("id", reg.getFullPath());
       }
 
-      regionJSON
-          .put(
-              "memoryReadsTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "memoryWritesTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "diskReadsTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "diskWritesTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
+      regionJSON.put("memoryReadsTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
+      regionJSON.put("memoryWritesTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
+      regionJSON.put("diskReadsTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
+      regionJSON.put("diskWritesTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
       regionJSON.put("emptyNodes", reg.getEmptyNode());
       Long entrySize = reg.getEntrySize();
-      DecimalFormat form = new DecimalFormat(
-          PulseConstants.DECIMAL_FORMAT_PATTERN_2);
+      DecimalFormat form = new DecimalFormat(PulseConstants.DECIMAL_FORMAT_PATTERN_2);
       String entrySizeInMB = form.format(entrySize / (1024f * 1024f));
 
       if (entrySize < 0) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
index f19e78b..5c4fa0c 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
@@ -19,28 +19,27 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.controllers.PulseController;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.PulseConstants;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.log.PulseLogWriter;
 import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import com.vmware.gemfire.tools.pulse.internal.util.TimeUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 
 /**
  * Class ClusterSelectedRegionService
@@ -56,65 +55,61 @@ import com.vmware.gemfire.tools.pulse.internal.util.TimeUtils;
 @Scope("singleton")
 public class ClusterSelectedRegionService implements PulseService {
 
+  private final ObjectMapper mapper = new ObjectMapper();
+
   // String constants used for forming a json response
   private final String ENTRY_SIZE = "entrySize";
 
   // Comparator based upon regions entry count
-  private static Comparator<Cluster.Member> memberCurrentHeapUsageComparator = new Comparator<Cluster.Member>() {
-    @Override
-    public int compare(Cluster.Member m1, Cluster.Member m2) {
-      long m1HeapUsage = m1.getCurrentHeapSize();
-      long m2HeapUsage = m2.getCurrentHeapSize();
-      if (m1HeapUsage < m2HeapUsage) {
-        return -1;
-      } else if (m1HeapUsage > m2HeapUsage) {
-        return 1;
-      } else {
-        return 0;
-      }
+  private static Comparator<Cluster.Member> memberCurrentHeapUsageComparator = (m1, m2) -> {
+    long m1HeapUsage = m1.getCurrentHeapSize();
+    long m2HeapUsage = m2.getCurrentHeapSize();
+    if (m1HeapUsage < m2HeapUsage) {
+      return -1;
+    } else if (m1HeapUsage > m2HeapUsage) {
+      return 1;
+    } else {
+      return 0;
     }
   };
 
   @Override
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     String userName = request.getUserPrincipal().getName();
     String pulseData = request.getParameter("pulseData");
-    JSONObject parameterMap = new JSONObject(pulseData);
-    String selectedRegionFullPath = parameterMap.getJSONObject("ClusterSelectedRegion").getString("regionFullPath");
+    JsonNode parameterMap = mapper.readTree(pulseData);
+    String selectedRegionFullPath = parameterMap.get("ClusterSelectedRegion").get("regionFullPath").textValue();
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-      // getting cluster's Regions
-      responseJSON.put("clusterName", cluster.getServerName());
-      responseJSON.put("userName", userName);
-      responseJSON.put("selectedRegion", getSelectedRegionJson(cluster, selectedRegionFullPath));
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
-    }
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    // getting cluster's Regions
+    responseJSON.put("clusterName", cluster.getServerName());
+    responseJSON.put("userName", userName);
+    responseJSON.put("selectedRegion", getSelectedRegionJson(cluster, selectedRegionFullPath));
+
+    // Send json response
+    return responseJSON;
   }
 
   /**
    * Create JSON for selected cluster region
    *
    * @param cluster
-   * @return JSONObject Array List
+   * @return ObjectNode Array List
    */
-  private JSONObject getSelectedRegionJson(Cluster cluster, String selectedRegionFullPath) throws JSONException {
+  private ObjectNode getSelectedRegionJson(Cluster cluster, String selectedRegionFullPath) {
     PulseLogWriter LOGGER = PulseLogWriter.getLogger();
     Long totalHeapSize = cluster.getTotalHeapSize();
     Long totalDiskUsage = cluster.getTotalBytesOnDisk();
 
     Cluster.Region reg = cluster.getClusterRegion(selectedRegionFullPath);
-    if(reg != null){
-      JSONObject regionJSON = new JSONObject();
+    if (reg != null){
+      ObjectNode regionJSON = mapper.createObjectNode();
 
       regionJSON.put("name", reg.getName());
       regionJSON.put("path", reg.getFullPath());
@@ -128,8 +123,7 @@ public class ClusterSelectedRegionService implements PulseService {
       regionJSON.put("putsRate", reg.getPutsRate());
       regionJSON.put("lruEvictionRate", reg.getLruEvictionRate());
 
-      DecimalFormat df2 = new DecimalFormat(
-          PulseConstants.DECIMAL_FORMAT_PATTERN);
+      DecimalFormat df2 = new DecimalFormat(PulseConstants.DECIMAL_FORMAT_PATTERN);
       Cluster.Member[] clusterMembersList = cluster.getMembers();
 
       // collect members of this region
@@ -149,11 +143,11 @@ public class ClusterSelectedRegionService implements PulseService {
 
       // sort members of this region
       Collections.sort(clusterMembersL, memberCurrentHeapUsageComparator);
+
       // return sorted member list by heap usage
-      JSONArray memberArray = new JSONArray();
+      ArrayNode memberArray = mapper.createArrayNode();
       for (Cluster.Member member : clusterMembersL) {
-
-          JSONObject regionMember = new JSONObject();
+          ObjectNode regionMember = mapper.createObjectNode();
           regionMember.put("memberId", member.getId());
           regionMember.put("name", member.getName());
           regionMember.put("host", member.getHost());
@@ -184,33 +178,18 @@ public class ClusterSelectedRegionService implements PulseService {
             regionMember.put("clients", member.getMemberClientsHMap().size());
           }
           regionMember.put("queues", member.getQueueBacklog());
-          memberArray.put(regionMember);
+          memberArray.add(regionMember);
       }
 
       regionJSON.put("members", memberArray);
       regionJSON.put("entryCount", reg.getSystemRegionEntryCount());
 
-      Boolean persistent = reg.getPersistentEnabled();
-      if (persistent) {
-        regionJSON.put("persistence", PulseService.VALUE_ON);
-      } else {
-        regionJSON.put("persistence", PulseService.VALUE_OFF);
-      }
+      regionJSON.put("persistence", reg.getPersistentEnabled() ? PulseService.VALUE_ON : PulseService.VALUE_OFF);
 
-      Boolean isEnableOffHeapMemory = reg.isEnableOffHeapMemory();
-      if (isEnableOffHeapMemory) {
-        regionJSON.put("isEnableOffHeapMemory", PulseService.VALUE_ON);
-      } else {
-        regionJSON.put("isEnableOffHeapMemory", PulseService.VALUE_OFF);
-      }
+      regionJSON.put("isEnableOffHeapMemory", reg.isEnableOffHeapMemory() ? PulseService.VALUE_ON : PulseService.VALUE_OFF);
 
-      Boolean isHDFSWriteOnly = reg.isHdfsWriteOnly();
       if (regionType.startsWith("HDFS")) {
-        if (isHDFSWriteOnly) {
-          regionJSON.put("isHDFSWriteOnly", PulseService.VALUE_ON);
-        } else {
-          regionJSON.put("isHDFSWriteOnly", PulseService.VALUE_OFF);
-        }
+        regionJSON.put("isHDFSWriteOnly", reg.isHdfsWriteOnly() ? PulseService.VALUE_ON : PulseService.VALUE_OFF);
       } else {
         regionJSON.put("isHDFSWriteOnly", PulseService.VALUE_NA);
       }
@@ -222,35 +201,22 @@ public class ClusterSelectedRegionService implements PulseService {
         regionJSON.put("compressionCodec", PulseService.VALUE_NA);
       }
 
-      if (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController
-          .getPulseProductSupport())) {
+      if (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController.getPulseProductSupport())) {
         // Convert region path to dot separated region path
-        regionJSON.put("regionPath",
-            StringUtils.getTableNameFromRegionName(reg.getFullPath()));
+        regionJSON.put("regionPath", StringUtils.getTableNameFromRegionName(reg.getFullPath()));
       } else {
         regionJSON.put("regionPath", reg.getFullPath());
       }
 
-      regionJSON
-          .put(
-              "memoryReadsTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "memoryWritesTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "diskReadsTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
-      regionJSON
-          .put(
-              "diskWritesTrend",
-              new JSONArray(
-                  reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
+      regionJSON.put("memoryReadsTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
+      regionJSON.put("memoryWritesTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
+      regionJSON.put("diskReadsTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
+      regionJSON.put("diskWritesTrend",
+          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
+
       regionJSON.put("emptyNodes", reg.getEmptyNode());
       Long entrySize = reg.getEntrySize();
       DecimalFormat form = new DecimalFormat(
@@ -269,9 +235,8 @@ public class ClusterSelectedRegionService implements PulseService {
       LOGGER.fine("calling getSelectedRegionJson :: regionJSON = " + regionJSON);
       return regionJSON;
     } else {
-      JSONObject responseJSON = new JSONObject();
-      responseJSON.put("errorOnRegion", "Region [" + selectedRegionFullPath
-          + "] is not available");
+      ObjectNode responseJSON = mapper.createObjectNode();
+      responseJSON.put("errorOnRegion", "Region [" + selectedRegionFullPath + "] is not available");
       return responseJSON;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
index f4430d5..ecdd14e 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
@@ -19,24 +19,22 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster.RegionOnMember;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.log.PulseLogWriter;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 
 /**
  * Class ClusterSelectedRegionsMemberService
@@ -53,57 +51,53 @@ import com.vmware.gemfire.tools.pulse.internal.log.PulseLogWriter;
 @Scope("singleton")
 public class ClusterSelectedRegionsMemberService implements PulseService {
 
+  private final ObjectMapper mapper = new ObjectMapper();
+
   //Comparator based upon regions entry count
-  private static Comparator<Cluster.RegionOnMember> romEntryCountComparator = new Comparator<Cluster.RegionOnMember>() {
-   @Override
-     public int compare(Cluster.RegionOnMember m1, Cluster.RegionOnMember m2) {
-       long m1EntryCount = m1.getEntryCount();
-       long m2EntryCount = m2.getEntryCount();
-       if (m1EntryCount < m2EntryCount) {
-         return -1;
-       } else if (m1EntryCount > m2EntryCount) {
-         return 1;
-       } else {
-         return 0;
-       }
-     }
-  };
+  private static Comparator<Cluster.RegionOnMember> romEntryCountComparator = (m1, m2) -> {
+      long m1EntryCount = m1.getEntryCount();
+      long m2EntryCount = m2.getEntryCount();
+      if (m1EntryCount < m2EntryCount) {
+        return -1;
+      } else if (m1EntryCount > m2EntryCount) {
+        return 1;
+      } else {
+        return 0;
+      }
+    };
 
   @Override
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
     PulseLogWriter LOGGER = PulseLogWriter.getLogger();
     String userName = request.getUserPrincipal().getName();
     String pulseData = request.getParameter("pulseData");
-    JSONObject parameterMap = new JSONObject(pulseData);
-    String selectedRegionFullPath = parameterMap.getJSONObject("ClusterSelectedRegionsMember").getString("regionFullPath");
+    JsonNode parameterMap = mapper.readTree(pulseData);
+    String selectedRegionFullPath = parameterMap.get("ClusterSelectedRegionsMember").get("regionFullPath").textValue();
     LOGGER.finest("ClusterSelectedRegionsMemberService selectedRegionFullPath = " + selectedRegionFullPath);
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-      // getting cluster's Regions
-      responseJSON.put("clusterName", cluster.getServerName());
-      responseJSON.put("userName", userName);
-      responseJSON.put("selectedRegionsMembers", getSelectedRegionsMembersJson(cluster, selectedRegionFullPath));
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
-    }
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    // getting cluster's Regions
+    responseJSON.put("clusterName", cluster.getServerName());
+    responseJSON.put("userName", userName);
+    responseJSON.put("selectedRegionsMembers", getSelectedRegionsMembersJson(cluster, selectedRegionFullPath));
+    // Send json response
+    return responseJSON;
   }
 
   /**
    * Create JSON for selected cluster region's all members
    */
-  private JSONObject getSelectedRegionsMembersJson(Cluster cluster, String selectedRegionFullPath) throws JSONException {
+  private ObjectNode getSelectedRegionsMembersJson(Cluster cluster, String selectedRegionFullPath) {
     PulseLogWriter LOGGER = PulseLogWriter.getLogger();
     Cluster.Region reg = cluster.getClusterRegion(selectedRegionFullPath);
-    if(reg != null){
-      JSONObject regionMemberJSON = new JSONObject();
+
+    if (reg != null){
+      ObjectNode regionMemberJSON = mapper.createObjectNode();
       RegionOnMember[] regionOnMembers = reg.getRegionOnMembers();
 
       //sort on entry count
@@ -111,35 +105,39 @@ public class ClusterSelectedRegionsMemberService implements PulseService {
       Collections.sort(romList, romEntryCountComparator);
 
       for(RegionOnMember rom : romList) {
-
-        JSONObject memberJSON = new JSONObject();
+        ObjectNode memberJSON = mapper.createObjectNode();
         memberJSON.put("memberName", rom.getMemberName());
         memberJSON.put("regionFullPath", rom.getRegionFullPath());
         memberJSON.put("entryCount", rom.getEntryCount());
         memberJSON.put("entrySize", rom.getEntrySize());
+
         memberJSON.put("accessor", ((rom.getLocalMaxMemory() == 0) ? "True" : "False"));
         LOGGER.finest("calling getSelectedRegionsMembersJson :: rom.getLocalMaxMemory() = " + rom.getLocalMaxMemory());
-        memberJSON.put(
-            "memoryReadsTrend", new JSONArray(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND)));
+
+        memberJSON.put("memoryReadsTrend",
+            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND)));
         LOGGER.finest("memoryReadsTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND).length);
-        memberJSON.put(
-            "memoryWritesTrend", new JSONArray(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND)));
+
+        memberJSON.put("memoryWritesTrend",
+            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND)));
         LOGGER.finest("memoryWritesTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND).length);
-        memberJSON.put(
-            "diskReadsTrend", new JSONArray(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND)));
+
+        memberJSON.put("diskReadsTrend",
+            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND)));
         LOGGER.finest("diskReadsTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND).length);
-        memberJSON.put(
-            "diskWritesTrend", new JSONArray(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND)));
+
+        memberJSON.put("diskWritesTrend",
+            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND)));
         LOGGER.finest("diskWritesTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND).length);
+
         regionMemberJSON.put(rom.getMemberName(), memberJSON);
       }
 
       LOGGER.fine("calling getSelectedRegionsMembersJson :: regionJSON = " + regionMemberJSON);
       return regionMemberJSON;
     } else {
-      JSONObject responseJSON = new JSONObject();
-      responseJSON.put("errorOnRegion", "Region [" + selectedRegionFullPath
-          + "] is not available");
+      ObjectNode responseJSON = mapper.createObjectNode();
+      responseJSON.put("errorOnRegion", "Region [" + selectedRegionFullPath + "] is not available");
       return responseJSON;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterWANInfoService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterWANInfoService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterWANInfoService.java
index 57172bd..21d93a7 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterWANInfoService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterWANInfoService.java
@@ -19,19 +19,17 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
 
 /**
  * Class ClusterWANInfoService
@@ -47,36 +45,32 @@ import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 @Scope("singleton")
 public class ClusterWANInfoService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
+    ObjectNode responseJSON = mapper.createObjectNode();
 
     // members list
-    // ArrayList<Cluster> connectedClusters = cluster.getConnectedClusterList();
-    JSONArray connectedClusterListJson = new JSONArray();
-
-    try {
+    ArrayNode connectedClusterListJson = mapper.createArrayNode();
 
-      for (Map.Entry<String, Boolean> entry : cluster.getWanInformation()
-          .entrySet()) {
-        JSONObject clusterJSON = new JSONObject();
-        clusterJSON.put("clusterId", entry.getKey());
-        clusterJSON.put("name", entry.getKey());
-        clusterJSON.put("status", entry.getValue());
+    for (Map.Entry<String, Boolean> entry : cluster.getWanInformation()
+        .entrySet()) {
+      ObjectNode clusterJSON = mapper.createObjectNode();
+      clusterJSON.put("clusterId", entry.getKey());
+      clusterJSON.put("name", entry.getKey());
+      clusterJSON.put("status", entry.getValue());
 
-        connectedClusterListJson.put(clusterJSON);
-      }
-      // Response JSON
-      responseJSON.put("connectedClusters", connectedClusterListJson);
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+      connectedClusterListJson.add(clusterJSON);
     }
+    // Response JSON
+    responseJSON.put("connectedClusters", connectedClusterListJson);
+    // Send json response
+    return responseJSON;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberAsynchEventQueuesService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberAsynchEventQueuesService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberAsynchEventQueuesService.java
index 70be387..190fc6d 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberAsynchEventQueuesService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberAsynchEventQueuesService.java
@@ -19,18 +19,18 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import javax.servlet.http.HttpServletRequest;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberAsynchEventQueuesService
@@ -46,62 +46,55 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberAsynchEventQueuesService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject(
-          "MemberAsynchEventQueues").getString("memberName");
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-
-      if (clusterMember != null) {
-        // response
-        Cluster.AsyncEventQueue[] asyncEventQueues = clusterMember
-            .getMemberAsyncEventQueueList();
-        JSONArray asyncEventQueueJsonList = new JSONArray();
-
-        if (asyncEventQueues != null && asyncEventQueues.length > 0) {
-
-          responseJSON.put("isAsyncEventQueuesPresent", true);
-
-          for (Cluster.AsyncEventQueue asyncEventQueue : asyncEventQueues) {
-            JSONObject asyncEventQueueJSON = new JSONObject();
-            asyncEventQueueJSON.put("id", asyncEventQueue.getId());
-            asyncEventQueueJSON.put("primary", asyncEventQueue.getPrimary());
-            asyncEventQueueJSON.put("senderType", asyncEventQueue.isParallel());
-            asyncEventQueueJSON
-                .put("batchSize", asyncEventQueue.getBatchSize());
-            asyncEventQueueJSON.put("batchTimeInterval",
-                asyncEventQueue.getBatchTimeInterval());
-            asyncEventQueueJSON.put("batchConflationEnabled",
-                asyncEventQueue.isBatchConflationEnabled());
-            asyncEventQueueJSON.put("asyncEventListener",
-                asyncEventQueue.getAsyncEventListener());
-            asyncEventQueueJSON.put("queueSize",
-                asyncEventQueue.getEventQueueSize());
-
-            asyncEventQueueJsonList.put(asyncEventQueueJSON);
-          }
-          responseJSON.put("asyncEventQueues", asyncEventQueueJsonList);
-        } else {
-          responseJSON.put("isAsyncEventQueuesPresent", false);
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberAsynchEventQueues").get("memberName").textValue();
+
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
+
+    if (clusterMember != null) {
+      // response
+      Cluster.AsyncEventQueue[] asyncEventQueues = clusterMember
+          .getMemberAsyncEventQueueList();
+      ArrayNode asyncEventQueueJsonList = mapper.createArrayNode();
+
+      if (asyncEventQueues != null && asyncEventQueues.length > 0) {
+        responseJSON.put("isAsyncEventQueuesPresent", true);
+
+        for (Cluster.AsyncEventQueue asyncEventQueue : asyncEventQueues) {
+          ObjectNode asyncEventQueueJSON = mapper.createObjectNode();
+          asyncEventQueueJSON.put("id", asyncEventQueue.getId());
+          asyncEventQueueJSON.put("primary", asyncEventQueue.getPrimary());
+          asyncEventQueueJSON.put("senderType", asyncEventQueue.isParallel());
+          asyncEventQueueJSON
+              .put("batchSize", asyncEventQueue.getBatchSize());
+          asyncEventQueueJSON.put("batchTimeInterval",
+              asyncEventQueue.getBatchTimeInterval());
+          asyncEventQueueJSON.put("batchConflationEnabled",
+              asyncEventQueue.isBatchConflationEnabled());
+          asyncEventQueueJSON.put("asyncEventListener",
+              asyncEventQueue.getAsyncEventListener());
+          asyncEventQueueJSON.put("queueSize",
+              asyncEventQueue.getEventQueueSize());
+
+          asyncEventQueueJsonList.add(asyncEventQueueJSON);
         }
-
+        responseJSON.put("asyncEventQueues", asyncEventQueueJsonList);
+      } else {
+        responseJSON.put("isAsyncEventQueuesPresent", false);
       }
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+
     }
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberClientsService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberClientsService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberClientsService.java
index cb4a9e0..a2b5819 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberClientsService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberClientsService.java
@@ -19,21 +19,19 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import java.util.Formatter;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import com.vmware.gemfire.tools.pulse.internal.util.TimeUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberClientsService
@@ -48,76 +46,57 @@ import com.vmware.gemfire.tools.pulse.internal.util.TimeUtils;
 @Scope("singleton")
 public class MemberClientsService implements PulseService {
 
+  private final ObjectMapper mapper = new ObjectMapper();
+
   // String constants used for forming a json response
   private final String NAME = "name";
   private final String HOST = "host";
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberClients")
-          .getString("memberName");
-
-      JSONArray clientListJson = new JSONArray();
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-      if (clusterMember != null) {
-        responseJSON.put("memberId", clusterMember.getId());
-        responseJSON.put(this.NAME, clusterMember.getName());
-        responseJSON.put(this.HOST, clusterMember.getHost());
-
-        // member's clients
-
-        Cluster.Client[] memberClients = clusterMember.getMemberClients();
-        for (Cluster.Client memberClient : memberClients) {
-          JSONObject regionJSON = new JSONObject();
-          regionJSON.put("clientId", memberClient.getId());
-          regionJSON.put(this.NAME, memberClient.getName());
-          regionJSON.put(this.HOST, memberClient.getHost());
-          regionJSON.put("queueSize", memberClient.getQueueSize());
-          regionJSON.put("clientCQCount", memberClient.getClientCQCount()); 
-          if(memberClient.isConnected()){
-            regionJSON.put("isConnected", "Yes");
-          }else{
-            regionJSON.put("isConnected", "No");
-          }
-          
-          if(memberClient.isSubscriptionEnabled()){ 
-            regionJSON.put("isSubscriptionEnabled", "Yes"); 
-          }else{ 
-            regionJSON.put("isSubscriptionEnabled", "No"); 
-          } 
-
-          regionJSON.put("uptime",
-              TimeUtils.convertTimeSecondsToHMS(memberClient.getUptime()));
-          Formatter fmt = new Formatter();
-          regionJSON.put("cpuUsage",
-              fmt.format("%.4f", memberClient.getCpuUsage()).toString());
-          // regionJSON.put("cpuUsage", memberClient.getCpuUsage());
-          regionJSON.put("threads", memberClient.getThreads());
-          regionJSON.put("gets", memberClient.getGets());
-          regionJSON.put("puts", memberClient.getPuts());
-
-          clientListJson.put(regionJSON);
-          fmt.close();
-
-        }
-        responseJSON.put("memberClients", clientListJson);
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberClients").get("memberName").textValue();
+
+    ArrayNode clientListJson = mapper.createArrayNode();
+
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
+    if (clusterMember != null) {
+      responseJSON.put("memberId", clusterMember.getId());
+      responseJSON.put(this.NAME, clusterMember.getName());
+      responseJSON.put(this.HOST, clusterMember.getHost());
+
+      // member's clients
+
+      Cluster.Client[] memberClients = clusterMember.getMemberClients();
+      for (Cluster.Client memberClient : memberClients) {
+        ObjectNode regionJSON = mapper.createObjectNode();
+        regionJSON.put("clientId", memberClient.getId());
+        regionJSON.put(this.NAME, memberClient.getName());
+        regionJSON.put(this.HOST, memberClient.getHost());
+        regionJSON.put("queueSize", memberClient.getQueueSize());
+        regionJSON.put("clientCQCount", memberClient.getClientCQCount());
+        regionJSON.put("isConnected", memberClient.isConnected() ? "Yes" : "No");
+        regionJSON.put("isSubscriptionEnabled", memberClient.isSubscriptionEnabled() ? "Yes" : "No");
+        regionJSON.put("uptime", TimeUtils.convertTimeSecondsToHMS(memberClient.getUptime()));
+
+        regionJSON.put("cpuUsage", String.format("%.4f", memberClient.getCpuUsage()).toString());
+        // regionJSON.put("cpuUsage", memberClient.getCpuUsage());
+        regionJSON.put("threads", memberClient.getThreads());
+        regionJSON.put("gets", memberClient.getGets());
+        regionJSON.put("puts", memberClient.getPuts());
+
+        clientListJson.add(regionJSON);
       }
-      // Send json response
-      return responseJSON;
-
-    } catch (JSONException e) {
-      throw new Exception(e);
+      responseJSON.put("memberClients", clientListJson);
     }
+    // Send json response
+    return responseJSON;
+
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDetailsService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDetailsService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDetailsService.java
index 7e55712..9a227a2 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDetailsService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDetailsService.java
@@ -19,12 +19,13 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.controllers.PulseController;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.PulseConstants;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
@@ -46,7 +47,9 @@ import java.text.DecimalFormat;
 @Scope("singleton")
 public class MemberDetailsService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     String userName = request.getUserPrincipal().getName();
 
@@ -54,75 +57,66 @@ public class MemberDetailsService implements PulseService {
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-    try {
-
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberDetails")
-          .getString("memberName");
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-      if (clusterMember != null) {
-        responseJSON.put("memberId", clusterMember.getId());
-        responseJSON.put("name", clusterMember.getName());
-        responseJSON.put("host", clusterMember.getHost());
-        responseJSON.put("hostnameForClients", clusterMember.getHostnameForClients());
-        responseJSON.put("clusterId", cluster.getId());
-        responseJSON.put("clusterName", cluster.getServerName());
-        responseJSON.put("userName", userName);
-        responseJSON.put("loadAverage", clusterMember.getLoadAverage());
-        responseJSON.put("sockets", clusterMember.getTotalFileDescriptorOpen());
-        responseJSON.put("threads", clusterMember.getNumThreads());
-        responseJSON.put("offHeapFreeSize", clusterMember.getOffHeapFreeSize());
-        responseJSON.put("offHeapUsedSize", clusterMember.getOffHeapUsedSize());
-        responseJSON.put("regionsCount", clusterMember.getMemberRegionsList().length);
-
-        // Number of member clients
-        if (PulseController.getPulseProductSupport().equalsIgnoreCase(
-            PulseConstants.PRODUCT_NAME_SQLFIRE)){
-          responseJSON.put("numClients", clusterMember.getNumSqlfireClients());
-        }else{
-          responseJSON.put("numClients", clusterMember.getMemberClientsHMap().size());
-        }
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberDetails").get("memberName").textValue();
+
+    Cluster.Member clusterMember = cluster.getMember(StringUtils
+        .makeCompliantName(memberName));
+    if (clusterMember != null) {
+      responseJSON.put("memberId", clusterMember.getId());
+      responseJSON.put("name", clusterMember.getName());
+      responseJSON.put("host", clusterMember.getHost());
+      responseJSON.put("clusterId", cluster.getId());
+      responseJSON.put("clusterName", cluster.getServerName());
+      responseJSON.put("userName", userName);
+      responseJSON.put("loadAverage", clusterMember.getLoadAverage());
+      responseJSON.put("sockets", clusterMember.getTotalFileDescriptorOpen());
+      responseJSON.put("threads", clusterMember.getNumThreads());
+      responseJSON.put("offHeapFreeSize", clusterMember.getOffHeapFreeSize());
+      responseJSON.put("offHeapUsedSize", clusterMember.getOffHeapUsedSize());
+      responseJSON.put("regionsCount", clusterMember.getMemberRegionsList().length);
+
+      // Number of member clients
+      if (PulseController.getPulseProductSupport().equalsIgnoreCase(
+          PulseConstants.PRODUCT_NAME_SQLFIRE)){
+        responseJSON.put("numClients", clusterMember.getNumSqlfireClients());
+      } else {
+        responseJSON.put("numClients", clusterMember.getMemberClientsHMap().size());
+      }
 
-        DecimalFormat df2 = new DecimalFormat(
-            PulseConstants.DECIMAL_FORMAT_PATTERN);
-        Long diskUsageVal = clusterMember.getTotalDiskUsage();
-        Double diskUsage = diskUsageVal.doubleValue() / 1024;
+      DecimalFormat df2 = new DecimalFormat(PulseConstants.DECIMAL_FORMAT_PATTERN);
+      Long diskUsageVal = clusterMember.getTotalDiskUsage();
+      Double diskUsage = diskUsageVal.doubleValue() / 1024;
 
-        responseJSON.put("diskStorageUsed",
-            Double.valueOf(df2.format(diskUsage)));
+      responseJSON.put("diskStorageUsed", Double.valueOf(df2.format(diskUsage)));
 
-        Cluster.Alert[] alertsList = cluster.getAlertsList();
+      Cluster.Alert[] alertsList = cluster.getAlertsList();
 
-        String status = "Normal";
+      String status = "Normal";
 
-        for (Cluster.Alert alert : alertsList) {
-          if (clusterMember.getName().equals(alert.getMemberName())) {
-            if (alert.getSeverity() == Cluster.Alert.SEVERE) {
-              status = "Severe";
-              break;
-            } else if (alert.getSeverity() == Cluster.Alert.ERROR) {
-              status = "Error";
-            } else if (alert.getSeverity() == Cluster.Alert.WARNING) {
-              status = "Warning";
-            }
+      for (Cluster.Alert alert : alertsList) {
+        if (clusterMember.getName().equals(alert.getMemberName())) {
+          if (alert.getSeverity() == Cluster.Alert.SEVERE) {
+            status = "Severe";
+            break;
+          } else if (alert.getSeverity() == Cluster.Alert.ERROR) {
+            status = "Error";
+          } else if (alert.getSeverity() == Cluster.Alert.WARNING) {
+            status = "Warning";
           }
         }
-
-        responseJSON.put("status", status);
-
-      } else {
-        responseJSON.put("errorOnMember", "Member [" + memberName
-            + "] is not available");
       }
 
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+      responseJSON.put("status", status);
+
+    } else {
+      responseJSON.put("errorOnMember", "Member [" + memberName
+          + "] is not available");
     }
+
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDiskThroughputService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDiskThroughputService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDiskThroughputService.java
index ce9fb59..f75479c 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDiskThroughputService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberDiskThroughputService.java
@@ -19,18 +19,18 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
 import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberDiskThroughputService
@@ -46,48 +46,33 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberDiskThroughputService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception, JSONException {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
+    ObjectNode responseJSON = mapper.createObjectNode();
 
     // members list
-    try {
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberDiskThroughput")
-          .getString("memberName");
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberDiskThroughput").get("memberName").textValue();
 
-      if (clusterMember != null) {
-        // response
-        responseJSON.put("throughputWrites",
-            clusterMember.getThroughputWrites());
-        responseJSON
-            .put(
-                "throughputWritesTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_THROUGHPUT_WRITES)));
-        responseJSON
-            .put("throughputReads", clusterMember.getThroughputWrites());
-        responseJSON
-            .put(
-                "throughputReadsTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_THROUGHPUT_READS)));
-      }
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
 
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+    if (clusterMember != null) {
+      // response
+      responseJSON.put("throughputWrites", clusterMember.getThroughputWrites());
+      responseJSON.put("throughputWritesTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_THROUGHPUT_WRITES)));
+      responseJSON.put("throughputReads", clusterMember.getThroughputWrites());
+      responseJSON.put("throughputReadsTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_THROUGHPUT_READS)));
     }
+
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGCPausesService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGCPausesService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGCPausesService.java
index adc01e1..77792d5 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGCPausesService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGCPausesService.java
@@ -19,18 +19,17 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import javax.servlet.http.HttpServletRequest;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberGCPausesService
@@ -47,39 +46,29 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberGCPausesService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
+    ObjectNode responseJSON = mapper.createObjectNode();
 
     // members list
-    try {
-
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberGCPauses")
-          .getString("memberName");
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-      if (clusterMember != null) {
-        // response
-        responseJSON
-            .put(
-                "gcPausesTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_GARBAGE_COLLECTION)));
-        responseJSON.put("gcPausesCount",
-            clusterMember.getGarbageCollectionCount());
-      }
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberGCPauses").get("memberName").textValue();
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
 
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+    if (clusterMember != null) {
+      // response
+      responseJSON.put("gcPausesTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_GARBAGE_COLLECTION)));
+      responseJSON.put("gcPausesCount", clusterMember.getGarbageCollectionCount());
     }
+
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGatewayHubService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGatewayHubService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGatewayHubService.java
index f1efd55..2f7b717 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGatewayHubService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberGatewayHubService.java
@@ -19,22 +19,21 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Class MemberGatewayHubService
@@ -50,114 +49,102 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberGatewayHubService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
-
-    try {
-
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberGatewayHub")
-          .getString("memberName");
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-
-      if (clusterMember != null) {
-        // response
-        // get gateway receiver
-        Cluster.GatewayReceiver gatewayReceiver = clusterMember
-            .getGatewayReceiver();
-
-        Boolean isGateway = false;
-
-        if (gatewayReceiver != null) {
-          responseJSON.put("isGatewayReceiver", true);
-          responseJSON.put("listeningPort", gatewayReceiver.getListeningPort());
-          responseJSON
-              .put("linkTroughput", gatewayReceiver.getLinkThroughput());
-          responseJSON.put("avgBatchLatency",
-              gatewayReceiver.getAvgBatchProcessingTime());
-        } else {
-          responseJSON.put("isGatewayReceiver", false);
-        }
+    ObjectNode responseJSON = mapper.createObjectNode();
 
-        // get gateway senders
-        Cluster.GatewaySender[] gatewaySenders = clusterMember
-            .getMemberGatewaySenders();
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberGatewayHub").get("memberName").textValue();
 
-        if (gatewaySenders.length > 0) {
-          isGateway = true;
-        }
-        responseJSON.put("isGatewaySender", isGateway);
-        // Senders
-        JSONArray gatewaySendersJsonList = new JSONArray();
-
-        for (Cluster.GatewaySender gatewaySender : gatewaySenders) {
-          JSONObject gatewaySenderJSON = new JSONObject();
-          gatewaySenderJSON.put("id", gatewaySender.getId());
-          gatewaySenderJSON.put("queueSize", gatewaySender.getQueueSize());
-          gatewaySenderJSON.put("status", gatewaySender.getStatus());
-          gatewaySenderJSON.put("primary", gatewaySender.getPrimary());
-          gatewaySenderJSON.put("senderType", gatewaySender.getSenderType());
-          gatewaySenderJSON.put("batchSize", gatewaySender.getBatchSize());
-          gatewaySenderJSON.put("PersistenceEnabled",
-              gatewaySender.getPersistenceEnabled());
-          gatewaySenderJSON.put("remoteDSId",
-              gatewaySender.getRemoteDSId());
-          gatewaySenderJSON.put("eventsExceedingAlertThreshold",
-              gatewaySender.getEventsExceedingAlertThreshold());
-
-          gatewaySendersJsonList.put(gatewaySenderJSON);
-        }
-        // senders response
-        responseJSON.put("gatewaySenders", gatewaySendersJsonList);
-
-        // async event queues
-        Cluster.AsyncEventQueue[] asyncEventQueues = clusterMember.getMemberAsyncEventQueueList();
-        JSONArray asyncEventQueueJsonList = new JSONArray();
-
-        for (Cluster.AsyncEventQueue asyncEventQueue : asyncEventQueues) {
-          JSONObject asyncEventQueueJSON = new JSONObject();
-          asyncEventQueueJSON.put("id", asyncEventQueue.getId());
-          asyncEventQueueJSON.put("primary", asyncEventQueue.getPrimary());
-          asyncEventQueueJSON.put("senderType", asyncEventQueue.isParallel());
-          asyncEventQueueJSON.put("batchSize", asyncEventQueue.getBatchSize());
-          asyncEventQueueJSON.put("batchTimeInterval", asyncEventQueue.getBatchTimeInterval());
-          asyncEventQueueJSON.put("batchConflationEnabled", asyncEventQueue.isBatchConflationEnabled());
-          asyncEventQueueJSON.put("asyncEventListener", asyncEventQueue.getAsyncEventListener());
-          asyncEventQueueJSON.put("queueSize", asyncEventQueue.getEventQueueSize());
-
-          asyncEventQueueJsonList.put(asyncEventQueueJSON);
-        }
-        responseJSON.put("asyncEventQueues", asyncEventQueueJsonList);
+    Cluster.Member clusterMember = cluster.getMember(StringUtils
+        .makeCompliantName(memberName));
+
+    if (clusterMember != null) {
+      // response
+      // get gateway receiver
+      Cluster.GatewayReceiver gatewayReceiver = clusterMember.getGatewayReceiver();
 
+      Boolean isGateway = false;
 
-        Map<String,Cluster.Region> clusterRegions = cluster.getClusterRegions();
+      if (gatewayReceiver != null) {
+        responseJSON.put("isGatewayReceiver", true);
+        responseJSON.put("listeningPort", gatewayReceiver.getListeningPort());
+        responseJSON.put("linkTroughput", gatewayReceiver.getLinkThroughput());
+        responseJSON.put("avgBatchLatency", gatewayReceiver.getAvgBatchProcessingTime());
+      } else {
+        responseJSON.put("isGatewayReceiver", false);
+      }
 
-        List<Cluster.Region> clusterRegionsList = new ArrayList<Cluster.Region>();
-        clusterRegionsList.addAll(clusterRegions.values());
-        
-        JSONArray regionsList = new JSONArray();
+      // get gateway senders
+      Cluster.GatewaySender[] gatewaySenders = clusterMember.getMemberGatewaySenders();
 
-        for (Cluster.Region region : clusterRegionsList) {
-          if (region.getWanEnabled()) {
-            JSONObject regionJSON = new JSONObject();
-            regionJSON.put("name", region.getName());
-            regionsList.put(regionJSON);
-          }
+      if (gatewaySenders.length > 0) {
+        isGateway = true;
+      }
+      responseJSON.put("isGatewaySender", isGateway);
+      // Senders
+      ArrayNode gatewaySendersJsonList = mapper.createArrayNode();
+
+      for (Cluster.GatewaySender gatewaySender : gatewaySenders) {
+        ObjectNode gatewaySenderJSON = mapper.createObjectNode();
+        gatewaySenderJSON.put("id", gatewaySender.getId());
+        gatewaySenderJSON.put("queueSize", gatewaySender.getQueueSize());
+        gatewaySenderJSON.put("status", gatewaySender.getStatus());
+        gatewaySenderJSON.put("primary", gatewaySender.getPrimary());
+        gatewaySenderJSON.put("senderType", gatewaySender.getSenderType());
+        gatewaySenderJSON.put("batchSize", gatewaySender.getBatchSize());
+        gatewaySenderJSON.put("PersistenceEnabled", gatewaySender.getPersistenceEnabled());
+        gatewaySenderJSON.put("remoteDSId", gatewaySender.getRemoteDSId());
+        gatewaySenderJSON.put("eventsExceedingAlertThreshold", gatewaySender.getEventsExceedingAlertThreshold());
+
+        gatewaySendersJsonList.add(gatewaySenderJSON);
+      }
+      // senders response
+      responseJSON.put("gatewaySenders", gatewaySendersJsonList);
+
+      // async event queues
+      Cluster.AsyncEventQueue[] asyncEventQueues = clusterMember.getMemberAsyncEventQueueList();
+      ArrayNode asyncEventQueueJsonList = mapper.createArrayNode();
+
+      for (Cluster.AsyncEventQueue asyncEventQueue : asyncEventQueues) {
+        ObjectNode asyncEventQueueJSON = mapper.createObjectNode();
+        asyncEventQueueJSON.put("id", asyncEventQueue.getId());
+        asyncEventQueueJSON.put("primary", asyncEventQueue.getPrimary());
+        asyncEventQueueJSON.put("senderType", asyncEventQueue.isParallel());
+        asyncEventQueueJSON.put("batchSize", asyncEventQueue.getBatchSize());
+        asyncEventQueueJSON.put("batchTimeInterval", asyncEventQueue.getBatchTimeInterval());
+        asyncEventQueueJSON.put("batchConflationEnabled", asyncEventQueue.isBatchConflationEnabled());
+        asyncEventQueueJSON.put("asyncEventListener", asyncEventQueue.getAsyncEventListener());
+        asyncEventQueueJSON.put("queueSize", asyncEventQueue.getEventQueueSize());
+
+        asyncEventQueueJsonList.add(asyncEventQueueJSON);
+      }
+      responseJSON.put("asyncEventQueues", asyncEventQueueJsonList);
+
+      Map<String,Cluster.Region> clusterRegions = cluster.getClusterRegions();
+
+      List<Cluster.Region> clusterRegionsList = new ArrayList<Cluster.Region>();
+      clusterRegionsList.addAll(clusterRegions.values());
+
+      ArrayNode regionsList = mapper.createArrayNode();
+
+      for (Cluster.Region region : clusterRegionsList) {
+        if (region.getWanEnabled()) {
+          ObjectNode regionJSON = mapper.createObjectNode();
+          regionJSON.put("name", region.getName());
+          regionsList.add(regionJSON);
         }
-        responseJSON.put("regionsInvolved", regionsList);
       }
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+      responseJSON.put("regionsInvolved", regionsList);
     }
+
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberHeapUsageService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberHeapUsageService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberHeapUsageService.java
index 0073881..914b053 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberHeapUsageService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberHeapUsageService.java
@@ -19,18 +19,17 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import javax.servlet.http.HttpServletRequest;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
+import com.vmware.gemfire.tools.pulse.internal.data.Repository;
+import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberHeapUsageService
@@ -46,40 +45,30 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberHeapUsageService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
+    ObjectNode responseJSON = mapper.createObjectNode();
 
     // members list
-    try {
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberHeapUsage")
-          .getString("memberName");
-
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-      if (clusterMember != null) {
-        // response
-        responseJSON
-            .put(
-                "heapUsageTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_HEAP_USAGE_SAMPLE)));
-        responseJSON
-            .put("currentHeapUsage", clusterMember.getCurrentHeapSize());
-      }
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberHeapUsage").get("memberName").textValue();
 
-      // Send json response
-      return responseJSON;
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
 
-    } catch (JSONException e) {
-      throw new Exception(e);
+    if (clusterMember != null) {
+      // response
+      responseJSON.put("heapUsageTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_HEAP_USAGE_SAMPLE)));
+      responseJSON.put("currentHeapUsage", clusterMember.getCurrentHeapSize());
     }
+
+    // Send json response
+    return responseJSON;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6d3f5560/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberKeyStatisticsService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberKeyStatisticsService.java b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberKeyStatisticsService.java
index 9dc6126..4509918 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberKeyStatisticsService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/MemberKeyStatisticsService.java
@@ -19,18 +19,18 @@
 
 package com.vmware.gemfire.tools.pulse.internal.service;
 
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.vmware.gemfire.tools.pulse.internal.data.Cluster;
 import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONArray;
 import com.vmware.gemfire.tools.pulse.internal.json.JSONException;
-import com.vmware.gemfire.tools.pulse.internal.json.JSONObject;
 import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Class MemberKeyStatisticsService
@@ -46,53 +46,33 @@ import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
 @Scope("singleton")
 public class MemberKeyStatisticsService implements PulseService {
 
-  public JSONObject execute(final HttpServletRequest request) throws Exception {
+  private final ObjectMapper mapper = new ObjectMapper();
+
+  public ObjectNode tempExecute(final HttpServletRequest request) throws Exception, JSONException {
 
     // get cluster object
     Cluster cluster = Repository.get().getCluster();
 
     // json object to be sent as response
-    JSONObject responseJSON = new JSONObject();
+    ObjectNode responseJSON = mapper.createObjectNode();
+
+    JsonNode requestDataJSON = mapper.readTree(request.getParameter("pulseData"));
+    String memberName = requestDataJSON.get("MemberKeyStatistics").get("memberName").textValue();
 
-    try {
-      JSONObject requestDataJSON = new JSONObject(
-          request.getParameter("pulseData"));
-      String memberName = requestDataJSON.getJSONObject("MemberKeyStatistics")
-          .getString("memberName");
+    Cluster.Member clusterMember = cluster.getMember(StringUtils.makeCompliantName(memberName));
 
-      Cluster.Member clusterMember = cluster.getMember(StringUtils
-          .makeCompliantName(memberName));
-      if (clusterMember != null) {
-        // response
-        responseJSON
-            .put(
-                "cpuUsageTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_CPU_USAGE_SAMPLE)));
-        responseJSON
-            .put(
-                "memoryUsageTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_HEAP_USAGE_SAMPLE)));
-        responseJSON
-            .put(
-                "readPerSecTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_GETS_PER_SECOND)));
-        responseJSON
-            .put(
-                "writePerSecTrend",
-                new JSONArray(
-                    clusterMember
-                        .getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_PUTS_PER_SECOND)));
-      }
-      // Send json response
-      return responseJSON;
-    } catch (JSONException e) {
-      throw new Exception(e);
+    if (clusterMember != null) {
+      // response
+      responseJSON.put("cpuUsageTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_CPU_USAGE_SAMPLE)));
+      responseJSON.put("memoryUsageTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_HEAP_USAGE_SAMPLE)));
+      responseJSON.put("readPerSecTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_GETS_PER_SECOND)));
+      responseJSON.put("writePerSecTrend",
+          mapper.valueToTree(clusterMember.getMemberStatisticTrend(Cluster.Member.MEMBER_STAT_PUTS_PER_SECOND)));
     }
+    // Send json response
+    return responseJSON;
   }
 }


Mime
View raw message