Example usage for org.springframework.http ResponseEntity accepted

List of usage examples for org.springframework.http ResponseEntity accepted

Introduction

In this page you can find the example usage for org.springframework.http ResponseEntity accepted.

Prototype

public static BodyBuilder accepted() 

Source Link

Document

Create a builder with an HttpStatus#ACCEPTED ACCEPTED status.

Usage

From source file:de.msg.controller.RouteController.java

@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@PreAuthorize("isAuthenticated() and hasPermission('de.msg.domain.route.Route', 'read')")
public ResponseEntity delete(@PathVariable(value = "id") Long id) throws RouteNotFoundException {
    try {/*from w  ww  .j  a v  a  2s. c  o m*/
        service.exists(id);
        service.delete(id);
        return ResponseEntity.accepted().build();
    } catch (RouteNotFoundException e) {
        throw e;
    }
}

From source file:dijalmasilva.controllers.ControladorIdolo.java

@RequestMapping(value = "/{nome}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<List<Idolo>> buscarIdolosPorNome(@PathVariable String nome) {

    List<Idolo> idolos = serviceIdolo.buscarPorNome(nome);

    //        String result = "";
    //        //from  w ww.ja va  2  s. co  m
    //        for (Idolo idolo : idolos) {
    //            result += "<option data-value=" + idolo.getId() + " value="+idolo.getNome()+"/>\n";
    //        }
    //        System.out.println(result);

    return ResponseEntity.accepted().body(idolos);
}

From source file:org.farrukh.template.rest.inbound.RestInboundGateway.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public ResponseEntity<?> updateLibrary(@RequestBody final Library library,
        @PathVariable("id") final String id) {
    try {//from w w w  .j  av  a  2s .  c  o  m
        coreService.update(library, id);
        return ResponseEntity.accepted().build();
    } catch (Exception e) {
        throw new LibraryModificationError(RestFeedbackContext.SOME_FEEDBACK, e);
    }
}

From source file:com.orange.clara.pivotaltrackermirror.controllers.MirrorReferenceController.java

@ApiOperation("Force the app to refresh all stories inside a specific mirror")
@RequestMapping(method = RequestMethod.GET, value = "/{id:[0-9]*}/force-update", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> forceUpdate(@PathVariable Integer id) throws SchedulerException {
    MirrorReference mirrorReference = this.mirrorReferenceRepo.findOne(id);
    if (mirrorReference == null) {
        return ResponseEntity.notFound().build();
    }//from  w  ww  . j av  a2 s  .co  m
    mirrorReference.setUpdatedAt(new Date(0L));
    this.mirrorReferenceRepo.save(mirrorReference);
    JobKey jobKey = new JobKey(MirrorJob.JOB_KEY_NAME + id, MirrorJob.JOB_KEY_GROUP);
    scheduler.triggerJob(jobKey);
    return ResponseEntity.accepted().build();
}

From source file:org.createnet.raptor.auth.service.controller.UserController.java

@PreAuthorize("(hasAuthority('admin') or hasAuthority('super_admin')) or principal.uuid == #uuid")
@RequestMapping(value = { "/user/{uuid}" }, method = RequestMethod.DELETE)
@ApiOperation(value = "Delete an user profile", notes = "", code = 202, nickname = "deleteUser")
public ResponseEntity<String> delete(@PathVariable String uuid) {

    User user = userService.getByUuid(uuid);
    if (user == null) {
        return ResponseEntity.status(HttpStatus.NOT_FOUND).body("Not found");
    }/*from w w  w  . j a  va2 s.  c  om*/

    userService.delete(user);

    return ResponseEntity.accepted().body(null);
}

From source file:com.couchbase.trombi.controllers.CoworkerController.java

@RequestMapping(value = "/{coworkerId}", method = RequestMethod.DELETE)
public ResponseEntity deleteCoworker(@PathVariable("coworkerId") int id) {
    String fullId = CoworkerRepository.PREFIX + id;
    repository.delete(fullId);/*from   w  ww .  ja  v  a 2s.  c  om*/
    return ResponseEntity.accepted().build();
}

From source file:com.spartasystems.holdmail.rest.MessageController.java

@RequestMapping(value = "/{messageId}/forward", method = RequestMethod.POST)
public ResponseEntity fowardMail(@PathVariable("messageId") long messageId,
        @Valid @RequestBody MessageForwardCommand forwardCommand) {

    messageService.forwardMessage(messageId, forwardCommand.getRecipient());

    return ResponseEntity.accepted().build();
}

From source file:org.springframework.cloud.function.test.RestConfiguration.java

@PostMapping("/")
ResponseEntity<String> accept(@RequestBody String body) {
    logger.info("ACCEPT");
    this.inputs.add(body);
    return ResponseEntity.accepted().body(body);
}