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:org.springsecurity.oauth2.controller.oauth.AdminController.java

@RequestMapping("/oauth/uncache_approvals")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void stopCaching() throws Exception {
    userApprovalHandler.setUseApprovalStore(false);
}

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

@RequestMapping(value = { "/attributes/{name:.+}" }, method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ResponseBody/*from  w w w.j a v a 2 s .c o m*/
public void setAttribute(@PathVariable String name, @RequestBody Attribute attribute) {
    log.debug("Request to set attribute {} to {}", attribute.getValue(), name);
    configuration.getAttributes().put(name, attribute.getValue());
}

From source file:net.eusashead.hateoas.response.impl.AbstractEntityResponseBuilder.java

protected ResponseEntity<V> buildResponseEntity(V body) {

    // ResponseEntity to return
    ResponseEntity<V> responseEntity;

    // Check ETag against request value
    if (headers.getETag() != null && compareEtagWithIfNoneMatch(headers.getETag())) {
        // Return 304 Not Modified
        responseEntity = new ResponseEntity<V>(headers, HttpStatus.NOT_MODIFIED);
    } else {//from w  ww. j  a v a2  s . c o  m
        // Is it a HEAD or a GET
        if (request.getMethod().equals("HEAD")) {
            // Return 204 and the headers
            responseEntity = new ResponseEntity<V>(headers, HttpStatus.NO_CONTENT);
        } else if (request.getMethod().equals("GET")) {
            // Return 200 and the entity
            responseEntity = new ResponseEntity<V>(body, headers, HttpStatus.OK);
        } else {
            throw new RuntimeException(String
                    .format("esponseBuilder does not handle verb %s, only GET or HEAD.", request.getMethod()));
        }
    }

    // Return the ResponseEntity
    return responseEntity;
}

From source file:org.zols.templates.web.TemplateControler.java

@RequestMapping(value = "/{name}", method = DELETE)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "name") String name) throws DataStoreException {
    LOGGER.info("Deleting templates with id {}", name);
    templateService.delete(name);/*  w  w  w  . j a  v  a 2 s. c o m*/
}

From source file:com.mum.controller.CardRestController.java

@RequestMapping(value = "/add/{productId}", method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void addItem(@PathVariable String productId, HttpServletRequest request) {
    System.out.println("AddItem");
    String sessionId = request.getSession(true).getId();
    Card card = cardServiceImpl.read(productId);
    if (card == null) {
        card = cardServiceImpl.create(new Card(sessionId));
    }/*  w  w w. j a  v  a 2  s. c om*/
    // Product product = productServiceImpl.getProductById(productId,);
    Product product = productServiceImpl.getProductById(productId);
    if (product == null) {
        //
        throw new IllegalArgumentException("some exception");
    }
    card.addCartItem(new CardItem(product));
    cardServiceImpl.update(sessionId, card);
}

From source file:org.zols.links.web.CategoryController.java

@RequestMapping(value = "/{name}", method = DELETE)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "name") String name) throws DataStoreException {
    LOGGER.info("Deleting categories with id {}", name);
    categoryService.delete(name);//  ww w  .ja va  2s.c om
}

From source file:org.openbaton.nfvo.api.RestEvent.java

/**
 * Removes the EventEndpoint from the EventEndpoint repository
 *
 * @param id : The Event's id to be deleted
 *//*www .jav  a 2 s  .  com*/
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void unregister(@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId)
        throws NotFoundException {

    eventDispatcher.unregister(id, projectId);
}

From source file:org.openbaton.nfvo.api.RestVirtualNetworkFunctionDescriptor.java

/**
 * Removes the VNF software virtualNetworkFunctionDescriptor from the
 * virtualNetworkFunctionDescriptor repository
 *
 * @param id : The virtualNetworkFunctionDescriptor's id to be deleted
 *//*from ww w  . ja  va  2  s  .  c om*/
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId) {

    vnfdManagement.delete(id, projectId);
}

From source file:org.openbaton.nfvo.api.RestVimInstances.java

/**
 * Removes the Datacenter from the Datacenter repository
 *
 * @param id: The Datacenter's id to be deleted
 *//*from  ww w  .j a  va2 s  . c om*/
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId) {
    vimManagement.delete(id, projectId);
}

From source file:org.zols.datastore.web.DataControler.java

@RequestMapping(value = "/{id}", method = DELETE)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "schemaId") String schemaName, @PathVariable(value = "id") String id)
        throws DataStoreException {
    LOGGER.info("Deleting jsonSchemas with id {}", id);
    dataService.delete(schemaName, id);//from  w  ww .  j  ava2 s .c  o  m
}