Example usage for org.springframework.web.bind.annotation RequestMethod DELETE

List of usage examples for org.springframework.web.bind.annotation RequestMethod DELETE

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod DELETE.

Prototype

RequestMethod DELETE

To view the source code for org.springframework.web.bind.annotation RequestMethod DELETE.

Click Source Link

Usage

From source file:org.lamop.riche.webservices.AuthorRESTWS.java

@DELETE
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)// w  w w .  j  ava  2  s  .c  o  m
@RequestMapping(method = RequestMethod.DELETE)
public void remove(@PathParam("id") int id) {
    servicePerson.removeEntity(new Long(id));
}

From source file:com.cfitzarl.cfjwed.controller.MealController.java

@PreAuthorize("hasRole('ROLE_ADMIN')")
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void deleteMeal(@PathVariable UUID id) {
    mealOptionService.delete(id);/*ww w. j ava2s .c  o  m*/
}

From source file:org.callistasoftware.netcare.web.mobile.controller.PushApi.java

@RequestMapping(value = "/apns", method = RequestMethod.DELETE)
@ResponseBody/*from   www  .  java2s. co m*/
public void apnsUnregistration() {
    this.logAccessWithoutPdl("unregister", "apns");
    service.unregisterApns();
}

From source file:org.cloudfoundry.identity.uaa.oauth.TokenAdminEndpoints.java

@RequestMapping(value = "/oauth/users/{user}/tokens/{token}", method = RequestMethod.DELETE)
@ResponseBody//from   ww w.jav  a 2  s.  c o m
public SimpleMessage revokeUserToken(@PathVariable String user, @PathVariable String token, Principal principal,
        @RequestParam(required = false, defaultValue = "true") boolean lookup) throws Exception {
    String username = lookup ? getUserName(user) : user;
    checkResourceOwner(username, principal);
    String tokenValue = getTokenValue(tokenServices.findTokensByUserName(username), token);
    if (tokenValue != null && tokenServices.revokeToken(tokenValue)) {
        return new SimpleMessage("ok", "user token revoked");
    }
    throw new NoSuchTokenException("Token not found");
}

From source file:com.baidu.stqa.signet.web.action.RoleAction.java

/**
 * /*w  w  w. j  a  v  a2 s  .  co m*/
 * 
 * @param projectId
 * @param roleId
 * @return
 */
@RequestMapping(value = "/project/{projectId}/role/{roleId}", method = RequestMethod.DELETE)
@ResponseBody
public ResponseEntity<Boolean> removeRole(@PathVariable Long projectId, @PathVariable Long roleId) {

    doLog(projectId);
    roleService.deleteRole(roleId);
    return new ResponseEntity<Boolean>(true, HttpStatus.OK);
}

From source file:com.restfiddle.controller.rest.EnvironmentController.java

@RequestMapping(value = "/api/environments/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
public @ResponseBody Environment delete(@PathVariable("id") String id) {
    logger.debug("Deleting environment with id: " + id);

    Environment deleted = environmentRepository.findOne(id);

    environmentRepository.delete(deleted);

    return deleted;
}

From source file:org.smigo.comment.CommentController.java

@PreAuthorize("isAuthenticated()")
@RequestMapping(value = "/rest/comment/{id}", produces = "application/json", method = RequestMethod.DELETE)
@ResponseBody/*from   w ww  .  ja v a 2s  .c  om*/
public void removeMessage(@PathVariable int id, @AuthenticationPrincipal AuthenticatedUser user,
        HttpServletResponse response) {
    HttpStatus httpStatus = commentHandler.removeComment(id, user);
    response.setStatus(httpStatus.value());
}

From source file:com.artivisi.belajar.restful.ui.controller.PermissionController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/permission/{id}")
@ResponseStatus(HttpStatus.OK)/*ww w  .j  av  a  2  s.c o m*/
public void delete(@PathVariable String id) {
    Permission a = belajarRestfulService.findPermissionById(id);
    if (a == null) {
        logger.warn("Permission dengan id [{}] tidak ditemukan", id);
        throw new IllegalStateException();
    }
    belajarRestfulService.delete(a);
}

From source file:de.hska.ld.content.controller.UserContentController.java

@Secured(Core.ROLE_USER)
@RequestMapping(method = RequestMethod.DELETE, value = "/{userId}/tag/{tagId}")
public Callable removeTag(@PathVariable Long userId, @PathVariable Long tagId) {
    return () -> {
        userContentInfoService.removeTag(userId, tagId);
        return new ResponseEntity<>(HttpStatus.OK);
    };/*from w  w w  .j a  v a2 s . c om*/
}

From source file:net.triptech.metahive.web.CategoryController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String delete(@PathVariable("id") Long id, Model uiModel, HttpServletRequest request) {
    Category.findCategory(id).remove();//from   www .j  a  v a2  s . c  o m
    uiModel.asMap().clear();

    FlashScope.appendMessage(getMessage("metahive_delete_complete", Category.class), request);

    return "redirect:/lists";
}