@Test public void readSpaceBroadcastTest(){ space.getTypeManager().registerTypeDescriptor(new SpaceTypeDescriptorBuilder("test-type") .idProperty("id",false).addFixedProperty("val",String.class).create()); space.clear(new Object()); SpaceDocument d=new SpaceDocument("test-type"); d.setProperty("id",0); d.setProperty("val","val0"); space.write(d); d.setProperty("id",1); d.setProperty("val","val1"); space.write(d); SpaceTaskAPIController controller=new SpaceTaskAPIController(); SpaceTaskRequest body=new SpaceTaskRequest(); body.language="groovy"; body.target="all"; body.code="import com.gigaspaces.document.*;"+ "def newdoc=gigaSpace.read(new SpaceDocument(\"test-type\"));"+ "return newdoc.getProperty(\"val\");"; ModelAndView result=controller.executeTask("space","localhost",body); assertEquals(1,result.getModel().size()); assertEquals(2,((List)result.getModel().get("results")).size()); }
@RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); @RequestMapping(value = "/execute",method=RequestMethod.POST) ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); @RequestMapping(value = "/execute",method=RequestMethod.POST) ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body);  }