Example usage for org.springframework.http HttpStatus NO_CONTENT

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

Introduction

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

Prototype

HttpStatus NO_CONTENT

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

Click Source Link

Document

204 No Content .

Usage

From source file:com.seabee.snapdragon.controller.StaticPageController.java

@RequestMapping(value = "/{staticPageId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteStaticPage(@PathVariable("staticPageId") int id) {
    //  take in the page path to delete?
    // Remove by page id?
    dao.removeStaticPage(id);/*from  w ww  . ja  va  2  s  .c o m*/
}

From source file:com.alexshabanov.springrestapi.support.ProfileController.java

@RequestMapping(value = CONCRETE_PROFILE_RESOURCE, method = RequestMethod.PUT)
@ResponseBody//from   w w w . j  ava  2s . co m
@ResponseStatus(HttpStatus.NO_CONTENT)
public void putProfile(@PathVariable("id") long id, @RequestBody Profile profile) {
    throw new AssertionError(); // should be mocked
}

From source file:org.zols.datastore.web.controller.TemplateRepositoryController.java

@RequestMapping(value = "/api/templateRepositories/{name}", method = DELETE)
@ApiIgnore/*from w ww.j a  v a  2 s  . com*/
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "name") String name) {
    LOGGER.info("Deleting templateRepository with id {}", name);
    templateRepositoryManager.deleteTemplateRepository(name);
}

From source file:com.sambrannen.samples.events.web.RestEventController.java

@RequestMapping(value = "/{id}", method = DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteEvent(@PathVariable Long id) {
    repository.delete(id);
}

From source file:org.zols.documents.web.DocumentRepositoryController.java

@RequestMapping(value = "/{name}", method = DELETE)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "name") String name) throws DataStoreException {
    LOGGER.info("Deleting documentRepositories with id {}", name);
    documentRepositoryService.delete(name);
}

From source file:nl.surfnet.mujina.controllers.CommonAPI.java

@RequestMapping(value = { "/needs-signing" }, method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ResponseBody// w  w w  .j  ava  2 s .  c o  m
public void setSigningNeeded(@RequestBody NeedsSigning needsSigning) {
    log.debug("Request to set signing needed");
    configuration.setSigning(needsSigning.getValue());
}

From source file:com.consol.citrus.demo.javaland.EmployeeSmsGatewayTest.java

@Test
@CitrusTest/*from w w w  .j a  v  a  2  s  .co  m*/
public void testPostWithWelcomeSms(@CitrusResource TestDesigner citrus) {
    citrus.variable("employee.name", "Bernadette");
    citrus.variable("employee.age", "24");
    citrus.variable("employee.mobile", "4915199999999");

    citrus.http().client(serviceUri).post().fork(true).contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=${employee.name}&age=${employee.age}&mobile=${employee.mobile}");

    citrus.receive(smsGatewayServer).payload(new ClassPathResource("templates/send-sms-request.xml"));

    citrus.send(smsGatewayServer).payload(new ClassPathResource("templates/send-sms-response.xml"));

    citrus.http().client(serviceUri).response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).get().accept(MediaType.APPLICATION_XML);

    citrus.http().client(serviceUri).response(HttpStatus.OK)
            .payload("<employees>" + "<employee>" + "<age>${employee.age}</age>"
                    + "<name>${employee.name}</name>" + "<mobile>${employee.mobile}</mobile>" + "</employee>"
                    + "</employees>");

    citrusFramework.run(citrus.getTestCase());
}

From source file:de.sainth.recipe.backend.rest.controller.UserController.java

@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
void delete(@PathVariable("id") Long id) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    RecipeManagerAuthenticationToken token = (RecipeManagerAuthenticationToken) authentication;
    if (ROLE_ADMIN.name().equals(token.getRole())
            || (ROLE_USER.name().equals(token.getRole()) && token.getPrincipal().equals(id))) {
        repository.delete(id);/*ww w.  j a v  a  2  s. c  om*/
    }
}

From source file:com.seabee.snapdragon.controller.BlogController.java

@RequestMapping(value = "/{entryId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteBlogEntry(@PathVariable("entryId") int id) {
    dao.removeBlogEntry(id);/*from  ww w. j a v a  2  s.  c o m*/
}

From source file:com.swcguild.vendingmachinemvc.controller.UserController.java

@RequestMapping(value = "/money", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ResponseBody/*w w  w.j a  v a  2 s .c  o  m*/
public int updateMoney(@Valid @RequestBody Money money) {
    return dao.updateMoney((int) (money.getDeposit() * 100));

}