gedi-geode-rest-app/src/main/java/gedi/solutions/geode/rest/app/GeodeRegionRestService.java
@PostMapping(path = "{region}/{type}/{key}",produces = "application/json")
	public String putEntry(@PathVariable String region ,@PathVariable String type, @PathVariable String key, @RequestBody String value) 
	throws Exception
	{
		
		if(region == null || region.length() == 0 || key == null || value ==null)
			return null;
		
		
		if(type == null || type.length() == 0)
					throw new IllegalArgumentException("type is required. URL pattern {region}/{type}/{key}");

		try {
			Region<String, Object> gemRegion  = geode.getRegion(region);

            System.out.println("Putting key $key in region $region");
            
           
            Class<?> clz =  Class.forName(type);
            
			Object obj = gson.fromJson(value, clz);

			Object response = gemRegion.put(key, obj);

			if (response == null)
				return null;

			return gson.toJson(response);
		}
		catch(Exception e)
		{
			e.printStackTrace();
			throw e;
		}
	}
@PostMapping(path = "{region}/{type}/{key}",produces = "application/json")
	public String putEntry(@PathVariable String region ,@PathVariable String type, @PathVariable String key, @RequestBody String value) 
	throws Exception
	{
		
		if(region == null || region.length() == 0 || key == null || value ==null)
			return null;
		
		
		if(type == null || type.length() == 0)
					throw new IllegalArgumentException("type is required. URL pattern {region}/{type}/{key}");

		try {
			Region<String, Object> gemRegion  = geode.getRegion(region);

            System.out.println("Putting key $key in region $region");
            
           
            Class<?> clz =  Class.forName(type);
            
			Object obj = gson.fromJson(value, clz);

			Object response = gemRegion.put(key, obj);

			if (response == null)
				return null;

			return gson.toJson(response);
		}
		catch(Exception e)
		{
			e.printStackTrace();
			throw e;
		}
	}
@ PostMapping ( path = "{region}/{type}/{key}" , produces = "application/json" ) public String putEntry ( @ PathVariable String region , @ PathVariable String type , @ PathVariable String key , @ RequestBody String value ) throws Exception { if ( region == null || region . length ( ) == 0 || key == null || value == null ) return null ; if ( type == null || type . length ( ) == 0 ) throw new IllegalArgumentException ( "type is required. URL pattern {region}/{type}/{key}" ) ; try { Region < String , Object > gemRegion = geode . getRegion ( region ) ; System . out . println ( "Putting key $key in region $region" ) ; Class < ? > clz = Class . forName ( type ) ; Object obj = gson . fromJson ( value , clz ) ; Object response = gemRegion . put ( key , obj ) ; if ( response == null ) return null ; return gson . toJson ( response ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw e ; } }
Put a new records
@param region the region name
@param type teh class name type
@param key the region key
@param value the region value
@return previous Region values in JSON
@throws Exception when an unknown error occurs
Put a new records