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:com.example.todo.api.todo.TodoRestController.java

@RequestMapping(value = "{todoId}", method = RequestMethod.DELETE) // (1)
@ResponseStatus(HttpStatus.NO_CONTENT) // (2)
public void deleteTodo(@PathVariable("todoId") String todoId) { // (3)
    todoService.delete(todoId); // (4)
}

From source file:com.urservices.urerp.ecole.adresse.controller.AdresseController.java

@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
public String deleteAction(Adresse adresse, BindingResult bindingResult, SessionStatus sessionStatus) {
    iServiceAdresse.delete(adresse);//from  w  w  w .  j  a v  a 2s  . co m
    return "redirect:/adresse";
}

From source file:com.hp.autonomy.frontend.find.core.savedsearches.query.SavedQueryController.java

@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
public void delete(@SuppressWarnings("MVCPathVariableInspection") @PathVariable("id") final long id) {
    service.deleteById(id);/*ww w .  j  a v  a2s.  c  om*/
}

From source file:org.cloudfoundry.caldecott.server.controller.TunnelController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void delete(@PathVariable TunnelId id) {
    Tunnel tunnel = this.tunnels.get(id);
    tunnel.delete();//from   www.  j a  v a2  s. co m
}

From source file:technology.tikal.customers.service.ContactService.java

@RequestMapping(value = "/{contactId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)//from  www.  j  a va  2s. c  o  m
public void deleteContact(@PathVariable final Long customerId, @PathVariable final Long contactId) {
    customersController.deactivateContact(customerId, contactId);
}

From source file:ch.wisv.areafiftylan.products.controller.TicketRestController.java

@PreAuthorize("@currentUserServiceImpl.isTicketSender(principal, #token)")
@RequestMapping(value = "/transfer", method = RequestMethod.DELETE)
public ResponseEntity<?> cancelTicketTransfer(@RequestBody String token) {
    ticketService.cancelTicketTransfer(token);

    return createResponseEntity(HttpStatus.OK, "Ticket transfer successfully cancelled.");
}

From source file:com.pos.web.MasterSatuanCtrl.java

@RequestMapping(value = "/satuan/{id}", method = RequestMethod.DELETE)
public void delete(@PathVariable Integer id, HttpServletResponse response) {
    satuanDao.delete(id);
}

From source file:fi.helsinki.opintoni.web.rest.privateapi.TodoItemResource.java

@RequestMapping(value = "/{todoItemId}", method = RequestMethod.DELETE)
@Timed/*from w w w . j  a  v  a  2 s . co  m*/
public ResponseEntity<List<TodoItemDto>> delete(@UserId Long userId,
        @PathVariable("todoItemId") Long todoItemId) {
    permissionChecker.verifyPermission(userId, todoItemId, TodoItem.class);
    return response(() -> {
        todoItemService.delete(todoItemId);
        return getAllTodoItemsWithTooOldExcluded(userId);
    });
}

From source file:io.ignitr.dispatchr.manager.controller.client.ClientController.java

/**
 * Deletes a specific client.//  w  w  w  .  ja  va  2  s .  c  om
 *
 * @param clientId client identifier
 * @return an HTTP 204 response if the client was deleted or an HTTP 404 if the client does not exist
 */
@RequestMapping(method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public DeferredResult<ResponseEntity<?>> unregister(@PathVariable("clientId") String clientId,
        HttpServletRequest httpRequest) {
    final DeferredResult<ResponseEntity<?>> deferredResult = new DeferredResult<>();

    service.unregister(clientId).lift(new RequestContextStashOperator<>()).last().subscribeOn(Schedulers.io())
            .subscribe(complete -> {
                deferredResult.setResult(ResponseEntity.noContent().build());
            }, error -> {
                deferredResult.setErrorResult(errorHandler.handleError(httpRequest, error));
            });

    return deferredResult;
}

From source file:info.fcrp.keepitsafe.service.SecretService.java

@RequestMapping(value = "/secret/{id}", method = RequestMethod.DELETE)
public void remove(@PathVariable long id) {
    Secret secret = secretDAO.find(id);//from  ww w.  j  av  a2s.c  o  m
    secretDAO.delete(secret);
}