GEODE-37 renamed pulse package to geode

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

Branch: refs/heads/develop
Commit: 9a2b5d7b2d00c8ebe7a849487aea3df01063000f
Parents: 5ba853d
Author: Hitesh Khamesra <hkhame...@pivotal.io>
Authored: Mon Sep 19 13:57:29 2016 -0700
Committer: Hitesh Khamesra <hkhame...@pivotal.io>
Committed: Tue Sep 20 14:29:51 2016 -0700

----------------------------------------------------------------------
 .../tools/pulse/internal/PulseAppListener.java  |  742 ----
 .../controllers/ExceptionHandlingAdvice.java    |   51 -
 .../internal/controllers/PulseController.java   |  524 ---
 .../tools/pulse/internal/data/Cluster.java      | 3815 ------------------
 .../tools/pulse/internal/data/DataBrowser.java  |  248 --
 .../pulse/internal/data/IClusterUpdater.java    |   35 -
 .../pulse/internal/data/JMXDataUpdater.java     | 2392 -----------
 .../pulse/internal/data/JmxManagerFinder.java   |  169 -
 .../tools/pulse/internal/data/PulseConfig.java  |  139 -
 .../pulse/internal/data/PulseConstants.java     |  434 --
 .../tools/pulse/internal/data/PulseVersion.java |  103 -
 .../tools/pulse/internal/data/Repository.java   |  246 --
 .../gemfire/tools/pulse/internal/json/CDL.java  |  274 --
 .../tools/pulse/internal/json/Cookie.java       |  164 -
 .../tools/pulse/internal/json/CookieList.java   |   85 -
 .../gemfire/tools/pulse/internal/json/HTTP.java |  158 -
 .../tools/pulse/internal/json/HTTPTokener.java  |   72 -
 .../tools/pulse/internal/json/JSONArray.java    |  901 -----
 .../pulse/internal/json/JSONException.java      |   47 -
 .../tools/pulse/internal/json/JSONML.java       |  462 ---
 .../tools/pulse/internal/json/JSONObject.java   | 1585 --------
 .../tools/pulse/internal/json/JSONString.java   |   37 -
 .../tools/pulse/internal/json/JSONStringer.java |   73 -
 .../tools/pulse/internal/json/JSONTokener.java  |  441 --
 .../tools/pulse/internal/json/JSONWriter.java   |  322 --
 .../gemfire/tools/pulse/internal/json/README    |   68 -
 .../gemfire/tools/pulse/internal/json/XML.java  |  503 ---
 .../tools/pulse/internal/json/XMLTokener.java   |  360 --
 .../tools/pulse/internal/log/LogWriter.java     |  265 --
 .../pulse/internal/log/MessageFormatter.java    |  102 -
 .../pulse/internal/log/PulseLogWriter.java      |  299 --
 .../tools/pulse/internal/log/PulseLogger.java   |  142 -
 .../security/GemFireAuthentication.java         |   91 -
 .../security/GemFireAuthenticationProvider.java |   80 -
 .../pulse/internal/security/LogoutHandler.java  |   55 -
 .../internal/service/ClusterDetailsService.java |  104 -
 .../service/ClusterDiskThroughputService.java   |   71 -
 .../service/ClusterGCPausesService.java         |   69 -
 .../service/ClusterKeyStatisticsService.java    |   69 -
 .../internal/service/ClusterMemberService.java  |  132 -
 .../service/ClusterMembersRGraphService.java    |  359 --
 .../service/ClusterMemoryUsageService.java      |   65 -
 .../internal/service/ClusterRegionService.java  |  211 -
 .../internal/service/ClusterRegionsService.java |  206 -
 .../service/ClusterSelectedRegionService.java   |  237 --
 .../ClusterSelectedRegionsMemberService.java    |  143 -
 .../internal/service/ClusterWANInfoService.java |   75 -
 .../service/MemberAsynchEventQueuesService.java |   99 -
 .../internal/service/MemberClientsService.java  |  101 -
 .../internal/service/MemberDetailsService.java  |  122 -
 .../service/MemberDiskThroughputService.java    |   76 -
 .../internal/service/MemberGCPausesService.java |   73 -
 .../service/MemberGatewayHubService.java        |  149 -
 .../service/MemberHeapUsageService.java         |   73 -
 .../service/MemberKeyStatisticsService.java     |   76 -
 .../internal/service/MemberRegionsService.java  |  127 -
 .../internal/service/MembersListService.java    |   75 -
 .../pulse/internal/service/PulseService.java    |   40 -
 .../internal/service/PulseServiceFactory.java   |   55 -
 .../internal/service/PulseVersionService.java   |   65 -
 .../service/QueryStatisticsService.java         |  115 -
 .../internal/service/SystemAlertsService.java   |  127 -
 .../pulse/internal/util/ConnectionUtil.java     |   46 -
 .../pulse/internal/util/IPAddressUtil.java      |   65 -
 .../tools/pulse/internal/util/StringUtils.java  |   85 -
 .../tools/pulse/internal/util/TimeUtils.java    |  120 -
 .../tools/pulse/internal/PulseAppListener.java  |  742 ++++
 .../controllers/ExceptionHandlingAdvice.java    |   51 +
 .../internal/controllers/PulseController.java   |  524 +++
 .../tools/pulse/internal/data/Cluster.java      | 3815 ++++++++++++++++++
 .../tools/pulse/internal/data/DataBrowser.java  |  248 ++
 .../pulse/internal/data/IClusterUpdater.java    |   35 +
 .../pulse/internal/data/JMXDataUpdater.java     | 2392 +++++++++++
 .../pulse/internal/data/JmxManagerFinder.java   |  169 +
 .../tools/pulse/internal/data/PulseConfig.java  |  139 +
 .../pulse/internal/data/PulseConstants.java     |  434 ++
 .../tools/pulse/internal/data/PulseVersion.java |  103 +
 .../tools/pulse/internal/data/Repository.java   |  246 ++
 .../geode/tools/pulse/internal/json/CDL.java    |  274 ++
 .../geode/tools/pulse/internal/json/Cookie.java |  164 +
 .../tools/pulse/internal/json/CookieList.java   |   85 +
 .../geode/tools/pulse/internal/json/HTTP.java   |  158 +
 .../tools/pulse/internal/json/HTTPTokener.java  |   72 +
 .../tools/pulse/internal/json/JSONArray.java    |  901 +++++
 .../pulse/internal/json/JSONException.java      |   47 +
 .../geode/tools/pulse/internal/json/JSONML.java |  462 +++
 .../tools/pulse/internal/json/JSONObject.java   | 1585 ++++++++
 .../tools/pulse/internal/json/JSONString.java   |   37 +
 .../tools/pulse/internal/json/JSONStringer.java |   73 +
 .../tools/pulse/internal/json/JSONTokener.java  |  441 ++
 .../tools/pulse/internal/json/JSONWriter.java   |  322 ++
 .../geode/tools/pulse/internal/json/README      |   68 +
 .../geode/tools/pulse/internal/json/XML.java    |  503 +++
 .../tools/pulse/internal/json/XMLTokener.java   |  360 ++
 .../tools/pulse/internal/log/LogWriter.java     |  265 ++
 .../pulse/internal/log/MessageFormatter.java    |  102 +
 .../pulse/internal/log/PulseLogWriter.java      |  299 ++
 .../tools/pulse/internal/log/PulseLogger.java   |  142 +
 .../security/GemFireAuthentication.java         |   91 +
 .../security/GemFireAuthenticationProvider.java |   80 +
 .../pulse/internal/security/LogoutHandler.java  |   55 +
 .../internal/service/ClusterDetailsService.java |  104 +
 .../service/ClusterDiskThroughputService.java   |   71 +
 .../service/ClusterGCPausesService.java         |   69 +
 .../service/ClusterKeyStatisticsService.java    |   69 +
 .../internal/service/ClusterMemberService.java  |  132 +
 .../service/ClusterMembersRGraphService.java    |  359 ++
 .../service/ClusterMemoryUsageService.java      |   65 +
 .../internal/service/ClusterRegionService.java  |  211 +
 .../internal/service/ClusterRegionsService.java |  206 +
 .../service/ClusterSelectedRegionService.java   |  237 ++
 .../ClusterSelectedRegionsMemberService.java    |  143 +
 .../internal/service/ClusterWANInfoService.java |   75 +
 .../service/MemberAsynchEventQueuesService.java |   99 +
 .../internal/service/MemberClientsService.java  |  101 +
 .../internal/service/MemberDetailsService.java  |  122 +
 .../service/MemberDiskThroughputService.java    |   76 +
 .../internal/service/MemberGCPausesService.java |   73 +
 .../service/MemberGatewayHubService.java        |  149 +
 .../service/MemberHeapUsageService.java         |   73 +
 .../service/MemberKeyStatisticsService.java     |   76 +
 .../internal/service/MemberRegionsService.java  |  127 +
 .../internal/service/MembersListService.java    |   75 +
 .../pulse/internal/service/PulseService.java    |   40 +
 .../internal/service/PulseServiceFactory.java   |   55 +
 .../internal/service/PulseVersionService.java   |   65 +
 .../service/QueryStatisticsService.java         |  115 +
 .../internal/service/SystemAlertsService.java   |  127 +
 .../pulse/internal/util/ConnectionUtil.java     |   46 +
 .../pulse/internal/util/IPAddressUtil.java      |   65 +
 .../tools/pulse/internal/util/StringUtils.java  |   85 +
 .../tools/pulse/internal/util/TimeUtils.java    |  120 +
 .../webapp/WEB-INF/mvc-dispatcher-servlet.xml   |    2 +-
 .../src/main/webapp/WEB-INF/spring-security.xml |    4 +-
 geode-pulse/src/main/webapp/WEB-INF/web.xml     |    2 +-
 .../controllers/PulseControllerJUnitTest.java   |  816 ----
 .../pulse/testbed/GemFireDistributedSystem.java |  324 --
 .../tools/pulse/testbed/GemfireTopology.java    |   24 -
 .../tools/pulse/testbed/PropFileHelper.java     |  115 -
 .../pulse/testbed/PropMockDataUpdater.java      |  513 ---
 .../gemfire/tools/pulse/testbed/TestBed.java    |   84 -
 .../tools/pulse/testbed/driver/PulseUITest.java |  279 --
 .../tools/pulse/tests/AggregateStatement.java   |  217 -
 .../pulse/tests/AggregateStatementMBean.java    |  168 -
 .../pulse/tests/DataBrowserResultLoader.java    |   84 -
 .../pulse/tests/GemFireXDAggregateTable.java    |   46 -
 .../tests/GemFireXDAggregateTableMBean.java     |   28 -
 .../tools/pulse/tests/GemFireXDCluster.java     |   95 -
 .../pulse/tests/GemFireXDClusterMBean.java      |   32 -
 .../tools/pulse/tests/GemFireXDMember.java      |   80 -
 .../tools/pulse/tests/GemFireXDMemberMBean.java |   31 -
 .../gemfire/tools/pulse/tests/JMXBaseBean.java  |   67 -
 .../tools/pulse/tests/JMXProperties.java        |   47 -
 .../gemfire/tools/pulse/tests/Member.java       |  193 -
 .../gemfire/tools/pulse/tests/MemberMBean.java  |   86 -
 .../tools/pulse/tests/PulseAbstractTest.java    | 1049 -----
 .../tools/pulse/tests/PulseAuthTest.java        |   33 -
 .../tools/pulse/tests/PulseAutomatedTest.java   |  784 ----
 .../tools/pulse/tests/PulseBaseTest.java        |  693 ----
 .../tools/pulse/tests/PulseNoAuthTest.java      |   33 -
 .../tools/pulse/tests/PulseTestData.java        |  106 -
 .../tools/pulse/tests/PulseTestLocators.java    |  225 --
 .../gemfire/tools/pulse/tests/Region.java       |  187 -
 .../gemfire/tools/pulse/tests/RegionMBean.java  |   59 -
 .../tools/pulse/tests/RegionOnMember.java       |   95 -
 .../tools/pulse/tests/RegionOnMemberMBean.java  |   49 -
 .../gemfire/tools/pulse/tests/Server.java       |  247 --
 .../gemfire/tools/pulse/tests/ServerObject.java |  267 --
 .../tools/pulse/tests/ServerObjectMBean.java    |   79 -
 .../pulse/tests/junit/BaseServiceTest.java      |  254 --
 .../junit/ClusterSelectedRegionServiceTest.java |  340 --
 ...ClusterSelectedRegionsMemberServiceTest.java |  354 --
 .../junit/MemberGatewayHubServiceTest.java      |  412 --
 .../controllers/PulseControllerJUnitTest.java   |  816 ++++
 .../pulse/testbed/GemFireDistributedSystem.java |  324 ++
 .../tools/pulse/testbed/GemfireTopology.java    |   24 +
 .../tools/pulse/testbed/PropFileHelper.java     |  115 +
 .../pulse/testbed/PropMockDataUpdater.java      |  513 +++
 .../geode/tools/pulse/testbed/TestBed.java      |   84 +
 .../tools/pulse/testbed/driver/PulseUITest.java |  279 ++
 .../tools/pulse/tests/AggregateStatement.java   |  217 +
 .../pulse/tests/AggregateStatementMBean.java    |  168 +
 .../pulse/tests/DataBrowserResultLoader.java    |   84 +
 .../pulse/tests/GemFireXDAggregateTable.java    |   46 +
 .../tests/GemFireXDAggregateTableMBean.java     |   28 +
 .../tools/pulse/tests/GemFireXDCluster.java     |   95 +
 .../pulse/tests/GemFireXDClusterMBean.java      |   32 +
 .../tools/pulse/tests/GemFireXDMember.java      |   80 +
 .../tools/pulse/tests/GemFireXDMemberMBean.java |   31 +
 .../geode/tools/pulse/tests/JMXBaseBean.java    |   67 +
 .../geode/tools/pulse/tests/JMXProperties.java  |   47 +
 .../apache/geode/tools/pulse/tests/Member.java  |  193 +
 .../geode/tools/pulse/tests/MemberMBean.java    |   86 +
 .../tools/pulse/tests/PulseAbstractTest.java    | 1049 +++++
 .../geode/tools/pulse/tests/PulseAuthTest.java  |   33 +
 .../tools/pulse/tests/PulseAutomatedTest.java   |  784 ++++
 .../geode/tools/pulse/tests/PulseBaseTest.java  |  693 ++++
 .../tools/pulse/tests/PulseNoAuthTest.java      |   33 +
 .../geode/tools/pulse/tests/PulseTestData.java  |  106 +
 .../tools/pulse/tests/PulseTestLocators.java    |  225 ++
 .../apache/geode/tools/pulse/tests/Region.java  |  187 +
 .../geode/tools/pulse/tests/RegionMBean.java    |   59 +
 .../geode/tools/pulse/tests/RegionOnMember.java |   95 +
 .../tools/pulse/tests/RegionOnMemberMBean.java  |   49 +
 .../apache/geode/tools/pulse/tests/Server.java  |  247 ++
 .../geode/tools/pulse/tests/ServerObject.java   |  267 ++
 .../tools/pulse/tests/ServerObjectMBean.java    |   79 +
 .../pulse/tests/junit/BaseServiceTest.java      |  254 ++
 .../junit/ClusterSelectedRegionServiceTest.java |  340 ++
 ...ClusterSelectedRegionsMemberServiceTest.java |  354 ++
 .../junit/MemberGatewayHubServiceTest.java      |  412 ++
 211 files changed, 27513 insertions(+), 27513 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9a2b5d7b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/PulseAppListener.java
----------------------------------------------------------------------
diff --git 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/PulseAppListener.java
 
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/PulseAppListener.java
deleted file mode 100644
index 1ca921e..0000000
--- 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/PulseAppListener.java
+++ /dev/null
@@ -1,742 +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 com.vmware.gemfire.tools.pulse.internal;
-
-import com.vmware.gemfire.tools.pulse.internal.controllers.PulseController;
-import com.vmware.gemfire.tools.pulse.internal.data.PulseConfig;
-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.log.PulseLogWriter;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.logging.Level;
-
-/**
- * This class is used for checking the application running mode i.e. Embedded 
or
- * not
- * 
- * @since GemFire version 7.0.Beta 2012-09-23
- * 
- */
-// @WebListener
-public class PulseAppListener implements ServletContextListener {
-  private PulseLogWriter LOGGER;
-  private final ResourceBundle resourceBundle = Repository.get()
-      .getResourceBundle();
-
-  // String object to store all messages which needs to be logged into the log
-  // file before logger gets initialized
-  private String messagesToBeLogged = "";
-
-  private Properties pulseProperties;
-  private Properties pulseSecurityProperties;
-  private Boolean sysPulseUseLocator;
-  private String sysPulseHost;
-  private String sysPulsePort;
-  private String jmxUserName;
-  private String jmxUserPassword;
-  
-  private boolean sysPulseUseSSLLocator;
-  private boolean sysPulseUseSSLManager;
-  
-  //This property determines if pulse webApp login is authenticated against
-  //GemFire integrated security or custom spring-security config provided 
-  //in pulse-authentication-custom.xml 
-  private boolean useGemFireCredentials;
-
-  @Override
-  public void contextDestroyed(ServletContextEvent event) {
-
-    // Stop all running threads those are created in Pulse
-    // Stop cluster threads
-    Repository.get().removeAllClusters();
-
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(resourceBundle.getString("LOG_MSG_CONTEXT_DESTROYED")
-          + event.getServletContext().getContextPath());
-    }
-  }
-
-  @Override
-  public void contextInitialized(ServletContextEvent event) {
-    
-    messagesToBeLogged = messagesToBeLogged
-        .concat(formatLogString(resourceBundle
-            .getString("LOG_MSG_CONTEXT_INITIALIZED")));
-
-    // Load Pulse version details
-    loadPulseVersionDetails();
-
-    // Load Pulse Properties
-    pulseProperties = loadProperties(PulseConstants.PULSE_PROPERTIES_FILE);
-
-    if (pulseProperties.isEmpty()) {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              .getString("LOG_MSG_PROPERTIES_NOT_FOUND")));
-    } else {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              .getString("LOG_MSG_PROPERTIES_FOUND")));
-
-      // set Pulse product support into the Pulse controller for access from
-      // client side
-      // to display the appropriate ui depending on which product is supported
-      // in present deployment
-      String pulseProduct = 
pulseProperties.getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_PRODUCTSUPPORT);
-      // default is gemfire
-
-      if ((pulseProduct != null) && 
(pulseProduct.trim().equalsIgnoreCase(PulseConstants.PRODUCT_NAME_SQLFIRE))) {
-        
PulseController.setPulseProductSupport(PulseConstants.PRODUCT_NAME_SQLFIRE);
-      }
-    }
-    
-    pulseSecurityProperties = 
loadProperties(PulseConstants.PULSE_SECURITY_PROPERTIES_FILE);
-
-    // Initialize logger
-    initializeLogger();
-
-    // Reference to repository
-    Repository repository = Repository.get();
-
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(resourceBundle.getString("LOG_MSG_CHECK_APP_RUNNING_MODE"));
-    }
-
-    boolean sysIsEmbedded = Boolean
-        .getBoolean(PulseConstants.SYSTEM_PROPERTY_PULSE_EMBEDDED);
-
-    if (sysIsEmbedded) {
-      // Application Pulse is running in Embedded Mode
-      if (LOGGER.infoEnabled()) {
-        LOGGER.info(resourceBundle
-            .getString("LOG_MSG_APP_RUNNING_EMBEDDED_MODE"));
-      }
-      repository.setIsEmbeddedMode(true);
-
-      sysPulseUseLocator = Boolean.FALSE;
-         try{
-                               // Get host name of machine running pulse in 
embedded mode
-                  sysPulseHost = 
InetAddress.getLocalHost().getCanonicalHostName();
-               } catch (UnknownHostException e) {
-                       if (LOGGER.fineEnabled()) {
-                               LOGGER.fine(resourceBundle
-                                                       
.getString("LOG_MSG_JMX_CONNECTION_UNKNOWN_HOST")
-                                                       + e.getMessage());
-                   }
-                               // Set default host name
-                   sysPulseHost = PulseConstants.GEMFIRE_DEFAULT_HOST;
-               } catch (Exception e) {
-                       if (LOGGER.fineEnabled()) {
-                                       LOGGER.fine(resourceBundle
-                                                       
.getString("LOG_MSG_JMX_CONNECTION_UNKNOWN_HOST")
-                                                       + e.getMessage());
-                       }
-                               // Set default host name
-                       sysPulseHost = PulseConstants.GEMFIRE_DEFAULT_HOST;
-               }
-      sysPulsePort = PulseConstants.GEMFIRE_DEFAULT_PORT;
-      
-      boolean pulseEmbededSqlf = 
Boolean.getBoolean(PulseConstants.SYSTEM_PROPERTY_PULSE_EMBEDDED_SQLF);
-      if(pulseEmbededSqlf){
-        
PulseController.setPulseProductSupport(PulseConstants.PRODUCT_NAME_SQLFIRE);
-        if (LOGGER.infoEnabled()) {
-          LOGGER.info(resourceBundle
-              .getString("LOG_MSG_APP_RUNNING_EMBEDDED_SQLF_MODE"));
-        }
-      }
-
-    } else {
-      // Application Pulse is running in Non-Embedded Mode
-      if (LOGGER.infoEnabled()) {
-        LOGGER.info(resourceBundle
-            .getString("LOG_MSG_APP_RUNNING_NONEMBEDDED_MODE"));
-      }
-      repository.setIsEmbeddedMode(false);
-
-      // Load JMX User Details
-      loadJMXUserDetails();
-      // Load locator and/or manager details
-      loadLocatorManagerDetails();
-       
-      useGemFireCredentials = areWeUsingGemFireSecurityProfile(event); 
-    }
-
-    // Set user details in repository    
-    repository.setJmxUserName(jmxUserName);
-    repository.setJmxUserPassword(jmxUserPassword);
-
-    // Set locator/Manager details in repository
-    repository.setJmxUseLocator(sysPulseUseLocator);
-    repository.setJmxHost(sysPulseHost);
-    repository.setJmxPort(sysPulsePort);
-    
-    //set SSL info
-    initializeSSL();
-    repository.setUseSSLLocator(sysPulseUseSSLLocator);
-    repository.setUseSSLManager(sysPulseUseSSLManager);
-    
-    repository.setUseGemFireCredentials(useGemFireCredentials);
-
-  }
-
-  /**
-   * Return true if pulse is configure to authenticate using gemfire
-   * integrated security
-   * 
-   * @param event
-   * @return
-   */
-  private boolean areWeUsingGemFireSecurityProfile(ServletContextEvent event) {
-    String profile = null;
-    WebApplicationContext ctx = 
WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
-    if (ctx.getEnvironment() != null) {
-      String[] profiles = ctx.getEnvironment().getActiveProfiles();
-      if (profiles != null && profiles.length > 0) {
-        StringBuilder sb = new StringBuilder();
-        for (String p : profiles)
-          sb.append(p).append(",");
-        LOGGER.info("#SpringProfilesConfigured : " + sb.toString());
-        profile = ctx.getEnvironment().getActiveProfiles()[0];
-        LOGGER.info("#First Profile : " + profile);
-      } else {
-        LOGGER.info("No SpringProfileConfigured using default spring profile");
-        return false;
-      }
-    }
-    if 
(PulseConstants.APPLICATION_PROPERTY_PULSE_SEC_PROFILE_GEMFIRE.equals(profile)) 
{
-      LOGGER.info("Using gemfire integrated security profile");
-      return true;
-    }      
-    return false;
-  }
-
-  // Function to load pulse version details from properties file
-  private void loadPulseVersionDetails() {
-
-    // Read version details from version property file
-    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-    InputStream inputStream = classLoader
-        .getResourceAsStream(PulseConstants.PULSE_VERSION_PROPERTIES_FILE);
-
-    if (inputStream != null) {
-      Properties properties = new Properties();
-      try {
-        properties.load(inputStream);
-      } catch (IOException e) {
-        messagesToBeLogged = messagesToBeLogged
-            .concat(formatLogString(resourceBundle
-                .getString("LOG_MSG_EXCEPTION_LOADING_PROPERTIES_FILE")));
-      } finally {
-        try {
-          inputStream.close();
-        } catch (IOException e) {
-          messagesToBeLogged = messagesToBeLogged
-              .concat(formatLogString(resourceBundle
-                  .getString("LOG_MSG_EXCEPTION_CLOSING_INPUT_STREAM")));
-        }
-      }
-      // Set pulse version details in common object
-      PulseController.pulseVersion.setPulseVersion(properties.getProperty(
-          PulseConstants.PROPERTY_PULSE_VERSION, ""));
-      PulseController.pulseVersion.setPulseBuildId(properties.getProperty(
-          PulseConstants.PROPERTY_BUILD_ID, ""));
-      PulseController.pulseVersion.setPulseBuildDate(properties.getProperty(
-          PulseConstants.PROPERTY_BUILD_DATE, ""));
-      PulseController.pulseVersion.setPulseSourceDate(properties.getProperty(
-          PulseConstants.PROPERTY_SOURCE_DATE, ""));
-      PulseController.pulseVersion.setPulseSourceRevision(properties
-          .getProperty(PulseConstants.PROPERTY_SOURCE_REVISION, ""));
-      PulseController.pulseVersion.setPulseSourceRepository(properties
-          .getProperty(PulseConstants.PROPERTY_SOURCE_REPOSITORY, ""));
-    }
-
-    // Log Pulse Version details into log file
-    messagesToBeLogged = messagesToBeLogged
-        .concat(formatLogString(PulseController.pulseVersion
-            .getPulseVersionLogMessage()));
-  }
-
-  private void initializeLogger() {
-
-    // Override default log configuration by properties which are provided in
-    // properties file.
-    loadLogDetailsFromPropertyFile();
-
-    // Override log configuration by properties which are provided in
-    // through system properties.
-    loadLogDetailsFromSystemProperties();
-
-    // Initialize logger object
-    LOGGER = PulseLogWriter.getLogger();
-
-    // Log messages stored in messagesToBeLogged
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(messagesToBeLogged);
-      messagesToBeLogged = "";
-    }
-  }
-
-  // Function to load pulse properties from pulse.properties file
-  private Properties loadProperties(String propertyFile) {
-
-    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-    InputStream inputStream = classLoader.getResourceAsStream(propertyFile);
-    Properties properties = new Properties();
-
-    if (inputStream != null) {
-      messagesToBeLogged = 
messagesToBeLogged.concat(formatLogString(propertyFile + " "
-          + resourceBundle.getString("LOG_MSG_FILE_FOUND")));
-
-      try {
-        // Load properties from input stream
-        properties.load(inputStream);
-      } catch (IOException e1) {
-        messagesToBeLogged = 
messagesToBeLogged.concat(formatLogString(resourceBundle
-            .getString("LOG_MSG_EXCEPTION_LOADING_PROPERTIES_FILE")
-            + " " + propertyFile));
-      } finally {
-        // Close input stream
-        try {
-          inputStream.close();
-        } catch (IOException e) {
-          messagesToBeLogged = 
messagesToBeLogged.concat(formatLogString(resourceBundle
-              .getString("LOG_MSG_EXCEPTION_CLOSING_INPUT_STREAM")
-              + " " + propertyFile));
-        }
-      }
-
-    } else {
-      messagesToBeLogged = 
messagesToBeLogged.concat(formatLogString(resourceBundle
-          .getString("LOG_MSG_COULD_NOT_READ_FILE")
-          + " " + propertyFile));
-    }
-    return properties;
-  }
-
-  // Function to load Logging details from properties file
-  private void loadLogDetailsFromPropertyFile() {
-
-    // return, if Pulse Properties are not provided
-    if (pulseProperties.size() == 0) {
-      return;
-    }
-
-    messagesToBeLogged = messagesToBeLogged
-        .concat(formatLogString(resourceBundle
-            .getString("LOG_MSG_CHECK_LOG_PROPERTIES_IN_FILE")));
-
-    HashMap<String, String> logPropertiesHM = new HashMap<String, String>();
-
-    logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME, ""));
-
-    logPropertiesHM.put(
-        PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION, ""));
-
-    logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE, ""));
-
-    logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT, ""));
-
-    logPropertiesHM.put(
-        PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN, ""));
-
-    logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL, ""));
-
-    logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND,
-        pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND, ""));
-
-    if (logPropertiesHM.size() == 0) {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              .getString("LOG_MSG_LOG_PROPERTIES_NOT_FOUND_IN_FILE")));
-    } else {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              .getString("LOG_MSG_LOG_PROPERTIES_FOUND_IN_FILE")));
-    }
-
-    setLogConfigurations(logPropertiesHM);
-  }
-
-  // Function to load Logging details from system properties
-  private void loadLogDetailsFromSystemProperties() {
-
-    messagesToBeLogged = messagesToBeLogged
-        .concat(formatLogString(resourceBundle
-            .getString("LOG_MSG_CHECK_LOG_PROPERTIES_IN_SYSTEM_PROPERTIES")));
-
-    HashMap<String, String> logPropertiesHM = new HashMap<String, String>();
-
-    String sysLogFileName = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME);
-    String sysLogFileLocation = System
-        
.getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION);
-    String sysLogFileSize = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE);
-    String sysLogFileCount = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT);
-    String sysLogDatePattern = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN);
-    String sysLogLevel = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL);
-    String sysLogAppend = System
-        .getProperty(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND);
-
-    if (sysLogFileName == null || sysLogFileName.isEmpty()) {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME, "");
-    } else {
-      logPropertiesHM
-          .put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME,
-              sysLogFileName);
-    }
-
-    if (sysLogFileLocation == null || sysLogFileLocation.isEmpty()) {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION, "");
-    } else {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION,
-          sysLogFileLocation);
-    }
-
-    if (sysLogFileSize == null || sysLogFileSize.isEmpty()) {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE, "");
-    } else {
-      logPropertiesHM
-          .put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE,
-              sysLogFileSize);
-    }
-
-    if (sysLogFileCount == null || sysLogFileCount.isEmpty()) {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT, "");
-    } else {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT,
-          sysLogFileCount);
-    }
-
-    if (sysLogDatePattern == null || sysLogDatePattern.isEmpty()) {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN, "");
-    } else {
-      logPropertiesHM.put(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN,
-          sysLogDatePattern);
-    }
-
-    if (sysLogLevel == null || sysLogLevel.isEmpty()) {
-      logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL,
-          "");
-    } else {
-      logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL,
-          sysLogLevel);
-    }
-
-    if (sysLogAppend == null || sysLogAppend.isEmpty()) {
-      logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND,
-          "");
-    } else {
-      logPropertiesHM.put(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND,
-          sysLogAppend);
-    }
-
-    if (logPropertiesHM.size() == 0) {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              
.getString("LOG_MSG_LOG_PROPERTIES_NOT_FOUND_IN_SYSTEM_PROPERTIES")));
-    } else {
-      messagesToBeLogged = messagesToBeLogged
-          .concat(formatLogString(resourceBundle
-              
.getString("LOG_MSG_LOG_PROPERTIES_FOUND_IN_SYSTEM_PROPERTIES")));
-    }
-
-    setLogConfigurations(logPropertiesHM);
-  }
-
-  private void setLogConfigurations(HashMap<String, String> logPropertiesHM) {
-
-    PulseConfig pulseConfig = Repository.get().getPulseConfig();
-
-    // log file name
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME))) {
-      pulseConfig.setLogFileName(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILENAME));
-    }
-
-    // log file location
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION))) {
-      pulseConfig.setLogFileLocation(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILELOCATION));
-    }
-
-    // log file size
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE))) {
-      pulseConfig.setLogFileSize(Integer.parseInt(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILESIZE)));
-    }
-
-    // log file count
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT))) {
-      pulseConfig.setLogFileCount(Integer.parseInt(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGFILECOUNT)));
-    }
-
-    // log message date pattern
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN))) {
-      pulseConfig.setLogDatePattern(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGDATEPATTERN));
-    }
-
-    // log level
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL))) {
-      pulseConfig.setLogLevel(Level.parse(logPropertiesHM.get(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_LOGLEVEL).toUpperCase()));
-    }
-
-    // log append
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(logPropertiesHM
-        .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND))) {
-      pulseConfig.setLogAppend(Boolean.valueOf(logPropertiesHM
-          .get(PulseConstants.APPLICATION_PROPERTY_PULSE_LOGAPPEND)));
-    }
-
-  }
-
-  // Function to load JMX User details from properties
-  private void loadJMXUserDetails() {
-
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(resourceBundle.getString("LOG_MSG_GET_JMX_USER_DETAILS"));
-    }
-
-    if (pulseProperties.isEmpty()) {
-      if (LOGGER.infoEnabled()) {
-        LOGGER
-            .info(resourceBundle
-                .getString("LOG_MSG_JMX_USER_DETAILS_NOT_FOUND")
-                + resourceBundle
-                    .getString("LOG_MSG_REASON_USER_DETAILS_NOT_FOUND"));
-      }
-    } else {
-      jmxUserName = pulseProperties.getProperty(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_JMXUSERNAME, "");
-      jmxUserPassword = pulseProperties.getProperty(
-          PulseConstants.APPLICATION_PROPERTY_PULSE_JMXPASSWORD, "");
-
-      if (jmxUserName.isEmpty() || jmxUserPassword.isEmpty()) {
-        if (LOGGER.infoEnabled()) {
-          LOGGER.info(resourceBundle
-              .getString("LOG_MSG_JMX_USER_DETAILS_NOT_FOUND")
-              + resourceBundle
-                  .getString("LOG_MSG_REASON_USER_DETAILS_NOT_FOUND"));
-        }
-      } else {
-        if (LOGGER.infoEnabled()) {
-          LOGGER.info(resourceBundle
-              .getString("LOG_MSG_JMX_USER_DETAILS_FOUND"));
-        }
-      }
-    }
-  }
-  
-//Function to set SSL VM arguments
-  private void initializeSSL() {
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(resourceBundle.getString("LOG_MSG_GET_SSL_DETAILS"));
-    }
-
-     
-    this.sysPulseUseSSLLocator = Boolean.valueOf(pulseProperties.getProperty(
-        PulseConstants.SYSTEM_PROPERTY_PULSE_USESSL_LOCATOR, "false"));
-
-    this.sysPulseUseSSLManager = Boolean.valueOf(pulseProperties.getProperty(
-        PulseConstants.SYSTEM_PROPERTY_PULSE_USESSL_MANAGER, "false"));
-
-
-    if ((sysPulseUseSSLLocator || sysPulseUseSSLManager)) {
-      Properties sslProperties = new Properties();
-      if (!pulseSecurityProperties.isEmpty()) {
-        Set entrySet = pulseSecurityProperties.entrySet();
-        for (Iterator it = entrySet.iterator(); it.hasNext();) {
-          Entry<String, String> entry = (Entry<String, String>) it.next();
-          String key = entry.getKey();
-          if (key.startsWith("javax.net.ssl.")) {
-
-            String val = entry.getValue();
-            System.setProperty(key, val);
-            sslProperties.setProperty(key, val);
-          }
-        }
-      }
-      if (sslProperties.isEmpty()) {
-        if (LOGGER.warningEnabled()) {
-          LOGGER.warning(resourceBundle.getString("LOG_MSG_SSL_NOT_SET"));
-        }
-      }
-    }
-
-  }
-
-  // Function to load locator and/or manager details
-  private void loadLocatorManagerDetails() {
-
-    // Get locator details through System Properties
-    if (LOGGER.infoEnabled()) {
-      LOGGER.info(resourceBundle.getString("LOG_MSG_GET_LOCATOR_DETAILS_1"));
-    }
-
-    // Required System properties are
-    // -Dpulse.embedded="false" -Dpulse.useLocator="false"
-    // -Dpulse.host="192.168.2.11" -Dpulse.port="2099"
-    sysPulseUseLocator = Boolean
-        .getBoolean(PulseConstants.SYSTEM_PROPERTY_PULSE_USELOCATOR);
-    sysPulseHost = System
-        .getProperty(PulseConstants.SYSTEM_PROPERTY_PULSE_HOST);
-    sysPulsePort = System
-        .getProperty(PulseConstants.SYSTEM_PROPERTY_PULSE_PORT);
-
-    if (sysPulseHost == null || sysPulseHost.isEmpty() || sysPulsePort == null
-        || sysPulsePort.isEmpty()) {
-      if (LOGGER.infoEnabled()) {
-        LOGGER.info(resourceBundle
-            .getString("LOG_MSG_LOCATOR_DETAILS_NOT_FOUND")
-            + resourceBundle
-                .getString("LOG_MSG_REASON_LOCATOR_DETAILS_NOT_FOUND_1"));
-        LOGGER.info(resourceBundle.getString("LOG_MSG_GET_LOCATOR_DETAILS_2"));
-      }
-
-      if (pulseProperties.isEmpty()) {
-        if (LOGGER.infoEnabled()) {
-          LOGGER.info(resourceBundle
-              .getString("LOG_MSG_LOCATOR_DETAILS_NOT_FOUND")
-              + resourceBundle
-                  .getString("LOG_MSG_REASON_LOCATOR_DETAILS_NOT_FOUND_2"));
-        }
-
-        sysPulseHost = "";
-        sysPulsePort = "";
-      } else {
-        if (LOGGER.infoEnabled()) {
-          LOGGER
-              .info(resourceBundle.getString("LOG_MSG_LOCATOR_DETAILS_FOUND"));
-        }
-
-        sysPulseUseLocator = Boolean.valueOf(pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_USELOCATOR, ""));
-        sysPulseHost = pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_HOST, "");
-        sysPulsePort = pulseProperties.getProperty(
-            PulseConstants.APPLICATION_PROPERTY_PULSE_PORT, "");
-      }
-    } else {
-      if (LOGGER.infoEnabled()) {
-        LOGGER.info(resourceBundle.getString("LOG_MSG_LOCATOR_DETAILS_FOUND"));
-      }
-    }
-  }
-
-  private String formatLogString(String logMessage) {
-
-    DateFormat df = new SimpleDateFormat(
-        PulseConstants.LOG_MESSAGE_DATE_PATTERN);
-    // DateFormat df = new
-    // SimpleDateFormat(Repository.get().getPulseConfig().getLogDatePattern());
-    StringWriter sw = new StringWriter();
-    PrintWriter pw = new PrintWriter(sw);
-
-    pw.println();
-    pw.print("[");
-    pw.print("INFO");
-    pw.print(" ");
-    pw.print(df.format(new Date(System.currentTimeMillis())));
-    String threadName = Thread.currentThread().getName();
-    if (threadName != null) {
-      pw.print(" ");
-      pw.print(threadName);
-    }
-    pw.print(" tid=0x");
-    pw.print(Long.toHexString(Thread.currentThread().getId()));
-    pw.print("] ");
-    pw.print("(msgTID=");
-    pw.print("");
-
-    pw.print(" msgSN=");
-    pw.print("");
-
-    pw.print(") ");
-
-    pw.println("[" + PulseConstants.APP_NAME + "]");
-
-    pw.println(PulseLogWriter.class.getName());
-
-    pw.println(logMessage);
-
-    pw.close();
-    try {
-      sw.close();
-    } catch (IOException ignore) {
-    }
-    String result = sw.toString();
-    return result;
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9a2b5d7b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/ExceptionHandlingAdvice.java
----------------------------------------------------------------------
diff --git 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/ExceptionHandlingAdvice.java
 
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/ExceptionHandlingAdvice.java
deleted file mode 100644
index f98b5fd..0000000
--- 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/ExceptionHandlingAdvice.java
+++ /dev/null
@@ -1,51 +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 com.vmware.gemfire.tools.pulse.internal.controllers;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.ResponseStatus;
-
-import com.vmware.gemfire.tools.pulse.internal.log.PulseLogWriter;
-
-/**
- * For handling IO exception in our controllers
- * 
- * 
- */
-@ControllerAdvice
-public class ExceptionHandlingAdvice {
-
-  @ExceptionHandler(IOException.class)
-  @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
-  public void handleExc(IOException ext) {
-    PulseLogWriter LOGGER = PulseLogWriter.getLogger();
-    // write errors
-    StringWriter swBuffer = new StringWriter();
-    PrintWriter prtWriter = new PrintWriter(swBuffer);
-    ext.printStackTrace(prtWriter);
-    LOGGER.severe("IOException Details : " + swBuffer.toString() + "\n");
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9a2b5d7b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
----------------------------------------------------------------------
diff --git 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
 
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
deleted file mode 100644
index 3b8a87d..0000000
--- 
a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/controllers/PulseController.java
+++ /dev/null
@@ -1,524 +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 com.vmware.gemfire.tools.pulse.internal.controllers;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-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.PulseConstants;
-import com.vmware.gemfire.tools.pulse.internal.data.PulseVersion;
-import com.vmware.gemfire.tools.pulse.internal.data.Repository;
-import com.vmware.gemfire.tools.pulse.internal.log.PulseLogWriter;
-import com.vmware.gemfire.tools.pulse.internal.service.PulseService;
-import com.vmware.gemfire.tools.pulse.internal.service.PulseServiceFactory;
-import com.vmware.gemfire.tools.pulse.internal.service.SystemAlertsService;
-import com.vmware.gemfire.tools.pulse.internal.util.StringUtils;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-/**
- * Class PulseController
- * 
- * This class contains the implementations for all http Ajax requests needs to
- * be served in Pulse.
- * 
- * @since GemFire version 7.5
- */
-@Controller
-public class PulseController {
-
-  private static final PulseLogWriter LOGGER = PulseLogWriter.getLogger();
-
-  // CONSTANTS
-  private final String DEFAULT_EXPORT_FILENAME = "DataBrowserQueryResult.json";
-  private final String QUERYSTRING_PARAM_ACTION = "action";
-  private final String QUERYSTRING_PARAM_QUERYID = "queryId";
-  private final String ACTION_VIEW = "view";
-  private final String ACTION_DELETE = "delete";
-
-  private String STATUS_REPSONSE_SUCCESS = "success";
-  private String STATUS_REPSONSE_FAIL = "fail";
-
-  private String ERROR_REPSONSE_QUERYNOTFOUND = "No queries found";
-  private String ERROR_REPSONSE_QUERYIDMISSING = "Query id is missing";
-
-  private static final String EMPTY_JSON = "{}";
-
-  // Shared object to hold pulse version details
-  public static PulseVersion pulseVersion = new PulseVersion();
-
-  //default is gemfire
-  private static String pulseProductSupport = 
PulseConstants.PRODUCT_NAME_GEMFIRE;
-
-  private final ObjectMapper mapper = new ObjectMapper();
-
-  @Autowired
-  PulseServiceFactory pulseServiceFactory;
-
-  @RequestMapping(value = "/pulseUpdate", method = RequestMethod.POST)
-  public void getPulseUpdate(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    String pulseData = request.getParameter("pulseData");
-
-    ObjectNode responseMap = mapper.createObjectNode();
-
-    JsonNode requestMap = null;
-
-    try {
-      requestMap = mapper.readTree(pulseData);
-      Iterator<?> keys = requestMap.fieldNames();
-
-      // Execute Services
-      while (keys.hasNext()) {
-        String serviceName = keys.next().toString();
-        try {
-          PulseService pulseService = pulseServiceFactory
-              .getPulseServiceInstance(serviceName);
-          responseMap.put(serviceName, pulseService.execute(request));
-        } catch (Exception serviceException) {
-          LOGGER.warning("serviceException [for service "+serviceName+"] = " + 
serviceException.getMessage());
-          responseMap.put(serviceName, EMPTY_JSON);
-        }
-      }
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occurred : " + e.getMessage());
-      }
-    }
-
-    // Create Response
-    response.getOutputStream().write(responseMap.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/authenticateUser", method = RequestMethod.GET)
-  public void authenticateUser(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    // json object to be sent as response
-    ObjectNode responseJSON = mapper.createObjectNode();
-
-    try {
-      responseJSON.put("isUserLoggedIn", this.isUserLoggedIn(request));
-      // Send json response
-      response.getOutputStream().write(responseJSON.toString().getBytes());
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occurred : " + e.getMessage());
-      }
-    }
-  }
-
-  /**
-   * Method isUserLoggedIn Check whether user is logged in or not.
-   * 
-   * @param request
-   * @return boolean
-   */
-  protected boolean isUserLoggedIn(HttpServletRequest request) {
-    return null != request.getUserPrincipal();
-  }
-
-  @RequestMapping(value = "/pulseVersion", method = RequestMethod.GET)
-  public void pulseVersion(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-
-    // json object to be sent as response
-    ObjectNode responseJSON = mapper.createObjectNode();
-
-    try {
-      // Reference to repository
-      Repository repository = Repository.get();
-      // set pulse web app url
-      String pulseWebAppUrl = request.getScheme() + "://"
-          + request.getServerName() + ":" + request.getServerPort()
-          + request.getContextPath();
-
-      repository.setPulseWebAppUrl(pulseWebAppUrl);
-
-      // Response
-      responseJSON.put("pulseVersion", 
PulseController.pulseVersion.getPulseVersion());
-      responseJSON.put("buildId", 
PulseController.pulseVersion.getPulseBuildId());
-      responseJSON.put("buildDate", 
PulseController.pulseVersion.getPulseBuildDate());
-      responseJSON.put("sourceDate", 
PulseController.pulseVersion.getPulseSourceDate());
-      responseJSON.put("sourceRevision", 
PulseController.pulseVersion.getPulseSourceRevision());
-      responseJSON.put("sourceRepository", 
PulseController.pulseVersion.getPulseSourceRepository());
-
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-
-    // Send json response
-    response.getOutputStream().write(responseJSON.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/clearAlerts", method = RequestMethod.GET)
-  public void clearAlerts(HttpServletRequest request, HttpServletResponse 
response) throws IOException {
-    int alertType;
-    ObjectNode responseJSON = mapper.createObjectNode();
-
-    try {
-      alertType = Integer.valueOf(request.getParameter("alertType"));
-    } catch (NumberFormatException e) {
-      // Empty json response
-      response.getOutputStream().write(responseJSON.toString().getBytes());
-      if (LOGGER.finerEnabled()) {
-        LOGGER.finer(e.getMessage());
-      }
-      return;
-    }
-
-    try {
-      boolean isClearAll = Boolean.valueOf(request.getParameter("clearAll"));
-      // get cluster object
-      Cluster cluster = Repository.get().getCluster();
-      cluster.clearAlerts(alertType, isClearAll);
-      responseJSON.put("status", "deleted");
-      responseJSON.put(
-          "systemAlerts", SystemAlertsService.getAlertsJson(cluster,
-              cluster.getNotificationPageNumber()));
-      responseJSON.put("pageNumber", cluster.getNotificationPageNumber());
-
-      boolean isGFConnected = cluster.isConnectedFlag();
-      if(isGFConnected){
-        responseJSON.put("connectedFlag", isGFConnected);
-      }else{
-        responseJSON.put("connectedFlag", isGFConnected);
-        responseJSON.put("connectedErrorMsg", cluster.getConnectionErrorMsg());
-      }
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occurred : " + e.getMessage());
-      }
-    }
-
-    // Send json response
-    response.getOutputStream().write(responseJSON.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/acknowledgeAlert", method = RequestMethod.GET)
-  public void acknowledgeAlert(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    int alertId;
-    ObjectNode responseJSON = mapper.createObjectNode();
-
-    try {
-      alertId = Integer.valueOf(request.getParameter("alertId"));
-    } catch (NumberFormatException e) {
-      // Empty json response
-      response.getOutputStream().write(responseJSON.toString().getBytes());
-      if (LOGGER.finerEnabled()) {
-        LOGGER.finer(e.getMessage());
-      }
-      return;
-    }
-
-    try {
-      // get cluster object
-      Cluster cluster = Repository.get().getCluster();
-
-      // set alert is acknowledged
-      cluster.acknowledgeAlert(alertId);
-      responseJSON.put("status", "deleted");
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-
-    // Send json response
-    response.getOutputStream().write(responseJSON.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/dataBrowserRegions", method = RequestMethod.GET)
-  public void dataBrowserRegions(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    // get cluster object
-    Cluster cluster = Repository.get().getCluster();
-
-    // json object to be sent as response
-    ObjectNode responseJSON = mapper.createObjectNode();
-    ArrayNode regionsData = mapper.createArrayNode();
-
-    try {
-      // getting cluster's Regions
-      responseJSON.put("clusterName", cluster.getServerName());
-      regionsData = getRegionsJson(cluster);
-      responseJSON.put("clusterRegions", regionsData);
-      responseJSON.put("connectedFlag", cluster.isConnectedFlag());
-      responseJSON.put("connectedErrorMsg", cluster.getConnectionErrorMsg());
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-
-    // Send json response
-    response.getOutputStream().write(responseJSON.toString().getBytes());
-  }
-
-  /**
-   * This method creates json for list of cluster regions
-   * 
-   * @param cluster
-   * @return ArrayNode JSON array
-   */
-  private ArrayNode getRegionsJson(Cluster cluster) {
-
-    Collection<Cluster.Region> clusterRegions = 
cluster.getClusterRegions().values();
-    ArrayNode regionsListJson = mapper.createArrayNode();
-
-    if (!clusterRegions.isEmpty()) {
-      for (Cluster.Region region : clusterRegions) {
-        ObjectNode regionJSON = mapper.createObjectNode();
-        regionJSON.put("name", region.getName());
-        regionJSON.put("fullPath", region.getFullPath());
-        regionJSON.put("regionType", region.getRegionType());
-
-        if (region.getRegionType().contains("PARTITION")) {
-          regionJSON.put("isPartition", true);
-        } else {
-          regionJSON.put("isPartition", false);
-        }
-
-        regionJSON.put("memberCount", region.getMemberCount());
-        List<String> regionsMembers = region.getMemberName();
-        ArrayNode jsonRegionMembers = mapper.createArrayNode();
-
-        for (int i = 0; i < regionsMembers.size(); i++) {
-          Cluster.Member member = cluster.getMembersHMap().get(
-              regionsMembers.get(i));
-          ObjectNode jsonMember = mapper.createObjectNode();
-          jsonMember.put("key", regionsMembers.get(i));
-          jsonMember.put("id", member.getId());
-          jsonMember.put("name", member.getName());
-
-          jsonRegionMembers.add(jsonMember);
-        }
-
-        regionJSON.put("members", jsonRegionMembers);
-        regionsListJson.add(regionJSON);
-      }
-    }
-    return regionsListJson;
-  }
-
-  @RequestMapping(value = "/dataBrowserQuery", method = RequestMethod.GET)
-  public void dataBrowserQuery(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    // get query string
-    String query = request.getParameter("query");
-    String members = request.getParameter("members");
-    int limit = 0;
-
-    try {
-      limit = Integer.valueOf(request.getParameter("limit"));
-    } catch (NumberFormatException e) {
-      limit = 0;
-      if (LOGGER.finerEnabled()) {
-        LOGGER.finer(e.getMessage());
-      }
-    }
-
-    ObjectNode queryResult = mapper.createObjectNode();
-    try {
-
-      if (StringUtils.isNotNullNotEmptyNotWhiteSpace(query)) {
-        // get cluster object
-        Cluster cluster = Repository.get().getCluster();
-        String userName = request.getUserPrincipal().getName();
-
-        // Call execute query method
-        queryResult = cluster.executeQuery(query, members, limit);
-
-        // Add query in history if query is executed successfully
-        if (!queryResult.has("error")) {
-          // Add html escaped query to history
-          String escapedQuery = StringEscapeUtils.escapeHtml(query);
-          cluster.addQueryInHistory(escapedQuery, userName);
-        }
-      }
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-
-    response.getOutputStream().write(queryResult.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/dataBrowserQueryHistory", method = 
RequestMethod.GET)
-  public void dataBrowserQueryHistory(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-    ObjectNode responseJSON = mapper.createObjectNode();
-    ArrayNode queryResult = null;
-    String action = "";
-
-    try {
-      // get cluster object
-      Cluster cluster = Repository.get().getCluster();
-      String userName = request.getUserPrincipal().getName();
-
-      // get query string
-      action = request.getParameter(QUERYSTRING_PARAM_ACTION);
-      if (!StringUtils.isNotNullNotEmptyNotWhiteSpace(action)) {
-        action = ACTION_VIEW;
-      }
-
-      if (action.toLowerCase().equalsIgnoreCase(ACTION_DELETE)) {
-        String queryId = request.getParameter(QUERYSTRING_PARAM_QUERYID);
-        if (StringUtils.isNotNullNotEmptyNotWhiteSpace(queryId)) {
-
-          boolean deleteStatus = cluster.deleteQueryById(userName, queryId);
-          if (deleteStatus) {
-            responseJSON.put("status", STATUS_REPSONSE_SUCCESS);
-          } else {
-            responseJSON.put("status", STATUS_REPSONSE_FAIL);
-            responseJSON.put("error", ERROR_REPSONSE_QUERYNOTFOUND);
-          }
-        } else {
-          responseJSON.put("status", STATUS_REPSONSE_FAIL);
-          responseJSON.put("error", ERROR_REPSONSE_QUERYIDMISSING);
-        }
-      }
-
-      // Get list of past executed queries
-      queryResult = cluster.getQueryHistoryByUserId(userName);
-      responseJSON.put("queryHistory", queryResult);
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-    response.getOutputStream().write(responseJSON.toString().getBytes());
-  }
-
-  @RequestMapping(value = "/dataBrowserExport", method = RequestMethod.POST)
-  public void dataBrowserExport(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-
-    // get query string
-    String filename = request.getParameter("filename");
-    String resultContent = request.getParameter("content");
-
-    response.setHeader("Cache-Control", "");
-    response.setHeader("Content-type", "text/plain");
-    if (StringUtils.isNotNullNotEmptyNotWhiteSpace(filename)) {
-      response.setHeader("Content-Disposition", "attachment; filename=" + 
filename);
-    } else {
-      response.setHeader("Content-Disposition", "attachment; filename=" + 
DEFAULT_EXPORT_FILENAME);
-    }
-
-    if (!StringUtils.isNotNullNotEmptyNotWhiteSpace(resultContent)) {
-      resultContent = "";
-    }
-
-    response.getOutputStream().write(resultContent.getBytes());
-  }
-
-  @RequestMapping(value = "/pulseProductSupport", method = RequestMethod.GET)
-  public void getConfiguredPulseProduct(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-      ObjectNode responseJSON = mapper.createObjectNode();
-
-    try {
-      responseJSON.put("product", pulseProductSupport);
-
-      // Send json response
-      response.getOutputStream().write(responseJSON.toString().getBytes());
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occurred : " + e.getMessage());
-      }
-    }
-  }
-
-  @RequestMapping(value = "/getQueryStatisticsGridModel", method = 
RequestMethod.GET)
-  public void getQueryStatisticsGridModel(HttpServletRequest request,
-      HttpServletResponse response) throws IOException {
-
-    ObjectNode responseJSON = mapper.createObjectNode();
-    // get cluster object
-    Cluster cluster = Repository.get().getCluster();
-    String userName = request.getUserPrincipal().getName();
-
-    try {
-      String[] arrColNames = Cluster.Statement.getGridColumnNames();
-      String[] arrColAttribs = Cluster.Statement.getGridColumnAttributes();
-      int[] arrColWidths = Cluster.Statement.getGridColumnWidths();
-
-      ArrayNode colNamesList = mapper.createArrayNode();
-      for (int i = 0; i < arrColNames.length; ++i) {
-        colNamesList.add(arrColNames[i]);
-      }
-
-      ArrayNode colModelList = mapper.createArrayNode();
-      for (int i = 0; i < arrColAttribs.length; ++i) {
-        ObjectNode columnJSON = mapper.createObjectNode();
-        columnJSON.put("name", arrColAttribs[i]);
-        columnJSON.put("index", arrColAttribs[i]);
-        columnJSON.put("width", arrColWidths[i]);
-        columnJSON.put("sortable", "true");
-        columnJSON.put("sorttype", ((i == 0) ? "String" : "integer"));
-        colModelList.add(columnJSON);
-      }
-
-      responseJSON.put("columnNames", colNamesList);
-      responseJSON.put("columnModels", colModelList);
-      responseJSON.put("clusterName", cluster.getServerName());
-      responseJSON.put("userName", userName);
-
-      // Send json response
-      response.getOutputStream().write(responseJSON.toString().getBytes());
-    } catch (Exception e) {
-      if (LOGGER.fineEnabled()) {
-        LOGGER.fine("Exception Occured : " + e.getMessage());
-      }
-    }
-  }
-
-  /**
-   * @return the pulseProductSupport
-   */
-  public static String getPulseProductSupport() {
-    return pulseProductSupport;
-  }
-
-  /**
-   * @param pulseProductSupport
-   *          the pulseProductSupport to set
-   */
-  public static void setPulseProductSupport(String pulseProductSupport) {
-    PulseController.pulseProductSupport = pulseProductSupport;
-  }
-}
\ No newline at end of file

Reply via email to