List of usage examples for org.springframework.http HttpStatus NO_CONTENT
HttpStatus NO_CONTENT
To view the source code for org.springframework.http HttpStatus NO_CONTENT.
Click Source Link
From source file:com.sg.capstone.controller.StaticPageController.java
@RequestMapping(value = "/updateStaticPageDisplayOrder", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.NO_CONTENT) public void updateStaticPageDisplayOrder(@Valid @RequestBody ArrayList<String> json) { for (int i = 0; i < json.size(); i++) { StaticPage stpg = new StaticPage(); int staticPageId = Integer.parseInt(json.get(i)); stpg.setDisplayOrder(i + 1);// w w w .j a v a 2s . c o m stpg.setStaticPageId(staticPageId); spDao.updateStaticPageDisplayOrder(stpg); } }
From source file:nl.surfnet.mujina.controllers.IdentityProviderAPI.java
@RequestMapping(value = { "/authmethod" }, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody//from ww w. j a v a2 s . com public void setAuthenticationMethod(@RequestBody AuthenticationMethod authenticationMethod) { log.debug("Request to set auth method to {}", authenticationMethod.getValue()); final AuthenticationMethod.Method method = AuthenticationMethod.Method .valueOf(authenticationMethod.getValue()); configuration.setAuthentication(method); }
From source file:io.github.howiefh.jeews.modules.sys.controller.OrganizationController.java
@RequiresPermissions("organization:delete") @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@PathVariable("id") Long id) { organizationService.delete(id);//from www . j a va2 s. c o m }
From source file:org.zalando.zmon.actuator.backend.ZmonRestBackendMetricsTest.java
private void expectDeleteCall() { WireMock.addRequestProcessingDelay(200); stubFor(delete(urlEqualTo("/something")) .willReturn(aResponse().withStatus(HttpStatus.NO_CONTENT.value()).withFixedDelay(100))); }
From source file:$.TaskRestController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@PathVariable("id") Long id) { taskService.deleteTask(id);/*from www. j a va 2 s. c o m*/ }
From source file:io.curly.gathering.list.GatheringController.java
@RequestMapping(value = "/{listId}", method = RequestMethod.DELETE) public DeferredResult<HttpEntity<?>> delete(@PathVariable String listId, @GitHubAuthentication User user) { return defer(storage.findOne(listId, user) .map(res -> res.<ResourceNotFoundException>orElseThrow(ResourceNotFoundException::new)) .doOnNext(storage::delete).map(gatheringList -> new ResponseEntity<>(HttpStatus.NO_CONTENT))); }
From source file:com.baidu.terminator.manager.action.LinkAction.java
/** * Update a link.//www.ja va 2 s . co m * * @param linkId * @param linkForm * the link form , for example: * {"name":"http_proxy","localPort":8080 * ,"remoteAddress":"61.135.169.125" * ,"remotePort":80,"workMode":"RECORD" * ,"protocolType":"HTTP","storageType":"CACHE","signClass": * "com.baidu.terminator.plugin.signer.DefaultHttpSigner" * ,"extractClass" * :"com.baidu.terminator.plugin.extractor.DefaultHttpExtractor"} */ @RequestMapping(value = "/{linkId}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.NO_CONTENT) public void updateLink(@PathVariable int linkId, @Valid @RequestBody LinkForm linkForm) { Link link = new Link(); link.setId(linkId); link.setName(linkForm.getName()); link.setLocalPort(linkForm.getLocalPort()); link.setRemoteAddress(linkForm.getRemoteAddress()); link.setRemotePort(linkForm.getRemotePort()); link.setWorkMode(linkForm.getWorkMode()); link.setProtocolType(linkForm.getProtocolType()); link.setStorageType(linkForm.getStorageType()); link.setSignClass(linkForm.getSignClass()); link.setExtractClass(linkForm.getExtractClass()); linkService.modifyLink(link); }
From source file:com.gazbert.bxbot.rest.api.EmailAlertsConfigController.java
/** * Updates Email Alerts configuration for the bot. * * @return 204 'No Content' HTTP status code if Email Alerts config was updated, some other HTTP status code otherwise. */// w w w . j av a 2 s.c o m @RequestMapping(value = "/emailalerts", method = RequestMethod.PUT) ResponseEntity<?> updateEmailAlerts(@AuthenticationPrincipal User user, @RequestBody EmailAlertsConfig config) { emailAlertsConfigService.updateConfig(config); final HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders .setLocation(ServletUriComponentsBuilder.fromCurrentRequest().path("/").buildAndExpand().toUri()); return new ResponseEntity<>(null, httpHeaders, HttpStatus.NO_CONTENT); }
From source file:com.sms.server.controller.MediaController.java
@RequestMapping(value = "/{id}/contents", method = RequestMethod.GET) public ResponseEntity<List<MediaElement>> getMediaElementsByParentID(@PathVariable("id") Long id) { MediaElement parentDirectory = mediaDao.getMediaElementByID(id); if (parentDirectory == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); }/*from ww w.j a v a2s. c o m*/ if (parentDirectory.getType() != MediaElementType.DIRECTORY) { return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } List<MediaElement> mediaElements = mediaDao.getMediaElementsByParentPath(parentDirectory.getPath()); if (mediaElements == null) { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } return new ResponseEntity<>(mediaElements, HttpStatus.OK); }
From source file:com.wisemapping.rest.AccountController.java
@RequestMapping(method = RequestMethod.PUT, value = "account/locale", consumes = { "text/plain" }) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void changeLanguage(@RequestBody String language) { if (language == null) { throw new IllegalArgumentException("language can not be null"); }/*from ww w.ja v a2s . com*/ final User user = Utils.getUser(true); user.setLocale(language); userService.updateUser(user); }