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:com.netflix.scheduledactions.web.controllers.ActionInstanceController.java
@RequestMapping(value = "/scheduledActions/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.ACCEPTED) public ActionInstance deleteActionInstance(@PathVariable String id) throws ActionInstanceNotFoundException { return actionsOperator.deleteActionInstance(id); }
From source file:org.smigo.species.vernacular.VernacularController.java
@PreAuthorize("isAuthenticated()") @RequestMapping(value = "/rest/vernacular", method = RequestMethod.POST) @ResponseBody// w ww .j a va2s. c o m public Object addVernacular(@Valid @RequestBody Vernacular vernacular, BindingResult result, @AuthenticationPrincipal AuthenticatedUser user, Locale locale, HttpServletResponse response) { log.info("Adding vernacular:" + vernacular); if (result.hasErrors()) { response.setStatus(HttpStatus.UNPROCESSABLE_ENTITY.value()); return result.getAllErrors(); } CrudResult review = vernacularHandler.addVernacular(vernacular, user, locale); if (review.getReview() == Review.MODERATOR) { response.setStatus(HttpStatus.ACCEPTED.value()); } return review.getId(); }
From source file:org.nekorp.workflow.backend.controller.imp.UploadControllerImp.java
/**{@inheritDoc}*/ @Override/*from w w w . ja v a 2 s . c om*/ @RequestMapping(value = "/imagenes/{rawBlobKey}", method = RequestMethod.DELETE) public void deleteImage(@PathVariable final String rawBlobKey, final HttpServletResponse response) { try { BlobKey blobKey = new BlobKey(rawBlobKey); blobstoreService.delete(blobKey); response.setStatus(HttpStatus.ACCEPTED.value()); } catch (Exception e) { response.setStatus(HttpStatus.NOT_FOUND.value()); } }
From source file:technology.tikal.customers.service.ContactRelationshipService.java
@RequestMapping(value = "/{relationId}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.ACCEPTED) public void deleteRelation(@PathVariable final Long customerId, @PathVariable final Long contactId, @PathVariable final Long relationId) { customersController.deleteRelation(customerId, contactId, relationId); }
From source file:technology.tikal.customers.service.CustomerService.java
@RequestMapping(value = "/{customerId}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.ACCEPTED) public void deleteCustomer(@PathVariable final Long customerId) { customersController.deactivateCustomer(customerId); }
From source file:org.openbaton.nfvo.api.RestVNFFG.java
/** * Updates the VNF software vnfForwardingGraphDescriptor * * @param vnfForwardingGraphDescriptor : the VNF software vnfForwardingGraphDescriptor to be * updated/* w w w . j a va 2s . c o m*/ * @param id : the id of VNF software vnfForwardingGraphDescriptor * @return networkServiceDescriptor: the VNF software vnfForwardingGraphDescriptor updated */ @RequestMapping(value = "{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.ACCEPTED) public VNFForwardingGraphDescriptor update( @RequestBody @Valid VNFForwardingGraphDescriptor vnfForwardingGraphDescriptor, @PathVariable("id") String id) { return vnffgManagement.update(vnfForwardingGraphDescriptor, id); }
From source file:github.priyatam.springrest.resource.PolicyResource.java
@RequestMapping(method = RequestMethod.POST, value = "/policy") @ResponseBody/*from w w w . ja v a2s .c o m*/ public ResponseEntity<Policy> save(final @RequestBody Policy policy) { // Input Sanitization / Validations ErrorCode code = ruleHelper.validatePolicy(policy); if (code != null) { throw new PolicyInvalidException(code); } logger.debug("Generating a Future Url ..."); String futureKey = resourceHelper.generateFutureKey(); String futureLocation = resourceHelper.createFutureLocation("/policy", futureKey); // build header HttpHeaders headers = new HttpHeaders(); headers.add("Location", futureLocation); // async policyWorker.createPolicy(futureKey, policy); return new ResponseEntity<Policy>(null, headers, HttpStatus.ACCEPTED); }
From source file:com.netflix.spinnaker.gate.controllers.PipelineTemplatesController.java
@RequestMapping(value = "/{id}", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.ACCEPTED) public Map update(@PathVariable String id, @RequestBody Map<String, Object> pipelineTemplate) { List<Map<String, Object>> jobs = new ArrayList<>(); Map<String, Object> job = new HashMap<>(); job.put("type", "updatePipelineTemplate"); job.put("id", id); job.put("pipelineTemplate", pipelineTemplate); jobs.add(job);/* ww w.j av a2 s .c o m*/ Map<String, Object> operation = new HashMap<>(); operation.put("description", "Update pipeline template '" + id + "'"); operation.put("application", getApplicationFromTemplate(pipelineTemplate)); operation.put("job", jobs); return taskService.create(operation); }
From source file:edu.eci.arsw.pacm.controllers.PacmRESTController.java
@RequestMapping(path = "/{salanum}/protectores", method = RequestMethod.GET) public ResponseEntity<?> getProtectores(@PathVariable(name = "salanum") String salanum) { try {/* ww w .j a v a 2 s . c om*/ return new ResponseEntity<>(services.getProtectores(Integer.parseInt(salanum)), 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:org.openbaton.nfvo.api.RestVirtualLink.java
/** * Updates the Configuration/*from w w w.jav a2 s. co m*/ * * @param virtualLinkDescriptor_new : The Configuration to be updated * @param id : The id of the Configuration * @return Configuration The Configuration updated */ @RequestMapping(value = "{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.ACCEPTED) public VirtualLinkDescriptor update(@RequestBody @Valid VirtualLinkDescriptor virtualLinkDescriptor_new, @PathVariable("id") String id) { log.trace("updating VirtualLinkDescriptor with id " + id + " with values: " + virtualLinkDescriptor_new); log.debug("updating VirtualLinkDescriptor with id " + id); return virtualLinkManagement.update(virtualLinkDescriptor_new, id); }