Example usage for org.springframework.http HttpStatus PROCESSING

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

Introduction

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

Prototype

HttpStatus PROCESSING

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

Click Source Link

Document

102 Processing .

Usage

From source file:com.yoncabt.ebr.ws.ReportWS.java

@RequestMapping(value = {
        "/ws/1.0/status/{requestId}" }, method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<ReportResponse> status(@PathVariable("requestId") String requestId) {
    Status status = reportService.status(requestId);
    if (status == null) {//balamam
        logManager.info("status query :YOK !!! " + requestId);
        return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
    }/*ww w  .j  av  a 2 s .  c om*/
    logManager.info("status query :" + requestId);
    switch (status) {
    case WAIT:
        logManager.info("status query :" + requestId + " :balam");
        return ResponseEntity.status(HttpStatus.CREATED).body(null);

    case RUN:
        logManager.info("status query :" + requestId + " :devam ediyor");
        return ResponseEntity.status(HttpStatus.PROCESSING).body(null);

    case EXCEPTION:
        logManager.info("status query :" + requestId + " :hata");
        return ResponseEntity.status(420).body(null);// 420 Method Failure

    case FINISH:
        logManager.info("status query :" + requestId + " :bitmi");
        return ResponseEntity.status(HttpStatus.OK).body(null);

    case CANCEL:
        logManager.info("status query :" + requestId + " :iptal");
        return ResponseEntity.status(HttpStatus.OK).body(null);

    case SCHEDULED:
        logManager.info("status query :" + requestId + " :balam");
        return ResponseEntity.status(HttpStatus.CREATED).body(null);
    default:
        throw new IllegalArgumentException(status.name());
    }
}