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

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

Introduction

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

Prototype

RequestMethod PUT

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

Click Source Link

Usage

From source file:com.otz.plugin.transport.funnel.controller.StreamsController.java

@CrossOrigin
@RequestMapping(path = "/component/{id}/streams/{name}/stages/{stageId}/status/{status}", method = RequestMethod.PUT)
@ResponseBody/*from w  ww  .  j  ava2  s  .c om*/
public ResponseEntity<Stage> getStreams(@PathVariable(value = "id") String id,
        @PathVariable(value = "name") String name, @PathVariable(value = "stageId") String stageId,
        @PathVariable(value = "status") StageStatus status) {

    Stage updatedStage = funnelService.updateStageAsync(id, name, stageId, status)
            .flatMap(stage -> funnelService
                    .triggerAsync(id, name, stageId, status, new HashMap<>(), Locale.ENGLISH)
                    .flatMap(stage1 -> Observable.just(stage)))
            .toBlocking().first();
    ;
    return new ResponseEntity(updatedStage, HttpStatus.OK);
}

From source file:cz.fi.muni.pa036.airticketbooking.rest.PlaneRest.java

@RequestMapping(method = RequestMethod.PUT)
public void updatePlane(@RequestBody @Valid PlaneDto plane) {
    planeService.update(plane);
}

From source file:br.com.desafiowallmart.service.RotaService.java

/**
 * Cadastra uma nova rota. //from   www . j  av  a 2s.  c  o m
 * @param cadastraRotaVO rota a ser cadastrada
 * @return Mensagem de Sucesso ou erro
 */
@RequestMapping(value = "/cadastraRota", method = RequestMethod.PUT)
public @ResponseBody String cadastraRota(@RequestBody CadastraRotaVO cadastraRotaVO) {
    try {
        rotaBO.cadastraRota(cadastraRotaVO.getRotaVO());
    } catch (DadosFaltandoException e) {
        return e.getMessage();
    }
    return CADASTRO_SUCESSO;
}

From source file:com.cemeterylistingsweb.presentation.rest.DisplayDeceasedController.java

@RequestMapping(value = "update", method = RequestMethod.PUT) //This the uri e.g http://localhost:8084/askweb/api/club/update
@ResponseBody//www .jav a  2s . c  o m
public String update(@RequestBody PublishedDeceasedListing PDL) {
    cs.merge(PDL);
    System.out.println(" Update Called ");
    return "Club Update";
}

From source file:pitayaa.nail.msg.core.account.controller.AccountLicenseController.java

@RequestMapping(value = "/accountsLicense/{ID}", method = RequestMethod.PUT)
public @ResponseBody ResponseEntity<?> updateAccountLicenseModel(@RequestBody AccountLicense accLicenseBody,
        @PathVariable("ID") UUID uid) throws Exception {

    Optional<AccountLicense> accountLicense = accLicenseService.findOne(uid);

    if (!accountLicense.isPresent()) {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }//  www . jav  a2s.com

    accLicenseBody = accLicenseService.update(accLicenseBody);

    return ResponseEntity.ok(accLicenseBody);
}

From source file:com.ezsource_mobile.rfxdb.controller.QueryExecutionController.java

@RequestMapping(value = "/queries/updateMobileRegnId", method = RequestMethod.PUT)
@WMAccessVisibility(value = AccessSpecifier.APP_ONLY)
@ApiOperation(value = "sets mobile device registration id for that user")
public Integer executeUpdateMobileRegnId(
        @Valid @RequestBody UpdateMobileRegnIdRequest updateMobileRegnIdRequest) {
    LOGGER.debug("Executing named query: updateMobileRegnId");
    Integer _result = queryService.executeUpdateMobileRegnId(updateMobileRegnIdRequest);
    LOGGER.debug("got the result for named query: updateMobileRegnId, result:{}", _result);
    return _result;
}

From source file:cz.fi.muni.pa165.mushroomhunter.rest.MushroomRest.java

@RequestMapping(method = RequestMethod.PUT)
public MushroomDto updateMushroom(@RequestBody @Valid MushroomDto mushroom) {
    Long currentUserId = securityService.getCurrentlyLoggedUser().getId();
    if (!securityService.isCurrentlyLoggedUserAdmin()) {
        throw new AccessDeniedException("Access denien: User " + currentUserId
                + " is not admin so he cannot update mushroom " + mushroom.getId());
    }/*from w w w  .  ja v  a2 s  .c  om*/
    return mushroomService.update(mushroom);
}

From source file:edu.eci.arsw.pacm.controllers.PacmRESTController.java

@RequestMapping(path = "/{salanum}/protectores", method = RequestMethod.PUT)
public ResponseEntity<?> agregarProtector(@PathVariable(name = "salanum") String salanum,
        @RequestBody Player p) {/*from w w  w .  j  a  v a  2 s .  c  o  m*/
    synchronized (this) {
        try {
            if (services.getProtectores(Integer.parseInt(salanum)).size() < 4) {
                services.registrarJugadorProtector(Integer.parseInt(salanum), p);
            }
        } catch (ServicesException ex) {
            Logger.getLogger(PacmRESTController.class.getName()).log(Level.SEVERE, null, ex);
            return new ResponseEntity<>(ex.getLocalizedMessage(), HttpStatus.BAD_REQUEST);
        }
        return new ResponseEntity<>(HttpStatus.CREATED);
    }
}

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

@RequestMapping(value = { "/entityid" }, method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)//from   w  w w . j a va 2  s .  co  m
@ResponseBody
public void setEntityID(@RequestBody EntityID entityID) {
    log.debug("Request to set entityID {}", entityID.getValue());
    configuration.setEntityID(entityID.getValue());
}

From source file:com.artivisi.salary.payroll.system.controller.BankController.java

@RequestMapping(value = "/bank/{id}", method = RequestMethod.PUT)
public void editBank(@PathVariable String id, @RequestBody Bank b) throws Exception {
    Bank bank = bankService.findOne(id);
    if (bank == null) {
        throw new Exception("User tidak ditemukan");
    }//  w ww.j a v a 2 s . c  o  m

    b.setId(bank.getId());
    bankService.save(b);
}