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:no.ntnu.okse.web.controller.TopicController.java

/**
 * This method deletes all topics registered in the TopicService
 *
 * @return A JSON serialized string//from w  w  w .  j a  v a 2  s .c  o m
 */
@RequestMapping(method = RequestMethod.DELETE, value = DELETE_ALL_TOPICS)
public @ResponseBody String deleteAllTopics() {
    log.info("Deleting all topics");
    TopicService ts = TopicService.getInstance();
    HashSet<Topic> allRootTopics = ts.getAllRootTopics();
    allRootTopics.forEach(t -> ts.deleteTopic(t.getFullTopicString()));

    return "{ \"messages\" :\"The topic were successfully deleted\" }";
}

From source file:org.energyos.espi.datacustodian.oauth.OauthAdminController.java

@RequestMapping(value = "custodian/oauth/tokens/{token}/retailcustomers/{userId}", method = RequestMethod.DELETE)
public ResponseEntity<Void> revokeToken(@PathVariable String userId, @PathVariable String token,
        Principal principal) throws Exception {
    checkResourceOwner(userId, principal);
    if (tokenServices.revokeToken(token)) {
        return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
    } else {//from   www  . j  a v  a 2  s  .c o  m
        return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
    }
}

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

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String delete(@PathVariable("id") Long id, Model uiModel, HttpServletRequest request) {
    ConditionOfUse.findConditionOfUse(id).remove();
    uiModel.asMap().clear();/* w w w  .  ja  v  a2s  .  c  o m*/

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

    return "redirect:/lists";
}

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

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

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

@RequestMapping(value = "/{customerId}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)/*  w w  w  .  j  a  v  a 2  s  . co  m*/
public void deleteCustomer(@PathVariable final Long customerId) {
    customersController.deactivateCustomer(customerId);
}

From source file:org.jbr.taskmgr.web.controller.TaskController.java

@RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE)
@RestEndpoint/*from   w w  w  .  ja  v  a2s. c om*/
public ResponseEntity<Message> deleteDocument(@PathVariable final UUID uuid) throws TaskManagerException {

    taskService.deleteTask(uuid);
    final Message resource = MessageBuilder.fromMessage("Deleted document task with uuid '" + uuid + "'")
            .build();
    return new ResponseEntity<>(resource, HttpStatus.OK);
}

From source file:com.auditbucket.fortress.endpoint.FortressEP.java

@RequestMapping(value = "/{fortressName}", method = RequestMethod.DELETE)
public void purgeFortress(@PathVariable("fortressName") String fortressName) throws DatagioException {
    fortressService.purge(fortressName);
}

From source file:com.torchmind.stockpile.server.controller.v1.ProfileController.java

/**
 * <code>DELETE /v1/profile/{name}</code>
 *
 * Purges a profile from the cache.//  www  . j a  va2s.co  m
 *
 * @param name a name or identifier.
 */
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(path = "/{name}", method = RequestMethod.DELETE)
public void purge(@Nonnull @PathVariable("name") String name) {
    if (UUID_PATTERN.matcher(name).matches()) {
        UUID identifier = UUID.fromString(name);
        this.profileService.purge(identifier);
        return;
    }

    this.profileService.purge(name);
}

From source file:hr.softwarecity.osijek.controllers.MosquitoController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ResponseEntity<List<Mosquito>> removeMosquito(@PathVariable long id) {
    Logger.getLogger("MosquitoController.java").log(Logger.Level.INFO, "Recognized DELETE request to /" + id);
    Mosquito found = mosquitoRepository.findByIdMosquito(id);
    mosquitoRepository.delete(found);/*from   ww w  . jav a2  s . c o  m*/
    Logger.getLogger("MosquitoController.java").log(Logger.Level.INFO,
            "Returning mosquito " + found.toString());
    return new ResponseEntity(mosquitoRepository.findAll(), HttpStatus.OK);
}

From source file:de.codecentric.boot.admin.controller.RegistryController.java

/**
 * Unregister an application within this admin application.
 * //from ww w  .  j av  a 2 s .  co m
 * @param id The application id.
 */
@RequestMapping(value = "/api/application/{id}", method = RequestMethod.DELETE)
public ResponseEntity<Application> unregister(@PathVariable String id) {
    LOGGER.debug("Unregister application with ID '{}'", id);
    Application app = registry.unregister(id);
    if (app != null) {
        return new ResponseEntity<Application>(app, HttpStatus.NO_CONTENT);
    } else {
        return new ResponseEntity<Application>(HttpStatus.NOT_FOUND);
    }
}