geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [47/50] [abbrv] incubator-geode git commit: Merge branch 'develop' into feature/GEODE-17
Date Mon, 07 Dec 2015 17:06:29 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/DiskStoreMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/DistributedSystemMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/GatewayReceiverMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/GatewaySenderMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/LockServiceMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/ManagerMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/MemberMXBean.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/SystemManagementService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/DataCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ExportImportSharedConfigurationCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/GfshHelpCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/PDXCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java
index d173c97,edab207..2dfac0a
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java
@@@ -214,24 -206,19 +222,25 @@@ public class ShellCommands implements C
              url = url.replace("http:", "https:");
            }
          }
-         
+ 
 +        Map<String,String> securityProperties = new HashMap<String, String>();
 +        
 +        Iterator<String> it = sslConfigProps.keySet().iterator();
 +        while(it.hasNext()){
 +          String secKey = it.next();
 +          securityProperties.put(secKey, sslConfigProps.get(secKey));
 +        }
-         
-         LogWrapper.getInstance().warning(String.format("Sending HTTP request for Link Index at (%1$s)...", url.concat("/index")));
 +
-         LinkIndex linkIndex = new SimpleHttpRequester(gemfireShell, CONNECT_LOCATOR_TIMEOUT_MS, securityProperties).exchange(url.concat("/index"), LinkIndex.class);
+         // This is so that SSL termination results in https URLs being returned
+         String query = (url.startsWith("https")) ? "?scheme=https" : "";
  
-         LogWrapper.getInstance().warning(String.format("Received Link Index (%1$s)", linkIndex.toString()));
 -        LogWrapper.getInstance().warning(String.format("Sending HTTP request for Link Index at (%1$s)...", url.concat("/index")));
++        LogWrapper.getInstance().warning(String.format("Sending HTTP request for Link Index at (%1$s)...", url.concat("/index").concat(query)));
  
-         
 -        LinkIndex linkIndex = new SimpleHttpRequester(CONNECT_LOCATOR_TIMEOUT_MS).get(url.concat("/index").concat(query), LinkIndex.class);
++        LinkIndex linkIndex = new SimpleHttpRequester(gemfireShell, CONNECT_LOCATOR_TIMEOUT_MS, securityProperties).exchange(url.concat("/index").concat(query), LinkIndex.class);
+ 
+         LogWrapper.getInstance().warning(String.format("Received Link Index (%1$s)", linkIndex.toString()));
  
 -        Gfsh gemfireShell = getGfsh();
 -
 -        HttpOperationInvoker operationInvoker = new RestHttpOperationInvoker(linkIndex, gemfireShell, url);
 +        HttpOperationInvoker operationInvoker = new RestHttpOperationInvoker(linkIndex, gemfireShell, url, securityProperties);
  
          Initializer.init(operationInvoker);
          gemfireShell.setOperationInvoker(operationInvoker);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/StatusCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/WanCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/shell/JmxOperationInvoker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlContext.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlContext.java
index e44dc18,225d766..8153149
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlContext.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlContext.java
@@@ -1,14 -1,21 +1,30 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +/**
 + * 
 + * ResourceOperationContext passed to AccessControlMBean for Authorization calls made
 + * from AccessControlMBean
 + * 
 + * @author tushark
 + * @since 9.0
 + *
 + */
  public class AccessControlContext extends ResourceOperationContext {
    
    private ResourceOperationCode code;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlMXBean.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlMXBean.java
index acd0ca3,68c3d64..144b90a
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlMXBean.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/AccessControlMXBean.java
@@@ -1,13 -1,23 +1,29 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +/**
 + * Interface for AccessControlMBean
 + * @author tushark
 + * @since 9.0
 + */
  public interface AccessControlMXBean {
  
 +  @ResourceOperation(resource=Resource.MEMBER, operation=ResourceConstants.LIST_DS)
    public boolean authorize(String role);
    
  }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/CLIOperationContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/JMXOperationContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/MBeanServerWrapper.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ManagementInterceptor.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ManagementInterceptor.java
index 9158ddd,c4e7dc5..aa972c5
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ManagementInterceptor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ManagementInterceptor.java
@@@ -1,19 -1,22 +1,35 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.ACCESS_DENIED_MESSAGE;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.GET_ATTRIBUTE;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.GET_ATTRIBUTES;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.GET_PREFIX;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.PASSWORD;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.PROCESS_COMMAND;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.SET_ATTRIBUTE;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.SET_ATTRIBUTES;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.SET_PREFIX;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.USER_NAME;
 +import static com.gemstone.gemfire.management.internal.security.ResourceConstants.WRONGE_CREDENTIALS_MESSAGE;
 +
  import java.lang.management.ManagementFactory;
 +import java.lang.reflect.Method;
  import java.security.AccessControlContext;
  import java.security.AccessController;
  import java.security.Principal;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/Resource.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/Resource.java
index 68b0468,5a47c07..d6252d5
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/Resource.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/Resource.java
@@@ -1,11 -1,21 +1,27 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +/**
 + * 
 + * @author tushark
 + *
 + * @since 9.0
 + */
  public enum Resource {
    DISTRIBUTED_SYSTEM,
    MEMBER,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceConstants.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceConstants.java
index 01abb8c,3a8bbbf..14d4639
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceConstants.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceConstants.java
@@@ -1,32 -1,53 +1,48 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +/**
 + * 
 + * @author tushark
 + *
 + * @since 9.0
 + */
  public class ResourceConstants {
 -	
 -	//public static final String LIST_DS = "LIST_DS";
 -	public static final String READ_DS = "READ_DS";
 -	public static final String SET_DS = "SET_DS";
 -	public static final String CHANGE_ALERT_LEVEL_DS = "CHANGE_ALERT_LEVEL_DS";
 -	public static final String BACKUP_DS = "BACKUP_DS";
 -	public static final String REMOVE_DISKSTORE_DS = "REMOVE_DISKSTORE_DS";
 -	public static final String SHUTDOWN_DS = "SHUTDOWN_DS";
 -	public static final String QUERYDATA_DS = "QUERYDATA_DS";
 -	public static final String ADMIN_DS = "ADMIN_DS";
 -	
 -	/*
 -	public static final String REBALANCE = "REBALANCE";
 -	public static final String PUT = "PUT";
 -	public static final String EXPORT_DATA = "EXPORT_DATA";
 -	public static final String IMPORT_DATA = "IMPORT_DATA";
 -	public static final String LOCATE_ENTRY = "LOCATE_ENTRY";*/
 -	
 -	public static final String PULSE_DASHBOARD = "PULSE_DASHBOARD";
 -  public static final String PULSE_DATABROWSER = "PULSE_DATABROWSER";
 -  public static final String PULSE_ADMIN_V1 = "PULSE_ADMIN_V1";
 -  public static final String PULSE_WEBGFSH = "PULSE_WEBGFSH";  
 -	
 -	public static final String DEFAULT_LABEL="";
 -	
 -	public static final String RESORUCE_SEC_DESCRIPTOR = "resource.secDescriptor";
 -	public static final String RESORUCE_AUTH_ACCESSOR = "resource-auth-accessor";
 -	public static final String RESORUCE_AUTHENTICATOR = "resource-authenticator";
 -  public static final String RESORUCE_DEFAULT_SEC_DESCRIPTOR = "resourceSecDesc.json";
    
 -  //All ResourceOperation Codes
 +  public static final String DEFAULT_LABEL="";
 +  
 +  public static final String RESORUCE_SEC_DESCRIPTOR = "resource.secDescriptor";
 +  public static final String RESORUCE_AUTH_ACCESSOR = "resource-auth-accessor";
 +  public static final String RESORUCE_AUTHENTICATOR = "resource-authenticator";
 +  public static final String RESORUCE_DEFAULT_SEC_DESCRIPTOR = "resourceSecDesc.json";
 +  public static final String CREATE_MBEAN = "createMBean";
 +  public static final String UNREGISTER_MBEAN = "unregisterMBean";
 +  public static final String SET_PREFIX = "set";
 +  public static final String SET_ATTRIBUTE = "setAttribute";
 +  public static final String SET_ATTRIBUTES= "setAttributes";
 +  public static final String GET_ATTRIBUTES= "getAttributes";
 +  public static final String GET_ATTRIBUTE = "getAttribute";
 +  public static final String GET_PREFIX = "get";
 +  public static final String GET_IS_PREFIX = "is";
 +  public static final String REGISTER_MBEAN = "registerMBean";
 +  public static final String PROCESS_COMMAND ="processCommand";
 +  public static final String ACCESS_DENIED_MESSAGE = "Access Denied";
 +  public static final String WRONGE_CREDENTIALS_MESSAGE = "Wrong Credentials";
    
    public static final String ALTER_REGION = "ALTER_REGION";
    public static final String ALTER_RUNTIME = "ALTER_RUNTIME";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceOperation.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContext.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContext.java
index c88e42c,50b22a3..dfbf926
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContext.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContext.java
@@@ -1,9 -1,22 +1,25 @@@
+ /*
+  * 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.gemstone.gemfire.management.internal.security;
  
 +import java.util.ArrayList;
 +import java.util.Collections;
  import java.util.HashMap;
 +import java.util.List;
  import java.util.Map;
  
  import com.gemstone.gemfire.cache.operations.OperationContext;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java
index 0aa614f,41a890a..47c6b17
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java
@@@ -64,9 -55,9 +73,10 @@@ import org.springframework.web.bind.Web
  import org.springframework.web.bind.annotation.ExceptionHandler;
  import org.springframework.web.bind.annotation.InitBinder;
  import org.springframework.web.bind.annotation.ResponseBody;
 +import org.springframework.web.bind.annotation.ResponseStatus;
  import org.springframework.web.context.request.WebRequest;
  import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+ import org.springframework.web.util.UriComponentsBuilder;
  
  /**
   * The AbstractCommandsController class is the abstract base class encapsulating common functionality across all

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/ConfigCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/DataCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/DiskStoreCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/FunctionCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/MiscellaneousCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/http/support/SimpleHttpRequester.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/shell/AbstractHttpOperationInvoker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvoker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvoker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
index 5a9cd77,392b5dd..4534747
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
@@@ -11,12 -20,12 +20,11 @@@ import com.gemstone.gemfire.cache.*
  import com.gemstone.gemfire.distributed.internal.DistributionConfig;
  import com.gemstone.gemfire.internal.AvailablePort;
  import com.gemstone.gemfire.internal.AvailablePortHelper;
--import com.gemstone.gemfire.internal.cache.PartitionedRegion;
  import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl;
- import com.gemstone.gemfire.cache30.BridgeTestCase;
+ import com.gemstone.gemfire.cache30.ClientServerTestCase;
  import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
  import com.gemstone.gemfire.cache.client.*;
- import com.gemstone.gemfire.cache.util.BridgeServer;
+ import com.gemstone.gemfire.cache.server.CacheServer;
  
  import dunit.*;
  

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/MockExtensionCommands.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CommandManagerJUnitTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/shell/GfshExecutionStrategyJUnitTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationJUnit.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestTestUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-core/src/test/java/dunit/DistributedTestCase.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/dunit/DistributedTestCase.java
index 2e7ac03,a3d4785..81681b2
--- a/gemfire-core/src/test/java/dunit/DistributedTestCase.java
+++ b/gemfire-core/src/test/java/dunit/DistributedTestCase.java
@@@ -177,7 -191,7 +191,7 @@@ public abstract class DistributedTestCa
     * DUnit knows about.
     *
     * @return a Map of results, where the key is the VM and the value is the result
--   * @see VM#invoke(Callable)
++   * @see VM#invoke(java.util.concurrent.Callable)
     */
    protected static Map invokeInEveryVM(SerializableCallable work) {
      HashMap ret = new HashMap();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/build.gradle
----------------------------------------------------------------------
diff --cc gemfire-web-api/build.gradle
index 9552975,476872f..0669e0e
--- a/gemfire-web-api/build.gradle
+++ b/gemfire-web-api/build.gradle
@@@ -1,37 -1,31 +1,37 @@@
  apply plugin: 'war'
  
  dependencies {
-   compile 'commons-lang:commons-lang:2.4'
-   compile 'commons-fileupload:commons-fileupload:1.3.1'
-   compile 'com.fasterxml:classmate:0.9.0'
-   compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.0'
-   compile 'com.fasterxml.jackson.core:jackson-core:2.2.0'
-   compile 'com.fasterxml.jackson.core:jackson-databind:2.2.0'
-   compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.1.5'
-   compile 'com.google.guava:guava:15.0'
-   compile 'com.mangofactory:swagger-springmvc:0.8.2'
-   compile 'org.json4s:json4s-ast_2.10:3.2.4'
-   compile 'org.json4s:json4s-ext_2.10:3.2.4'
-   compile 'org.json4s:json4s-core_2.10:3.2.4'
-   compile 'org.json4s:json4s-jackson_2.10:3.2.4'
-   compile 'org.json4s:json4s-native_2.10:3.2.4'
-   compile 'org.scala-lang:scala-reflect:2.10.0'
-   compile 'org.scala-lang:scala-library:2.10.0'
-   compile 'org.springframework.hateoas:spring-hateoas:0.16.0.RELEASE'
-   compile 'org.springframework:spring-aspects:3.2.12.RELEASE'
-   compile 'org.springframework:spring-oxm:3.2.12.RELEASE'
-   compile 'com.thoughtworks.paranamer:paranamer:2.3'
-   compile 'com.wordnik:swagger-annotations:1.3.2'
-   compile 'com.wordnik:swagger-core_2.10:1.3.2'
- 
-   provided 'javax.servlet:javax.servlet-api:3.1.0'
+   compile 'commons-lang:commons-lang:' + project.'commons-lang.version'
+   compile 'commons-fileupload:commons-fileupload:' + project.'commons-fileupload.version'
+   compile 'com.fasterxml:classmate:' + project.'classmate.version'
+   compile 'com.fasterxml.jackson.core:jackson-annotations:' + project.'jackson.version'
+   compile 'com.fasterxml.jackson.core:jackson-core:' + project.'jackson.version'
+   compile 'com.fasterxml.jackson.core:jackson-databind:' + project.'jackson.version'
+   compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:' + project.'jackson-module-scala_2.10.version'
+   compile 'com.google.guava:guava:' + project.'guava.version'
+   compile 'com.mangofactory:swagger-springmvc:' + project.'swagger-springmvc.version'
+   compile 'com.thoughtworks.paranamer:paranamer:' + project.'paranamer.version'
+   compile 'com.wordnik:swagger-annotations:' + project.'swagger.version'
+   compile 'com.wordnik:swagger-core_2.10:' + project.'swagger.version'
+   compile 'org.json4s:json4s-ast_2.10:' + project.'json4s.version'
+   compile 'org.json4s:json4s-ext_2.10:' + project.'json4s.version'
+   compile 'org.json4s:json4s-core_2.10:' + project.'json4s.version'
+   compile 'org.json4s:json4s-jackson_2.10:' + project.'json4s.version'
+   compile 'org.json4s:json4s-native_2.10:' + project.'json4s.version'
+   compile 'org.scala-lang:scala-library:' + project.'scala.version'
+   compile 'org.scala-lang:scala-reflect:' + project.'scala.version'
+   compile 'org.springframework.hateoas:spring-hateoas:' + project.'spring-hateos.version'
+   compile 'org.springframework:spring-aspects:' + project.'springframework.version'
+   compile 'org.springframework:spring-oxm:' + project.'springframework.version'
+ 
+   provided 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
    provided project(':gemfire-core')
 +  
 +  testCompile 'org.apache.httpcomponents:httpclient:4.3.3'
 +  testCompile 'org.apache.httpcomponents:httpcore:4.3.3'
 +    
 +  provided project(path: ':gemfire-junit', configuration: 'testOutput')
 +  provided project(path: ':gemfire-core', configuration: 'testOutput')
  }
  
  jar {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/AbstractBaseController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/BaseControllerAdvice.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/CommonCrudController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/FunctionAccessController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/PdxBasedCrudController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/java/com/gemstone/gemfire/rest/internal/web/controllers/QueryAccessController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/gemfire-web-api/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpISDUnitTest.java
----------------------------------------------------------------------
diff --cc gemfire-web-api/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpISDUnitTest.java
index 8e02a8f,0000000..460f81a
mode 100644,000000..100644
--- a/gemfire-web-api/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpISDUnitTest.java
+++ b/gemfire-web-api/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpISDUnitTest.java
@@@ -1,996 -1,0 +1,996 @@@
 +package com.gemstone.gemfire.rest.internal.web.controllers;
 +
 +import java.io.BufferedReader;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.InputStreamReader;
 +import java.util.Arrays;
 +import java.util.Calendar;
 +import java.util.HashMap;
 +import java.util.Map;
 +import java.util.Properties;
 +
++import com.gemstone.gemfire.cache.server.CacheServer;
 +import org.apache.http.HttpEntity;
 +import org.apache.http.client.ClientProtocolException;
 +import org.apache.http.client.methods.CloseableHttpResponse;
 +import org.apache.http.client.methods.HttpDelete;
 +import org.apache.http.client.methods.HttpGet;
 +import org.apache.http.client.methods.HttpPost;
 +import org.apache.http.client.methods.HttpPut;
 +import org.apache.http.entity.StringEntity;
 +import org.apache.http.impl.client.CloseableHttpClient;
 +import org.apache.http.impl.client.HttpClients;
 +//import com.gemstone.gemfire.rest.internal.web.util.DateTimeUtils;
 +import org.json.JSONArray;
 +import org.json.JSONException;
 +import org.json.JSONObject;
 +
 +import util.TestException;
 +
 +import com.gemstone.gemfire.cache.AttributesFactory;
 +import com.gemstone.gemfire.cache.Cache;
 +import com.gemstone.gemfire.cache.CacheFactory;
 +import com.gemstone.gemfire.cache.DataPolicy;
 +import com.gemstone.gemfire.cache.Region;
 +import com.gemstone.gemfire.cache.RegionAttributes;
 +import com.gemstone.gemfire.cache.RegionFactory;
 +import com.gemstone.gemfire.cache.RegionShortcut;
 +import com.gemstone.gemfire.cache.client.ClientCache;
 +import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 +import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 +import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 +import com.gemstone.gemfire.cache.client.internal.LocatorTestBase;
 +import com.gemstone.gemfire.cache.server.ServerLoadProbe;
- import com.gemstone.gemfire.cache.util.BridgeServer;
 +import com.gemstone.gemfire.distributed.DistributedSystem;
 +import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 +import com.gemstone.gemfire.internal.AvailablePort;
 +import com.gemstone.gemfire.internal.AvailablePortHelper;
 +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 +import com.gemstone.gemfire.management.ManagementTestBase;
 +import com.gemstone.gemfire.management.internal.security.CommandTestBase;
 +import com.gemstone.gemfire.pdx.PdxInstance;
 +
 +import dunit.Host;
 +import dunit.SerializableCallable;
 +import dunit.SerializableRunnable;
 +import dunit.VM;
 +
 +/**
 + * Dunit Test containing inter - operations between REST Client and Gemfire cache client
 + * @author Nilkanth Patel
 + * @since 8.0
 + */
 +
 +public class RestAPIsAndInterOpISDUnitTest extends LocatorTestBase {
 +  
 +  private static final long serialVersionUID = -254776154266339226L;
 +
 +  private ManagementTestBase helper;
 +
 +  public static final String PEOPLE_REGION_NAME = "People";
 +
 +  //private static RestTemplate restTemplate;
 +
 +  private static final String findAllPeopleQuery = "/queries?id=findAllPeople&q=SELECT%20*%20FROM%20/People";
 +  private static final String findPeopleByGenderQuery = "/queries?id=filterByGender&q=SELECT%20*%20from%20/People%20where%20gender=$1";
 +  private static final String findPeopleByLastNameQuery = "/queries?id=filterByLastName&q=SELECT%20*%20from%20/People%20where%20lastName=$1";
 +
 +  private static final String[] PARAM_QUERY_IDS_ARRAY = { "findAllPeople",
 +      "filterByGender", "filterByLastName" };
 +  
 +  final static String QUERY_ARGS = "["
 +      + "{"
 +      + "\"@type\": \"string\","
 +      + "\"@value\": \"Patel\""
 +      + "}"
 +      + "]";
 +
 +  final static String PERSON_AS_JSON_CAS = "{"
 +      + "\"@old\" :" 
 +      + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 101," + " \"firstName\": \"Mithali\","
 +      + " \"middleName\": \"Dorai\"," + " \"lastName\": \"Raj\","
 +      + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\"" 
 +      + "},"
 +      + "\"@new\" :" 
 +      + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 1101," + " \"firstName\": \"Virat\","
 +      + " \"middleName\": \"Premkumar\"," + " \"lastName\": \"Kohli\","
 +      + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\"" 
 +      + "}"
 +      + "}";
 +    
 +  final static String PERSON_AS_JSON_REPLACE = "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 501," + " \"firstName\": \"Barack\","
 +      + " \"middleName\": \"Hussein\"," + " \"lastName\": \"Obama\","
 +      + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\"" 
 +      + "}";
 +  
 +  private static final String PERSON_LIST_AS_JSON = "[" + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 3," + " \"firstName\": \"Nishka3\","
 +      + " \"middleName\": \"Nilkanth3\"," + " \"lastName\": \"Patel3\","
 +      + " \"birthDate\": \"07/31/2009\"," + "\"gender\": \"FEMALE\"" + "},"
 +      + "{" + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 4," + " \"firstName\": \"Tanay4\","
 +      + " \"middleName\": \"kiran4\"," + " \"lastName\": \"Patel4\","
 +      + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}," + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 5," + " \"firstName\": \"Nishka5\","
 +      + " \"middleName\": \"Nilkanth5\"," + " \"lastName\": \"Patel5\","
 +      + " \"birthDate\": \"31/09/2009\"," + "\"gender\": \"FEMALE\"" + "},"
 +      + "{" + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 6," + " \"firstName\": \"Tanay6\","
 +      + " \"middleName\": \"Kiran6\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}," + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 7," + " \"firstName\": \"Nishka7\","
 +      + " \"middleName\": \"Nilkanth7\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"31/09/2009\"," + "\"gender\": \"FEMALE\"" + "},"
 +      + "{" + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 8," + " \"firstName\": \"Tanay8\","
 +      + " \"middleName\": \"kiran8\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}," + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 9," + " \"firstName\": \"Nishka9\","
 +      + " \"middleName\": \"Nilkanth9\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"31/09/2009\"," + "\"gender\": \"FEMALE\"" + "},"
 +      + "{" + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 10," + " \"firstName\": \"Tanay10\","
 +      + " \"middleName\": \"kiran10\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}," + "{"
 +      + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 11," + " \"firstName\": \"Nishka11\","
 +      + " \"middleName\": \"Nilkanth11\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"31/09/2009\"," + "\"gender\": \"FEMALE\"" + "},"
 +      + "{" + "\"@type\": \"com.gemstone.gemfire.rest.internal.web.controllers.Person\","
 +      + "\"id\": 12," + " \"firstName\": \"Tanay12\","
 +      + " \"middleName\": \"kiran12\"," + " \"lastName\": \"Patel\","
 +      + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}" + "]";
 +
 +  public RestAPIsAndInterOpISDUnitTest(String name) {
 +    super(name);
 +    this.helper = new ManagementTestBase(name);
 +
 +  }
 +
 +  public void setUp() throws Exception {
 +    disconnectAllFromDS();
 +    super.setUp();
 +  }
 +
 +  public void tearDown2() throws Exception {
 +    super.tearDown2();
 +    disconnectAllFromDS();
 +  }
 +  
 +  public static String startBridgeServerWithRestServiceOnInVM(VM vm, final String[] groups, final String locators, final String[] regions, final ServerLoadProbe probe) {
 +    
 +    final String hostName = vm.getHost().getHostName(); 
 +    final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
 +    
 +    //create Cache of given VM and start HTTP service with REST APIs service
 +    new RestAPIsAndInterOpISDUnitTest("temp").startBridgeServer(hostName, serverPort, groups, locators, regions, probe);
 +   
 +    String restEndPoint =  "http://" + hostName + ":" + serverPort + "/gemfire-api/v1";
 +    return restEndPoint;
 +  }
 +  
 +  @SuppressWarnings("deprecation")
 +  protected int startBridgeServer(String hostName, int restServicerPort, final String[] groups, final String locators, final String[] regions, final ServerLoadProbe probe) {
 +            
 +    Properties props = new Properties();
 +    props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
 +    props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
 +    props.setProperty(DistributionConfig.START_DEV_REST_API_NAME, "true");
 +    props.setProperty(DistributionConfig.HTTP_SERVICE_BIND_ADDRESS_NAME, hostName);
 +    props.setProperty(DistributionConfig.HTTP_SERVICE_PORT_NAME, String.valueOf(restServicerPort));
 +    
 +    //Add security properties
 +    props.setProperty(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthenticator.create");
 +    props.setProperty(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthorization.create");
 +    //props.setProperty(DistributionConfig.SECURITY_CLIENT_ACCESSOR_PP_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthorization.create");
 +    props.setProperty(DistributionConfig.SECURITY_REST_TOKEN_SERVICE_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.DummyTokenService.create");
 +    
 +    DistributedSystem ds = getSystem(props);
 +    Cache cache = CacheFactory.create(ds);
 +    ((GemFireCacheImpl)cache).setReadSerialized(true);
 +    AttributesFactory factory = new AttributesFactory();
 +    
 +    factory.setEnableBridgeConflation(true);
 +    factory.setDataPolicy(DataPolicy.REPLICATE);
 +    RegionAttributes attrs = factory.create();
 +    for(int i = 0; i < regions.length; i++) {
 +      cache.createRegion(regions[i], attrs);
 +    }
 +    
-     BridgeServer server = cache.addBridgeServer();
++    CacheServer server = cache.addCacheServer();
 +    final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
 +    server.setPort(serverPort);
 +    server.setGroups(groups);
 +    server.setLoadProbe(probe);
 +    try {
 +      server.start();
 +    } catch (IOException e) {
 +      e.printStackTrace();
 +    }
 +    remoteObjects.put(CACHE_KEY, cache);
 +    return new Integer(serverPort);
 +  }
 +  
 +  public static void doPutsInClientCache() {
 +    ClientCache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +    Region<String, Object> region = cache.getRegion(PEOPLE_REGION_NAME);
 +   
 +    //put person object
 +    final Person person1 = new Person(101L, "Mithali", "Dorai", "Raj", DateTimeUtils.createDate(1982, Calendar.DECEMBER, 4), Gender.FEMALE);
 +    final Person person2 = new Person(102L, "Sachin", "Ramesh", "Tendulkar", DateTimeUtils.createDate(1975, Calendar.DECEMBER, 14), Gender.MALE);
 +    final Person person3 = new Person(103L, "Saurabh", "Baburav", "Ganguly", DateTimeUtils.createDate(1972, Calendar.AUGUST, 29), Gender.MALE);
 +    final Person person4 = new Person(104L, "Rahul", "subrymanyam", "Dravid", DateTimeUtils.createDate(1979, Calendar.MARCH, 17), Gender.MALE);
 +    final Person person5 = new Person(105L, "Jhulan", "Chidambaram", "Goswami", DateTimeUtils.createDate(1983, Calendar.NOVEMBER, 25), Gender.FEMALE);
 +   
 +    region.put("1", person1);
 +    region.put("2", person2);
 +    region.put("3", person3);
 +    region.put("4", person4);
 +    region.put("5", person5);
 +    
 +    final Person person6 = new Person(101L, "Rahul", "Rajiv", "Gndhi", DateTimeUtils.createDate(1970, Calendar.MAY, 14), Gender.MALE);
 +    final Person person7 = new Person(102L, "Narendra", "Damodar", "Modi", DateTimeUtils.createDate(1945, Calendar.DECEMBER, 24), Gender.MALE);
 +    final Person person8 = new Person(103L, "Atal", "Bihari", "Vajpayee", DateTimeUtils.createDate(1920, Calendar.AUGUST, 9), Gender.MALE);
 +    final Person person9 = new Person(104L, "Soniya", "Rajiv", "Gandhi", DateTimeUtils.createDate(1929, Calendar.MARCH, 27), Gender.FEMALE);
 +    final Person person10 = new Person(104L, "Priyanka", "Robert", "Gandhi", DateTimeUtils.createDate(1973, Calendar.APRIL, 15), Gender.FEMALE);
 +    
 +    final Person person11 = new Person(104L, "Murali", "Manohar", "Joshi", DateTimeUtils.createDate(1923, Calendar.APRIL, 25), Gender.MALE);
 +    final Person person12 = new Person(104L, "Lalkrishna", "Parmhansh", "Advani", DateTimeUtils.createDate(1910, Calendar.JANUARY, 01), Gender.MALE);
 +    final Person person13 = new Person(104L, "Shushma", "kumari", "Swaraj", DateTimeUtils.createDate(1943, Calendar.AUGUST, 10), Gender.FEMALE);
 +    final Person person14 = new Person(104L, "Arun", "raman", "jetly", DateTimeUtils.createDate(1942, Calendar.OCTOBER, 27), Gender.MALE);
 +    final Person person15 = new Person(104L, "Amit", "kumar", "shah", DateTimeUtils.createDate(1958, Calendar.DECEMBER, 21), Gender.MALE);
 +    final Person person16 = new Person(104L, "Shila", "kumari", "Dixit", DateTimeUtils.createDate(1927, Calendar.FEBRUARY, 15), Gender.FEMALE);
 +    
 +    Map<String, Object> userMap = new HashMap<String, Object>();
 +    userMap.put("6", person6);
 +    userMap.put("7", person7);
 +    userMap.put("8", person8);
 +    userMap.put("9", person9);
 +    userMap.put("10", person10);
 +    userMap.put("11", person11);
 +    userMap.put("12", person12);
 +    userMap.put("13", person13);
 +    userMap.put("14", person14);
 +    userMap.put("15", person15);
 +    userMap.put("16", person16);
 +    
 +    region.putAll(userMap);
 +    
 +    if (cache != null)
 +      cache.getLogger().info("Gemfire Cache Client: Puts successfully done");
 +  }
 +
 +  public static void doQueryOpsUsingRestApis(String restEndpoint) {
 +    String currentQueryOp = null;
 +    try {
 +      // Query TestCase-1 :: Prepare parameterized Queries
 +      {
 +        currentQueryOp = "findAllPeopleQuery";
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpPost post = new HttpPost(restEndpoint + findAllPeopleQuery);
 +        post.addHeader("Content-Type", "application/json");
 +        post.addHeader("Accept", "application/json");
 +        post.addHeader("security-username", "admin");
 +        post.addHeader("security-password", "admin");
 +        
 +        CloseableHttpResponse createNamedQueryResponse = httpclient.execute(post);
 +        assertEquals(createNamedQueryResponse.getStatusLine().getStatusCode(), 201);
 +        assertNotNull(createNamedQueryResponse.getEntity());
 +        createNamedQueryResponse.close();        
 +        
 +
 +        post = new HttpPost(restEndpoint + findPeopleByGenderQuery);
 +        post.addHeader("Content-Type", "application/json");
 +        post.addHeader("Accept", "application/json");
 +        post.addHeader("security-username", "admin");
 +        post.addHeader("security-password", "admin");
 +        
 +        createNamedQueryResponse = httpclient.execute(post);
 +        assertEquals(createNamedQueryResponse.getStatusLine().getStatusCode(), 201);
 +        assertNotNull(createNamedQueryResponse.getEntity());
 +        createNamedQueryResponse.close();
 +        
 +
 +        post = new HttpPost(restEndpoint + findPeopleByLastNameQuery);
 +        post.addHeader("Content-Type", "application/json");
 +        post.addHeader("Accept", "application/json");
 +        post.addHeader("security-username", "admin");
 +        post.addHeader("security-password", "admin");
 +        createNamedQueryResponse = httpclient.execute(post);
 +        assertEquals(createNamedQueryResponse.getStatusLine().getStatusCode(), 201);
 +        assertNotNull(createNamedQueryResponse.getEntity());
 +        createNamedQueryResponse.close();
 +      }
 +      
 +      // Query TestCase-2 :: List all parameterized queries
 +      {
 +        currentQueryOp = "listAllQueries";
 +        HttpGet get = new HttpGet(restEndpoint + "/queries");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse listAllQueriesResponse = httpclient.execute(get);
 +        assertEquals(listAllQueriesResponse.getStatusLine().getStatusCode(), 200);
 +        assertNotNull(listAllQueriesResponse.getEntity());
 +        
 +        HttpEntity entity = listAllQueriesResponse.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer sb = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          sb.append(line);
 +        }
 +        listAllQueriesResponse.close();
 +      
 +        // Check whether received response contains expected query IDs.
 +
 +        JSONObject jsonObject = new JSONObject(sb.toString());
 +        JSONArray jsonArray = jsonObject.getJSONArray("queries");
 +        for (int i = 0; i < jsonArray.length(); i++) {
 +          assertTrue(
 +            "PREPARE_PARAMETERIZED_QUERY: function IDs are not matched",
 +            Arrays.asList(PARAM_QUERY_IDS_ARRAY).contains(
 +                jsonArray.getJSONObject(i).getString("id")));
 +        }
 +      }  
 +      
 +      // Query TestCase-3 :: Run the specified named query passing in scalar values for query parameters.
 +      {
 +        currentQueryOp = "filterByLastName";
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpPost post = new HttpPost(restEndpoint + "/queries/filterByLastName");
 +        post.addHeader("Content-Type", "application/json");
 +        post.addHeader("Accept", "application/json");
 +        post.addHeader("security-username", "admin");
 +        post.addHeader("security-password", "admin");
 +        
 +        StringEntity entity = new StringEntity(QUERY_ARGS);       
 +        post.setEntity(entity);
 +        CloseableHttpResponse runNamedQueryResponse = httpclient.execute(post);
 +
 +        assertEquals(200, runNamedQueryResponse.getStatusLine().getStatusCode());
 +        assertNotNull(runNamedQueryResponse.getEntity());
 +      }
 +    } catch ( Exception e ) {
 +      throw new TestException(CommandTestBase.getStackTrace(e));
 +    }
 +  }
 +  
 +  public static void verifyUpdatesInClientCache() {
 +    ClientCache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +    Region<String, Object> region = cache.getRegion(PEOPLE_REGION_NAME);
 +    
 +    {
 +      Person expectedPerson = new Person(3L, "Nishka3", "Nilkanth3", "Patel3", DateTimeUtils.createDate(2009, Calendar.JULY, 31), Gender.FEMALE );
 +      Object value = region.get("3");
 +      if (value instanceof PdxInstance) {
 +        PdxInstance pi3  = (PdxInstance) value;
 +        Person actualPerson = (Person) pi3.getObject();
 +        assertEquals(actualPerson.getId(), expectedPerson.getId());
 +        assertEquals(actualPerson.getFirstName(), expectedPerson.getFirstName());
 +        assertEquals(actualPerson.getMiddleName(), expectedPerson.getMiddleName());
 +        assertEquals(actualPerson.getLastName(), expectedPerson.getLastName());
 +        assertEquals(actualPerson.getBirthDate(), expectedPerson.getBirthDate());
 +        assertEquals(actualPerson.getGender(), expectedPerson.getGender());
 +      } else if (value instanceof Person) {
 +        fail("VerifyUpdatesInClientCache, Get on key 3, Expected to get value of type PdxInstance ");
 +      }
 +    }
 +     
 +    
 +    //TODO: uncomment it once following issue encountered in put?op=CAS is fixed or document the issue
 +    // CAS functionality is not working in following test case
 +    // step-1: Java client, Region.put("K", A);
 +    //Step-2: Rest CAS request for key "K" with data "@old" = A. CAS is failing as existing PdxInstance in cache and
 +    //        PdxInstance generated from JSON (CAS request) does not match as their value's type are getting changed 
 +    /*
 +    //verify update on key "1"
 +    {
 +      Object obj = region.get("1");
 +      if (obj instanceof PdxInstance) {
 +        PdxInstance pi = (PdxInstance)obj;
 +        Person p1 = (Person)pi.getObject();
 +        System.out.println("Nilkanth1 : verifyUpdatesInClientCache() : GET ON KEY=1" + p1.toString());
 +      }else {
 +        System.out.println("Nilkanth1 : verifyUpdatesInClientCache() GET ON KEY=1  returned OBJECT: " + obj.toString());
 +      }
 +    }
 +    */
 +    
 +    //verify update on key "2"
 +    {
 +      Person expectedPerson = new Person(501L, "Barack", "Hussein", "Obama", DateTimeUtils.createDate(1961, Calendar.APRIL, 8), Gender.MALE );
 +      Object value = region.get("2");
 +      if (value instanceof PdxInstance) {
 +        PdxInstance pi3  = (PdxInstance) value;
 +        Person actualPerson = (Person) pi3.getObject();
 +        assertEquals(actualPerson.getId(), expectedPerson.getId());
 +        assertEquals(actualPerson.getFirstName(), expectedPerson.getFirstName());
 +        assertEquals(actualPerson.getMiddleName(), expectedPerson.getMiddleName());
 +        assertEquals(actualPerson.getLastName(), expectedPerson.getLastName());
 +        assertEquals(actualPerson.getBirthDate(), expectedPerson.getBirthDate());
 +        assertEquals(actualPerson.getGender(), expectedPerson.getGender());
 +      }else {
 +        fail("VerifyUpdatesInClientCache, Get on key 2, Expected to get value of type PdxInstance ");
 +      }
 +    }
 +    
 +    //verify Deleted key "13"
 +    {
 +      Object obj = region.get("13");
 +      assertEquals(obj, null);
 +      
 +      obj = region.get("14");
 +      assertEquals(obj, null);
 +      
 +      obj = region.get("15");
 +      assertEquals(obj, null);
 +      
 +      obj = region.get("16");
 +      assertEquals(obj, null);
 +    }
 +    
 +  }
 +  
 +  public static void doUpdatesUsingRestApis(String restEndpoint) {
 +    //UPdate keys using REST calls
 +    {
 +
 +      try {
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpPut put = new HttpPut(restEndpoint
 +            + "/People/3,4,5,6,7,8,9,10,11,12");
 +        put.addHeader("Content-Type", "application/json");
 +        put.addHeader("Accept", "application/json");
 +        put.addHeader("security-username", "admin");
 +        put.addHeader("security-password", "admin");
 +
 +        StringEntity entity = new StringEntity(PERSON_LIST_AS_JSON);
 +        put.setEntity(entity);
 +        CloseableHttpResponse result = httpclient.execute(put);
 +      } catch (Exception e) {
 +        throw new TestException(CommandTestBase.getStackTrace(e));
 +      }
 +    }
 +    
 +    //Delete Single keys
 +    {
 +      try {
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpDelete delete = new HttpDelete(restEndpoint + "/People/13");
 +        delete.addHeader("Content-Type", "application/json");
 +        delete.addHeader("Accept", "application/json");
 +        delete.addHeader("security-username", "admin");
 +        delete.addHeader("security-password", "admin");
 +        CloseableHttpResponse result = httpclient.execute(delete);
 +      } catch (Exception e) {
 +        throw new TestException(CommandTestBase.getStackTrace(e));
 +      }
 +    }
 +    
 +    //Delete set of keys
 +    {
 +      try {
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpDelete delete = new HttpDelete(restEndpoint + "/People/14,15,16");
 +        delete.addHeader("Content-Type", "application/json");
 +        delete.addHeader("Accept", "application/json");
 +        delete.addHeader("security-username", "admin");
 +        delete.addHeader("security-password", "admin");
 +        
 +        CloseableHttpResponse result = httpclient.execute(delete);
 +      } catch (Exception e) {
 +        throw new TestException(CommandTestBase.getStackTrace(e));
 +      }
 +    }
 +    
 +    //REST put?op=CAS for key 1
 +    /*
 +    try {   
 +    {  
 +      HttpEntity<Object> entity = new HttpEntity<Object>(PERSON_AS_JSON_CAS, headers);
 +      ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange(
 +        restEndpoint + "/People/1?op=cas",
 +        HttpMethod.PUT, entity, String.class);
 +    }
 +    } catch (HttpClientErrorException e) {
 +      
 +      fail("Caught HttpClientErrorException while doing put with op=cas");
 +    }catch (HttpServerErrorException se) {
 +      fail("Caught HttpServerErrorException while doing put with op=cas");
 +    }
 +    */ 
 +    
 +    //REST put?op=REPLACE for key 2
 +    {
 +      /*HttpEntity<Object> entity = new HttpEntity<Object>(PERSON_AS_JSON_REPLACE, headers);
 +      ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange(
 +        restEndpoint + "/People/2?op=replace",
 +      HttpMethod.PUT, entity, String.class);*/
 +      
 +      try {
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        HttpPut put = new HttpPut(restEndpoint
 +            + "/People/2?op=replace");
 +        put.addHeader("Content-Type", "application/json");
 +        put.addHeader("Accept", "application/json");
 +        put.addHeader("security-username", "admin");
 +        put.addHeader("security-password", "admin");
 +        
 +        StringEntity entity = new StringEntity(PERSON_AS_JSON_REPLACE);
 +        put.setEntity(entity);
 +        CloseableHttpResponse result = httpclient.execute(put);
 +      } catch (Exception e) {
 +        throw new TestException(CommandTestBase.getStackTrace(e));
 +      }
 +    }
 +  }
 +  
 +  public static void fetchRestServerEndpoints(String restEndpoint) {
 +    HttpGet get = new HttpGet(restEndpoint + "/servers");
 +    get.addHeader("Content-Type", "application/json");
 +    get.addHeader("Accept", "application/json");
 +    get.addHeader("security-username", "admin");
 +    get.addHeader("security-password", "admin");
 +    
 +    CloseableHttpClient httpclient = HttpClients.createDefault();
 +    CloseableHttpResponse response;
 +    
 +    try {
 +      response = httpclient.execute(get);
 +      HttpEntity entity = response.getEntity();
 +      InputStream content = entity.getContent();
 +      BufferedReader reader = new BufferedReader(new InputStreamReader(
 +          content));
 +      String line;
 +      StringBuffer str = new StringBuffer();
 +      while ((line = reader.readLine()) != null) {
 +        str.append(line);
 +      }
 +      
 +      //validate the satus code
 +      assertEquals(response.getStatusLine().getStatusCode(), 200);
 +      
 +      if(response.getStatusLine().getStatusCode() == 200) {
 +        JSONArray jsonArray = new JSONArray(str.toString());
 +        
 +        //verify total number of REST service endpoints in DS
 +        assertEquals(jsonArray.length(), 2);
 +      }
 +      
 +    } catch (ClientProtocolException e) { 
 +      e.printStackTrace();
 +      fail(" Rest Request should not have thrown ClientProtocolException!");
 +    } catch (IOException e) {
 +      e.printStackTrace();
 +      fail(" Rest Request should not have thrown IOException!");
 +    } catch (JSONException e) {
 +      e.printStackTrace();
 +      fail(" Rest Request should not have thrown  JSONException!");
 +    }
 +    
 +  }
 +  public static void VerifyGetUsingJavaAPIs(String restEndpoint) {
 +    ClientCache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +    Region<String, Object> region = cache.getRegion(PEOPLE_REGION_NAME);
 +    Object value = region.get("1");
 +  }
 +  
 +  public static void doGetsUsingRestApis(String restEndpoint) {
 +    //GET using Region APIs
 +    
 +      ClientCache cache = GemFireCacheImpl.getInstance();
 +      /*
 +      assertNotNull(cache);
 +      Region<String, Object> region = cache.getRegion(PEOPLE_REGION_NAME);
 +      Object value = region.get("1");
 +      if(value instanceof PdxInstance){
 +        System.out.println("Nilkanth: value is of Type PdxInstance");
 +        System.out.println("Nilkanth Person = " + ((PdxInstance)value).getField("id"));
 +      }else{
 +        System.out.println("Nilkanth: value is NOT of Type PdxInstance -> type = "+ value.getClass().getName());
 +      }
 +      */
 +      
 +    
 +    //HttpHeaders headers = setAcceptAndContentTypeHeaders(); 
 +    String currentOperation = null;
 +    JSONObject jObject;
 +    JSONArray jArray;
 +    try {    
 +      //1. Get on key="1" and validate result.
 +      {
 +        currentOperation = "GET on key 1";
 +        
 +        HttpGet get = new HttpGet(restEndpoint + "/People/1");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse response = httpclient.execute(get);
 +        
 +        HttpEntity entity = response.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer str = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          str.append(line);
 +        }
 +        
 +        jObject = new JSONObject(str.toString());
 +      
 +        assertEquals(jObject.get("id"), 101);
 +        assertEquals(jObject.get("firstName"), "Mithali");
 +        assertEquals(jObject.get("middleName"), "Dorai");
 +        assertEquals(jObject.get("lastName"), "Raj");
 +        assertEquals(jObject.get("gender"), Gender.FEMALE.name());
 +      }
 +         
 +      //2. Get on key="16" and validate result.
 +      {
 +        currentOperation = "GET on key 16";
 +
 +        
 +        HttpGet get = new HttpGet(restEndpoint + "/People/16");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse response = httpclient.execute(get);
 +        
 +        HttpEntity entity = response.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer str = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          str.append(line);
 +        }
 +        
 +        jObject = new JSONObject(str.toString());
 +        
 +      
 +        assertEquals(jObject.get("id"), 104);
 +        assertEquals(jObject.get("firstName"), "Shila");
 +        assertEquals(jObject.get("middleName"), "kumari");
 +        assertEquals(jObject.get("lastName"), "Dixit");
 +        assertEquals(jObject.get("gender"), Gender.FEMALE.name());
 +      }
 +      
 +      //3. Get all (getAll) entries in Region
 +      {
 +
 +        HttpGet get = new HttpGet(restEndpoint + "/People");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse result = httpclient.execute(get);
 +        assertEquals(result.getStatusLine().getStatusCode(), 200);
 +        assertNotNull(result.getEntity());
 +      
 +        HttpEntity entity = result.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer sb = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          sb.append(line);
 +        }
 +        result.close();
 +        
 +        try {
 +          jObject = new JSONObject(sb.toString());
 +          jArray = jObject.getJSONArray("People");
 +          assertEquals(jArray.length(), 16);
 +        } catch (JSONException e) {
 +          fail(" Rest Request ::" + currentOperation +  " :: should not have thrown JSONException ");
 +        }
 +      }
 +      
 +      //4. GetAll?limit=10 (10 entries) and verify results
 +      {
 +        HttpGet get = new HttpGet(restEndpoint + "/People?limit=10");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse response = httpclient.execute(get);
 +        assertEquals(response.getStatusLine().getStatusCode(), 200);
 +        assertNotNull(response.getEntity());
 +        
 +        HttpEntity entity = response.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer str = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          str.append(line);
 +        }
 +        
 +        try {
 +          jObject = new JSONObject(str.toString());
 +          jArray = jObject.getJSONArray("People");
 +          assertEquals(jArray.length(), 10);
 +        } catch (JSONException e) {
 +          fail(" Rest Request ::" + currentOperation +  " :: should not have thrown JSONException ");
 +        }
 +      }
 +      
 +      //5. Get keys - List all keys in region
 +      {  
 +        
 +        HttpGet get = new HttpGet(restEndpoint + "/People/keys");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse response = httpclient.execute(get);
 +        assertEquals(response.getStatusLine().getStatusCode(), 200);
 +        assertNotNull(response.getEntity());
 +        
 +        HttpEntity entity = response.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer str = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          str.append(line);
 +        }
 +        
 +        try {
 +          jObject = new JSONObject(str.toString());
 +          jArray = jObject.getJSONArray("keys"); 
 +          assertEquals(jArray.length(), 16);
 +        } catch (JSONException e) {
 +          fail(" Rest Request ::" + currentOperation +  " :: should not have thrown JSONException ");
 +        }
 +      } 
 +      
 +      //6. Get data for specific keys
 +      {  
 +       
 +        HttpGet get = new HttpGet(restEndpoint + "/People/1,3,5,7,9,11");
 +        get.addHeader("Content-Type", "application/json");
 +        get.addHeader("Accept", "application/json");
 +        get.addHeader("security-username", "admin");
 +        get.addHeader("security-password", "admin");
 +
 +        CloseableHttpClient httpclient = HttpClients.createDefault();
 +        CloseableHttpResponse response = httpclient.execute(get);
 +        assertEquals(response.getStatusLine().getStatusCode(), 200);
 +        assertNotNull(response.getEntity());
 +        
 +        HttpEntity entity = response.getEntity();
 +        InputStream content = entity.getContent();
 +        BufferedReader reader = new BufferedReader(new InputStreamReader(
 +            content));
 +        String line;
 +        StringBuffer str = new StringBuffer();
 +        while ((line = reader.readLine()) != null) {
 +          str.append(line);
 +        }
 +        
 +        try {
 +          jObject = new JSONObject(str.toString());
 +          jArray = jObject.getJSONArray("People");
 +          assertEquals(jArray.length(), 6);
 +          
 +        } catch (JSONException e) {
 +          fail(" Rest Request ::" + currentOperation +  " :: should not have thrown JSONException ");
 +        }
 +      } 
 +      
 +    }catch ( Exception e ) {
 +      throw new TestException(CommandTestBase.getStackTrace(e)); 
 +    }
 +    
 +  }
 +
 +  public static void createRegionInClientCache() {
 +    ClientCache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +    ClientRegionFactory<String, Object> crf = cache
 +        .createClientRegionFactory(ClientRegionShortcut.PROXY);
 +    Region<String, Object> region = crf.create(PEOPLE_REGION_NAME);
 +
 +  }
 +
 +  public static void createRegionInManager() {
 +    Cache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +
 +    RegionFactory<String, Object> rf = cache
 +        .createRegionFactory(RegionShortcut.REPLICATE);
 +    Region<String, Object> region = rf.create(PEOPLE_REGION_NAME);
 +  }
 +
 +  public static void createRegionInPeerServer() {
 +    Cache cache = GemFireCacheImpl.getInstance();
 +    assertNotNull(cache);
 +
 +    RegionFactory<String, Object> rf = cache
 +        .createRegionFactory(RegionShortcut.REPLICATE);
 +    Region<String, Object> region = rf.create(PEOPLE_REGION_NAME);
 +  }
 +
 +  /**
 +   * InterOps Test between REST-client, Peer Cache Client and Client Cache 
 +   * @throws Exception
 +   */
 + 
 +  public void testInterOpsWithReplicatedRegion() throws Exception {
 +
 +    final Host host = Host.getHost(0);
 +    VM locator = host.getVM(0);
 +    VM manager = host.getVM(1);
 +    VM server = host.getVM(2);
 +    VM client = host.getVM(3);
 +
 +    // start locator
 +    //int locatorPort = AvailablePortHelper.getRandomAvailableTCPPortOnVM(locator);
 +    int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
 +    
 +    
 +    startLocatorInVM(locator, locatorPort, "");
 +    
 +    // find locators
 +    String locators = getServerHostName(locator.getHost()) + "[" + locatorPort
 +        + "]";
 +     
 +    // start manager (peer cache)
 +    int managerPort = startManagerInVM(manager,/* groups */null, locators,
-         new String[] {REGION_NAME}, BridgeServer.DEFAULT_LOAD_PROBE);
++        new String[] {REGION_NAME}, CacheServer.DEFAULT_LOAD_PROBE);
 +    
 +    //start startBridgeServer With RestService enabled
 +    String restEndpoint = (String)server.invoke(RestAPIsAndInterOpISDUnitTest.class,
-         "startBridgeServerWithRestServiceOnInVM", new Object[] { server ,  null, locators, new String[] {REGION_NAME}, BridgeServer.DEFAULT_LOAD_PROBE });
++        "startBridgeServerWithRestServiceOnInVM", new Object[] { server ,  null, locators, new String[] {REGION_NAME}, CacheServer.DEFAULT_LOAD_PROBE });
 +    
 +    // create a client cache
 +    createClientCacheInVM(client, getServerHostName(locator.getHost()),
 +        locatorPort);
 +    
 +    // create region in Manager, peer cache and Client cache nodes
 +    manager.invoke(RestAPIsAndInterOpISDUnitTest.class, "createRegionInManager");
 +    
 +    server.invoke(RestAPIsAndInterOpISDUnitTest.class,
 +        "createRegionInPeerServer");
 +    
 +    client.invoke(RestAPIsAndInterOpISDUnitTest.class,
 +        "createRegionInClientCache");
 +    
 +    
 +    // do some person puts from clientcache
 +    client.invoke(RestAPIsAndInterOpISDUnitTest.class, "doPutsInClientCache");
 +
 +    //TEST: fetch all available REST endpoints
 +    //RestAPIsAndInterOpISDUnitTest.fetchRestServerEndpoints(restEndpoint);
 +    //System.out.println("Nilkanth: Test-11  Fetched REST endpoints SUCCESS!");
 +    
 +    // Controller VM - config REST Client and make HTTP calls
 +    RestAPIsAndInterOpISDUnitTest.doGetsUsingRestApis(restEndpoint);
 +    
 +    //update Data using REST APIs
 +    RestAPIsAndInterOpISDUnitTest.doUpdatesUsingRestApis(restEndpoint);
 +    
 +    client.invoke(RestAPIsAndInterOpISDUnitTest.class, "verifyUpdatesInClientCache");
 +    
 +    //Querying
 +    RestAPIsAndInterOpISDUnitTest.doQueryOpsUsingRestApis(restEndpoint);
 +    
 +    
 +    // stop the client and make sure the bridge server notifies
 +    // stopBridgeMemberVM(client);
 +    helper.closeCache(locator);
 +    helper.closeCache(manager);
 +    helper.closeCache(server);
 +    helper.closeCache(client);
 +
 +  }
 +
 +  private void createClientCacheInVM(VM vm, final String host, final int port) {
 +    SerializableRunnable connect = new SerializableRunnable(
 +        "Start Cache client") {
 +      public void run() {
 +        
 +        // Connect using the GemFire locator and create a Caching_Proxy cache
 +        ClientCache c = new ClientCacheFactory()
 +                        .set("security-client-auth-init", "templates.security.UserPasswordAuthInit.create")
 +                         .set("security-username", "admin")
 +                         .set("security-password", "admin")
 +                         .setPdxReadSerialized(true).addPoolLocator(host, port)
 +                         .create();
 +       
 +        Region r = c.createClientRegionFactory(
 +            ClientRegionShortcut.PROXY).create(REGION_NAME);
 +      }
 +    };
 +
 +    if (vm == null) {
 +      connect.run();
 +    } else {
 +      vm.invoke(connect);
 +    }
 +  }
 +
 +  private int startManagerInVM(VM vm, final String[] groups,
 +      final String locators, final String[] regions, final ServerLoadProbe probe) {
 +    SerializableCallable connect = new SerializableCallable("Start Manager ") {
 +      public Object call() throws IOException {
 +        Properties props = new Properties();
 +        props
 +            .setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
 +        props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
 +
 +        props.setProperty("jmx-manager", "true");
 +        props.setProperty("jmx-manager-start", "true");
 +        props.setProperty(DistributionConfig.JMX_MANAGER_PORT_NAME, "0");
 +        
 +        final int httpPort = AvailablePortHelper.getRandomAvailableTCPPort();
 +        //Set REST service related configuration
 +        props.setProperty(DistributionConfig.START_DEV_REST_API_NAME, "true");
 +        props.setProperty(DistributionConfig.HTTP_SERVICE_BIND_ADDRESS_NAME, "localhost");
 +        props.setProperty(DistributionConfig.HTTP_SERVICE_PORT_NAME, String.valueOf(httpPort));
 +        
 +        //Add security properties
 +        props.setProperty(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthenticator.create");
 +        props.setProperty(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthorization.create");
 +        //props.setProperty(DistributionConfig.SECURITY_CLIENT_ACCESSOR_PP_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.CustomRestAPIsAuthorization.create");
 +        props.setProperty(DistributionConfig.SECURITY_REST_TOKEN_SERVICE_NAME, "com.gemstone.gemfire.rest.internal.web.controllers.DummyTokenService.create");
 +        
 +        DistributedSystem ds = getSystem(props);
 +        Cache cache = CacheFactory.create(ds);
 +        AttributesFactory factory = new AttributesFactory();
 +        
 +        factory.setEnableBridgeConflation(true);
 +        factory.setDataPolicy(DataPolicy.REPLICATE);
 +        RegionAttributes attrs = factory.create();
 +        for (int i = 0; i < regions.length; i++) {
 +          cache.createRegion(regions[i], attrs);
 +        }
-         BridgeServer server = cache.addBridgeServer();
++        CacheServer server = cache.addCacheServer();
 +        final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
 +        server.setPort(serverPort);
 +        server.setGroups(groups);
 +        server.setLoadProbe(probe);
 +        server.start();
 +        
 +        return new Integer(serverPort);
 +      }
 +    };
 +    Integer port = (Integer) vm.invoke(connect);
 +    return port.intValue();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3bf38a03/settings.gradle
----------------------------------------------------------------------
diff --cc settings.gradle
index a3b34bb,50b7e40..8e7f23b
--- a/settings.gradle
+++ b/settings.gradle
@@@ -7,9 -7,9 +7,10 @@@ include 'gemfire-junit
  include 'gemfire-core'
  include 'gemfire-web'
  include 'gemfire-web-api'
 +include 'pulse'
  include 'gemfire-assembly'
  include 'gemfire-rebalancer'
+ include 'gemfire-lucene'
  
  def minimumGradleVersion = '2.3'
  if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {


Mime
View raw message