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:it.polimi.diceH2020.launcher.controller.rest.RestLaunchAnalysisController.java

@RequestMapping(value = "/submit", method = RequestMethod.DELETE)
public void deletePendingSubmissions() {
    for (PendingSubmission submission : submissionRepository.findAll()) {
        cleanup(submission.getId(), null);
        logger.info("All the pending submissions have been deleted.");
    }/*from  w  w  w  .  ja  v  a 2 s . c  om*/
}

From source file:com.comcast.video.dawg.show.plugins.PluginController.java

/**
 * Removes a plugin from being stored.//from  w  w  w  . j  a  v a 2s  .  c  o m
 * @param remoteType The remote type that identifies what plugin to get
 * @throws IOException
 */
@RequestMapping(method = { RequestMethod.DELETE }, value = "/plugins/remote/{remoteType}")
@ResponseBody
public void removeRemotePlugin(@PathVariable String remoteType) throws IOException {
    this.pluginManager.removePlugin(remoteType);
}

From source file:no.ntnu.okse.web.controller.SubscriberController.java

/**
 * This method deletes a single subscriber given the subscriberID request parameter.
 *
 * @param subscriberID The subscriber to be deleted, represented as a String id
 * @return A JSON serialization of the deleted subscriber
 *//*w  ww .ja va 2  s . co  m*/
@RequestMapping(method = RequestMethod.DELETE, value = DELETE_SINGLE_SUBSCRIBER)
public @ResponseBody Subscriber deleteSingleSubscriber(
        @RequestParam(value = "subscriberID") String subscriberID) {
    log.debug("Deleting subscriber with ID: " + subscriberID);
    SubscriptionService ss = SubscriptionService.getInstance();
    Subscriber s = ss.getSubscriberByID(subscriberID.trim());
    ss.removeSubscriber(s);
    return s;
}

From source file:net.anthonychaves.bookmarks.web.BookmarkController.java

@RequestMapping(method = RequestMethod.DELETE)
public String deleteBookmark(@RequestParam(value = "bookmarkId") String bookmarkId, HttpSession session,
        ModelMap model) {//from w  w w.j  a va 2  s.  c  o  m

    User user = (User) session.getAttribute("user");
    user = userService.deleteBookmark(user, bookmarkId);
    session.setAttribute("user", user);

    model.clear();
    model.addAttribute("result", bookmarkId);

    return "redirect:/b/user";
}

From source file:com.toptal.controller.UserController.java

/**
 * Deletes.//from ww w .j  a  v  a 2 s.  co  m
 * @param uid User ID.
 */
@RequestMapping(value = "/{uid}", method = RequestMethod.DELETE)
public final void delete(@PathVariable final Long uid) {
    final User user = this.checkId(uid);
    if (Objects.equals(user.getId(), SecurityUtils.actualUser().getId())) {
        AbstractException.throwActualUserCannotBeRemoved(user.getName());
    }
    this.dao.delete(uid);
    log.debug("Deleted user id {}", uid);
}

From source file:com.rockagen.gnext.controller.UserController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public @ResponseBody Object deleteUser(@PathVariable String id) {
    USERS.remove(id);/*w  w w  . j a va  2 s  . c o  m*/
    return "success.";
}

From source file:com.lixiaocong.rest.CommentController.java

@PreAuthorize("hasRole('ROLE_ADMIN') or isCommentOwner(#id)")
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public Map<String, Object> delete(@PathVariable long id) {
    commentService.delete(id);// w  w  w.  j  a v a2  s .  co  m
    return ResponseMsgFactory.createSuccessResponse();
}

From source file:com.nebhale.springone2013.web.GamesController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/{gameId}")
ResponseEntity<Void> destroyGame(@PathVariable Integer gameId) throws GameDoesNotExistException {
    this.gameRepository.remove(gameId);
    return new ResponseEntity<Void>(HttpStatus.OK);
}

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

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

    User deleted = userRepository.findOne(id);

    userRepository.delete(deleted);/*w  w  w.j a  v  a2 s .c o m*/
}

From source file:magoffin.matt.sobriquet.web.AliasController.java

/**
 * Delete an alias./*from ww  w  .java  2s . c  om*/
 * 
 * @param key
 *        The alias to delete.
 * @return The response.
 */
@RequestMapping(method = RequestMethod.DELETE, path = "/alias/{key}")
@ResponseBody
public Response<Object> delete(@PathVariable("key") String key) {
    Alias alias = aliasDao.get(key);
    if (alias != null) {
        aliasDao.delete(alias);
    }
    return Response.response(null);
}