List of usage examples for org.springframework.http HttpStatus ACCEPTED
HttpStatus ACCEPTED
To view the source code for org.springframework.http HttpStatus ACCEPTED.
Click Source Link
From source file:edu.eci.arsw.blindway.controller.GameController.java
@RequestMapping(path = "/maze/{id}/{x}/{y}", method = RequestMethod.GET) public ResponseEntity<?> setMaze(@PathVariable Integer id, @PathVariable Integer x, @PathVariable Integer y) throws BlindWayException { try {/*from ww w . j a v a 2 s .c o m*/ game.createGame(id, x, y); } catch (BlindWayException e) { } Game g = game.getGame(id); return new ResponseEntity<>(g.getLabyrinth(), HttpStatus.ACCEPTED); }
From source file:edu.eci.cosw.controllers.ProductsController.java
@RequestMapping(value = "familia/{id}/terreno", method = RequestMethod.POST) public ResponseEntity<?> adicionarTerreno(@RequestBody Terreno terreno, @PathVariable("id") int id) { services.addTerreno(id, terreno);/*from w w w . ja v a2 s. co m*/ return new ResponseEntity<>(HttpStatus.ACCEPTED); }
From source file:com.netflix.scheduledactions.web.controllers.ActionInstanceController.java
@RequestMapping(value = "/scheduledActions/{id}/disable", method = RequestMethod.POST) @ResponseStatus(HttpStatus.ACCEPTED) public ActionInstance disableActionInstance(@PathVariable String id) throws ActionInstanceNotFoundException { return actionsOperator.disableActionInstance(id); }
From source file:net.prasenjit.auth.controller.UserController.java
/** * <p>manageUser.</p>// w w w.j av a2 s . c om * * @param userName a {@link java.lang.String} object. * @param userModifyRequest a {@link net.prasenjit.auth.model.UserModifyRequest} object. */ @RequestMapping(value = "/{userName}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.ACCEPTED) public void manageUser(@PathVariable("userName") String userName, @Validated @RequestBody UserModifyRequest userModifyRequest) { switch (userModifyRequest.getOperation()) { case UNLOCK: userservice.unLockuser(userName); break; case LOCK: userservice.lockUser(userName); break; case DISABLE: userservice.disableUser(userName); break; case ENABLE: userservice.enableUser(userName); break; } }
From source file:guru.nidi.ramltester.spring.SpringMockRamlMessageTest.java
@RequestMapping(value = "path", produces = "text/dummy") @ResponseBody//w w w. j a va 2 s . c o m public ResponseEntity<String> test() { final HttpHeaders headers = new HttpHeaders(); headers.add("head", "resValue"); return new ResponseEntity<>("respons", headers, HttpStatus.ACCEPTED); }
From source file:sample.resteasy.SampleResteasyApplicationTests.java
@Test public void asynchronousRequest() { TestRestTemplate rest = new TestRestTemplate(); ResponseEntity<String> response = rest.getForEntity("http://localhost:" + port + "/hello?asynch=true", String.class); assertEquals(HttpStatus.ACCEPTED, response.getStatusCode()); URI jobLocation = response.getHeaders().getLocation(); HttpStatus jobStatus = HttpStatus.ACCEPTED; ResponseEntity<String> jobResponse = null; while (jobStatus == HttpStatus.ACCEPTED) { jobResponse = rest.getForEntity(jobLocation, String.class); jobStatus = jobResponse.getStatusCode(); }/*w w w .j a va 2s .co m*/ assertEquals(HttpStatus.OK, jobResponse.getStatusCode()); assertEquals("Hello World", jobResponse.getBody()); rest.delete(jobLocation); }
From source file:com.nebhale.cyclinglibrary.web.ItemController.java
@RequestMapping(method = RequestMethod.POST, value = "", consumes = ApplicationMediaType.ITEM_VALUE, produces = ApplicationMediaType.TASK_VALUE) @ResponseStatus(HttpStatus.ACCEPTED) @ResponseBody/*www . ja v a2 s .co m*/ Task create(@PathVariable Long collectionId, @RequestBody ItemInput itemInput) { return this.pointParser.parse(itemInput.getPoints(), new CreateCallback(this.itemRepository, collectionId, itemInput.getName(), itemInput.getShortName())); }
From source file:io.pivotal.poc.dispatcher.MessageDispatcher.java
@RequestMapping(path = "/{topic}", method = RequestMethod.POST, consumes = { "text/*", "application/json" }) @ResponseStatus(HttpStatus.ACCEPTED) public ResponseEntity<?> handleRequest(@PathVariable String topic, @RequestBody String body, @RequestHeader HttpHeaders requestHeaders) { String id = sendMessage(topic, body, requestHeaders); return ResponseEntity.ok(id); }
From source file:edu.eci.arsw.blindway.controller.SalaController.java
@RequestMapping(path = "/obtencion/{id}", method = RequestMethod.GET) public ResponseEntity<?> manejadorGetRecursoSalaCreacion(@PathVariable Integer id) { try {//from www. j a va 2 s .c o m return new ResponseEntity<>(StubSala.getInstance().obtenerSala(id), HttpStatus.ACCEPTED); } catch (CreacionSalaException ex) { Logger.getLogger(SalasController.class.getName()).log(Level.SEVERE, null, ex); return new ResponseEntity<>(ex.getMessage(), HttpStatus.NOT_ACCEPTABLE); } }
From source file:be.solidx.hot.web.deprecated.ScriptExecutorController.java
public ResponseEntity<String> handleScript(WebRequest webRequest, String scriptName) { try {// w w w. j ava 2 s. co m scriptName = scriptName + getScriptExtension(); Script<COMPILED_SCRIPT> script = buildScript(IOUtils.toByteArray(loadResource(scriptName)), scriptName); StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); scriptExecutor.execute(script, webRequest, dbMap, printWriter); return new ResponseEntity<String>(stringWriter.toString(), httpHeaders, HttpStatus.ACCEPTED); } catch (Exception e) { StringWriter stringWriter = new StringWriter(); printErrorPage(e, stringWriter); return new ResponseEntity<String>(stringWriter.toString(), httpHeaders, HttpStatus.ACCEPTED); } }