Example usage for org.springframework.http MediaType APPLICATION_JSON_VALUE

List of usage examples for org.springframework.http MediaType APPLICATION_JSON_VALUE

Introduction

In this page you can find the example usage for org.springframework.http MediaType APPLICATION_JSON_VALUE.

Prototype

String APPLICATION_JSON_VALUE

To view the source code for org.springframework.http MediaType APPLICATION_JSON_VALUE.

Click Source Link

Document

A String equivalent of MediaType#APPLICATION_JSON .

Usage

From source file:com.expedia.seiso.web.controller.v1.IpAddressRoleControllerV1.java

@RequestMapping(value = SINGLE_URI_TEMPLATE, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.NO_CONTENT)//  www. j a  v a 2s .co  m
public void put(@PathVariable String serviceInstanceKey, @PathVariable String name,
        PEResource ipAddressRoleResource) {

    basicItemDelegate.put(ipAddressRoleResource.getItem(), true);
}

From source file:org.esbtools.gateway.resync.controller.ResyncGateway.java

@RequestMapping(value = "/resync", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, headers = "content-type=application/json")
public ResponseEntity<ResyncResponse> resync(@RequestBody ResyncRequest resyncRequest) {
    ResyncService resyncService = resyncServiceRepository.getBySystem(resyncRequest.getSystem());
    ResyncResponse resyncResponse = resyncService.resync(resyncRequest);
    return new ResponseEntity<>(resyncResponse, HttpStatus.OK);
}

From source file:py.com.sodep.web.UserWatchListController.java

@RequestMapping(value = "/users/{username}/watchlist", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> addToWatchList(@PathVariable String username,
        @RequestBody String movieTitle) {
    userService.addToWatchList(username, movieTitle);
    return new ResponseEntity<>(new RestResponse(true, "Movie added succesfully"), HttpStatus.ACCEPTED);
}

From source file:ui.controller.ItemDatabaseRestController.java

@RequestMapping(method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public void updateTweet(@RequestBody User u) {
    getService().updateUser(u);
}

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

/**
 * Finds a specific client.// ww w . ja  va  2s. co m
 *
 * @param clientId client identifier
 * @return an HTTP 200 response containing the client metadata or an HTTP 404 if the client does not exist
 */
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public DeferredResult<ResponseEntity<FindClientResponse>> findOne(@PathVariable("clientId") String clientId,
        HttpServletRequest httpRequest) {
    final DeferredResult<ResponseEntity<FindClientResponse>> deferredResult = new DeferredResult<>();

    service.findOne(clientId).lift(new RequestContextStashOperator<>()).last().map(FindClientResponse::from)
            .subscribeOn(Schedulers.io()).subscribe(body -> {
                deferredResult.setResult(ResponseEntity.ok(body));
            }, error -> {
                deferredResult.setErrorResult(errorHandler.handleError(httpRequest, error));
            });

    return deferredResult;
}

From source file:com.blstream.patronage.ctf.common.web.controller.RestController.java

/**
 * This method finds existing document based on id.
 * @param id/*from   ww w .  j  a v  a  2  s.c o m*/
 * @return T
 */
@RequestMapping(value = "{id}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
T findById(@PathVariable ID id);

From source file:com.expedia.seiso.web.controller.v1.ServiceInstancePortControllerV1.java

@RequestMapping(value = SINGLE_URI_TEMPLATE, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.NO_CONTENT)/* w  w  w .  java  2  s.  c  o m*/
public void put(@PathVariable String serviceInstanceKey, @PathVariable Integer number, PEResource sipResource) {
    basicItemDelegate.put(sipResource.getItem(), true);
}

From source file:com.orange.cloud.servicebroker.filter.core.service.ServiceInstanceBindingServiceClient.java

@RequestMapping(value = "/v2/service_instances/{instanceId}/service_bindings/{bindingId}", method = RequestMethod.DELETE, produces = {
        MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<String> deleteServiceInstanceBinding(@PathVariable("instanceId") String serviceInstanceId,
        @PathVariable("bindingId") String bindingId, @RequestParam("service_id") String serviceDefinitionId,
        @RequestParam("plan_id") String planId);

From source file:com.orange.cloud.servicebroker.filter.core.service.ServiceInstanceServiceClient.java

@RequestMapping(value = "/v2/service_instances/{instanceId}", method = RequestMethod.DELETE, produces = {
        MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<DeleteServiceInstanceResponse> deleteServiceInstance(
        @PathVariable("instanceId") String serviceInstanceId,
        @RequestParam("service_id") String serviceDefinitionId, @RequestParam("plan_id") String planId,
        @RequestParam(value = "accepts_incomplete", required = false) boolean acceptsIncomplete);

From source file:web.UsersRESTController.java

/**
 * Gets a specific user's info based on User ID through REST API
 * @param id//from w w w .  j  a v a2 s .  co m
 * @return
 */
@RequestMapping(value = "/api/users/userinfo/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Users> getUserInfo(@PathVariable("id") int id) {
    Users user = null;
    //returns a NOT_FOUND error if no User is tied to specific UserID        
    try {
        user = dao.getUserById(id);
    } catch (EmptyResultDataAccessException ex) {
        return new ResponseEntity<Users>(HttpStatus.NOT_FOUND);
    }
    //otherwise returns specific User's info
    return new ResponseEntity<Users>(user, HttpStatus.OK);
}