Example usage for org.springframework.http HttpStatus OK

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

Introduction

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

Prototype

HttpStatus OK

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

Click Source Link

Document

200 OK .

Usage

From source file:edu.sjsu.cmpe275.project.controller.OrderController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ResponseEntity<?> checkOut(@PathVariable(value = "id") Long id) {
    return new ResponseEntity(orderService.checkOut(id), HttpStatus.OK);
}

From source file:web.EventLogRESTController.java

/**
 * Gets a list of events in the Event Log
 * @return//from  w  w w .  j av a 2s  . c  om
 */
@RequestMapping(value = "/api/eventlog/", method = RequestMethod.GET)
public ResponseEntity<List<EventLog>> listEventLog() {
    List<EventLog> el = dao.getEventsList();
    //returns NO_CONTENT error if no Events are provided
    if (el.isEmpty()) {
        return new ResponseEntity<List<EventLog>>(HttpStatus.NO_CONTENT);
    }
    //otherwise returns list of all Events
    return new ResponseEntity<List<EventLog>>(el, HttpStatus.OK);
}

From source file:br.com.avelar.bac.controllers.CarController.java

@CrossOrigin
@RequestMapping("/all")
public ResponseEntity<List<Car>> findAll() {
    return new ResponseEntity<List<Car>>(service.findAll(), HttpStatus.OK);
}

From source file:com.infinity.controller.ExpController.java

@RequestMapping(value = { "/exp/del/{expId}" }, method = RequestMethod.GET, produces = "application/json")
public ResponseEntity delExpbyId(@PathVariable String expId) throws IOException {

    ResponseEntity<String> responseEntity = null;
    try {/*ww w  .ja  v a  2 s .c om*/
        expService.deleteById(expId);
        responseEntity = new ResponseEntity<>("OK ", HttpStatus.OK);
    } catch (Exception e) {
        LOG.error(e.getMessage());
        responseEntity = new ResponseEntity<>("error ", HttpStatus.BAD_REQUEST);
    }
    return responseEntity;
}

From source file:de.zib.gndms.GORFX.service.TaskFlowServiceAux.java

public static <T extends Order> HttpStatus validateOrder(TaskFlowFactory<T, ?> factory,
        DelegatingOrder<T> delegate) {
    final AbstractQuoteCalculator<T> qc;
    try {//from w ww.ja  va2  s. com
        qc = factory.getQuoteCalculator();
    } catch (MandatoryOptionMissingException e) {
        return HttpStatus.BAD_REQUEST;
    }
    qc.setOrder(delegate);

    try {
        if (qc.validate())
            return HttpStatus.OK;
    } catch (Exception e) {
        return HttpStatus.BAD_REQUEST;
    }

    return HttpStatus.BAD_REQUEST;
}

From source file:org.cloudfoundry.identity.uaa.coverage.CoverageController.java

@RequestMapping(value = "flush", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity saveGlobalProjectData() throws ClassNotFoundException, NoSuchMethodException,
        InvocationTargetException, IllegalAccessException {
    String className = "net.sourceforge.cobertura.coveragedata.ProjectData";
    String methodName = "saveGlobalProjectData";
    Class saveClass = Class.forName(className);
    java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName, new Class[0]);
    saveMethod.invoke(null, new Object[0]);
    return new ResponseEntity<>(HttpStatus.OK);
}

From source file:org.cloudfoundry.identity.uaa.integration.UserInfoEndpointIntegrationTests.java

/**
 * tests a happy-day flow of the <code>/userinfo</code> endpoint
 *//*from   ww  w .  j  a v a 2 s .c  o  m*/
@Test
public void testHappyDay() throws Exception {

    ResponseEntity<String> user = serverRunning.getForString("/userinfo");
    assertEquals(HttpStatus.OK, user.getStatusCode());

    String map = user.getBody();
    assertTrue(testAccounts.getUserName(), map.contains("user_id"));
    assertTrue(testAccounts.getEmail(), map.contains("email"));

    System.err.println(user.getHeaders());

}

From source file:com.aplikasi.penjualan.controller.DataBarangController.java

@RequestMapping(value = "/barang/{kode}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)
public void updateDataBarang(@PathVariable("kode") String kode, @RequestBody @Valid DataBarang k) {
    k.setKode(kode);/*  w  w w .j  a v  a 2 s .c  om*/
    kd.save(k);
}

From source file:com.consol.citrus.demo.voting.jms.VotingJmsSteps.java

@Given("^Voting list is empty$")
public void clear() {
    runner.http(action -> action.client(votingClient).send().delete("/voting"));

    runner.http(action -> action.client(votingClient).receive().response(HttpStatus.OK));
}