Example usage for org.springframework.http HttpStatus ACCEPTED

List of usage examples for org.springframework.http HttpStatus ACCEPTED

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus ACCEPTED.

Prototype

HttpStatus ACCEPTED

To view the source code for org.springframework.http HttpStatus ACCEPTED.

Click Source Link

Document

202 Accepted .

Usage

From source file:technology.tikal.ventas.service.envio.EnvioService.java

@RequestMapping(value = "/{envioId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)
public void borrar(@PathVariable final Long pedidoId, @PathVariable final Long envioId) {
    envioController.borrar(pedidoId, envioId);
}

From source file:technology.tikal.ventas.service.pedido.PartidaService.java

@RequestMapping(value = "/{partidaId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)
public void borrar(@PathVariable final Long pedidoId, @PathVariable final Long partidaId) {
    partidaController.borrar(pedidoId, partidaId);
}

From source file:com.test.RestApplicationTests.java

@Test
public void updates() throws Exception {
    ResponseEntity<String> result = rest.exchange(RequestEntity.post(new URI("/updates"))
            .contentType(MediaType.APPLICATION_JSON).body("[\"one\",\"two\"]"), String.class);
    assertThat(result.getStatusCode()).isEqualTo(HttpStatus.ACCEPTED);
    assertThat(test.list).hasSize(2);/*from   w w w . j  a  va2 s .c o m*/
    assertThat(result.getBody()).isEqualTo("onetwo");
}

From source file:edu.eci.arsw.pacm.controllers.PacmRESTController.java

@RequestMapping(path = "/tablero", method = RequestMethod.GET)
public ResponseEntity<?> getTablero() {

    try {//ww  w.  jav  a2  s . c o  m
        ArrayList<Object> informacion = new ArrayList();
        informacion.add(services.getTablero());
        informacion.add(services.getIdentificadores());
        return new ResponseEntity<>(informacion, HttpStatus.ACCEPTED);
    } catch (ServicesException ex) {
        Logger.getLogger(PacmRESTController.class.getName()).log(Level.SEVERE, null, ex);
        return new ResponseEntity<>(ex.getLocalizedMessage(), HttpStatus.NOT_FOUND);
    } catch (NumberFormatException ex) {
        Logger.getLogger(PacmRESTController.class.getName()).log(Level.SEVERE, null, ex);
        return new ResponseEntity<>("/{salanum}/ must be an integer value.", HttpStatus.BAD_REQUEST);
    }
}

From source file:technology.tikal.ventas.service.pedido.SubPedidoService.java

@RequestMapping(value = "/{subPedidoId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)
public void borrar(@PathVariable final Long pedidoId, @PathVariable final Long subPedidoId) {
    subPedidoController.borrar(pedidoId, subPedidoId);
}

From source file:edu.eci.cosw.restcontrollers.RestControladorRegistrarReserva.java

@RequestMapping(value = "/cliente/{idCliente}", method = RequestMethod.GET)
public ResponseEntity<?> consultarCliente(@PathVariable int idCliente) {
    return new ResponseEntity<>(logica.consultarCliente(idCliente), HttpStatus.ACCEPTED);
}

From source file:net.oneandone.stool.overview.IndexController.java

@RequestMapping(value = "feedback", method = RequestMethod.POST)
public ResponseEntity sendFeedback(@ModelAttribute("message") String message, ServletRequest request)
        throws MessagingException {
    String subject;/*from  www.  j a  v a2 s. c o  m*/
    if (message.isEmpty()) {
        return new ResponseEntity(HttpStatus.BAD_REQUEST);
    }
    subject = "[Stool] Feedback from " + SecurityContextHolder.getContext().getAuthentication().getName();
    new Mailer(session.configuration.mailHost, session.configuration.mailUsername,
            session.configuration.mailPassword).send(session.configuration.contactAdmin,
                    new String[] { session.configuration.contactAdmin }, subject, message);
    return new ResponseEntity(HttpStatus.ACCEPTED);
}

From source file:org.smigo.species.vernacular.VernacularController.java

@PreAuthorize("isAuthenticated()")
@RequestMapping(value = "/rest/vernacular/{id:\\d+}", method = RequestMethod.DELETE)
@ResponseBody//from w  w  w  . ja v  a  2  s  .  c om
public void deleteVernacular(@PathVariable int id, @AuthenticationPrincipal AuthenticatedUser user,
        Locale locale, HttpServletResponse response) {
    log.info("Deleting vernacular. Name:" + id);
    Review review = vernacularHandler.deleteVernacular(id, user, locale);
    if (review == Review.MODERATOR) {
        response.setStatus(HttpStatus.ACCEPTED.value());
    }
}

From source file:technology.tikal.ventas.service.catalogo.ProductoService.java

@RequestMapping(value = "/{productoId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)
public void delete(@PathVariable final Long idCatalogo, @PathVariable final Long productoId) {
    productoController.borrar(idCatalogo, productoId);
}

From source file:org.ff4j.spring.boot.resources.PropertyResource.java

@RequestMapping(value = ROOT + OPERATION_UPDATE + ROOT
        + PATH_PARAM_VALUE, method = POST, produces = APPLICATION_JSON_VALUE)
@ApiOperation(value = "Update value of a property", response = ResponseEntity.class)
@ApiResponses({ @ApiResponse(code = 202, message = "Property has been updated"),
        @ApiResponse(code = 404, message = "Property not found"),
        @ApiResponse(code = 400, message = "Invalid new value") })
public ResponseEntity updatePropertyName(@PathVariable(value = PARAM_NAME) String propertyName,
        @PathVariable(value = PARAM_VALUE) String newPropertyName) {
    propertyServices.updatePropertyName(propertyName, newPropertyName);
    return new ResponseEntity(HttpStatus.ACCEPTED);
}