List of usage examples for org.springframework.http MediaType APPLICATION_JSON_VALUE
String APPLICATION_JSON_VALUE
To view the source code for org.springframework.http MediaType APPLICATION_JSON_VALUE.
Click Source Link
From source file:com.unidev.polycms.hateoas.controller.StorageQueryController.java
@GetMapping(value = "/storage/{storage}/poly/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public HateoasResponse fetchPoly(@PathVariable("storage") String storage, @PathVariable("id") String id) { if (!polyCore.existTenant(storage)) { LOG.warn("Not found storage {}", storage); throw new StorageNotFoundException("Storage " + storage + " not found"); }//w ww .j a v a 2 s. co m SQLitePolyStorage sqLitePolyStorage = polyCore.fetchSqliteStorage(storage); Optional<PolyRecord> polyRecord = sqLitePolyStorage.fetchPoly(id); polyRecord.orElseThrow(StorageNotFoundException::new); HateoasResponse hateoasResponse = hateoasResponse().data(polyRecord.get()); hateoasResponse.add(linkTo(StorageIndexController.class).slash("storage").slash(storage).slash("poly") .slash(id).withSelfRel()); return hateoasResponse; }
From source file:org.openbaton.common.vnfm_sdk.rest.AbstractVnfmSpringReST.java
@RequestMapping(value = "/core-rest-actions", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.NO_CONTENT)//w w w . j a v a2 s. c o m public void receive(@RequestBody /*@Valid*/ String jsonNfvMessage) { log.debug("Received: " + jsonNfvMessage); NFVMessage nfvMessage = gson.fromJson(jsonNfvMessage, NFVMessage.class); try { this.onAction(nfvMessage); } catch (NotFoundException e) { e.printStackTrace(); throw new RuntimeException(e); } catch (BadFormatException e) { e.printStackTrace(); throw new RuntimeException(e); } }
From source file:net.prasenjit.auth.controller.UserController.java
/** * <p>findAllUsers.</p>/*from w w w . j a v a 2s .c o m*/ * * @return a {@link java.util.List} object. */ @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<User> findAllUsers() { return userservice.getAllUser(); }
From source file:se.skltp.cooperation.web.rest.v1.controller.ConnectionPointController.java
/** * GET /connectionPoints -> get all the connectionPoints as json *///w ww. j a v a 2 s . c om @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<ConnectionPointDTO> getAllAsJson(@RequestParam(required = false) String platform, @RequestParam(required = false) String environment, @RequestParam(required = false) Long serviceConsumerId, @RequestParam(required = false) Long logicalAddressId, @RequestParam(required = false) Long serviceContractId, @RequestParam(required = false) Long serviceProducerId) { log.debug("REST request to get all ConnectionPoints as json"); return getAll(platform, environment, serviceConsumerId, logicalAddressId, serviceContractId, serviceProducerId); }
From source file:de.dominikschadow.configclient.secret.SecretController.java
/** * Returns the complete secret identified by the given user id. Returned data can be limited to the secrets content * by specifying the value secret for the query param type. * * @param userId The user id to load the secret for * @param type The return type, empty for all, secret for the secret only * @return The loaded secret from vault/*from w w w .ja va2 s .c o m*/ */ @GetMapping(value = "/secrets/{userId}", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Returns the secret stored for the given user id", notes = "Returned data can be limited to the secrets content by specifying the value secret for the query param type.", response = Object.class) public ResponseEntity<Object> readSecret(@PathVariable String userId, @RequestParam(value = "type", required = false) String type) { VaultResponse secret = vaultTemplate.read(SECRET_BASE_PATH + userId); if ("secret".equals(type)) { return ResponseEntity.ok(secret.getData()); } else { return ResponseEntity.ok(secret); } }
From source file:se.skltp.cooperation.web.rest.v1.controller.ServiceContractController.java
/** * GET /serviceContracts -> get all the serviceContracts. Content type: JSON *//*w w w.j a v a 2s . c o m*/ @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<ServiceContractDTO> getAllAsJson(@RequestParam(required = false) String namespace, @RequestParam(required = false) Long connectionPointId, @RequestParam(required = false) Long logicalAddressId, @RequestParam(required = false) Long serviceConsumerId, @RequestParam(required = false) Long serviceProducerId, @RequestParam(required = false) Long serviceDomainId) { log.debug("REST request to get all ServiceContracts as json"); return getAll(namespace, connectionPointId, logicalAddressId, serviceConsumerId, serviceProducerId, serviceDomainId); }
From source file:se.skltp.cooperation.web.rest.v1.controller.ServiceProducerController.java
/** * GET /connectionPoints -> get all the connectionPoints. Content type: JSON *//*from w w w.j a va 2s . co m*/ @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<ServiceProducerDTO> getAllAsJson(@RequestParam(required = false) String hsaId, @RequestParam(required = false) Long connectionPointId, @RequestParam(required = false) Long logicalAddressId, @RequestParam(required = false) Long serviceContractId, @RequestParam(required = false) Long serviceConsumerId) { log.debug("REST request to get all ServiceProducers as json"); return getAll(hsaId, connectionPointId, logicalAddressId, serviceContractId, serviceConsumerId); }
From source file:se.skltp.cooperation.web.rest.v1.controller.ServiceConsumerController.java
/** * GET /connectionPoints -> get all the connectionPoints. Content type: JSON */// w w w . ja va2s . co m @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<ServiceConsumerDTO> getAllAsJson(@RequestParam(required = false) Long connectionPointId, @RequestParam(required = false) Long logicalAddressId, @RequestParam(required = false) Long serviceContractId, @RequestParam(required = false) Long serviceProducerId) { log.debug("REST request to get all ServiceConsumers as json"); List<ServiceConsumerDTO> result = getAll(connectionPointId, logicalAddressId, serviceContractId, serviceProducerId); return result; }
From source file:eu.cloudwave.wp5.feedbackhandler.controller.MonitoringController.java
@RequestMapping(value = Urls.MONITORING__DATA, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK)//from w w w . j a v a 2 s .co m public Boolean data(@RequestHeader(Headers.ACCESS_TOKEN) final String accessToken, @RequestHeader(Headers.APPLICATION_ID) final String applicationId, @RequestBody final MetricContainingProcedureExecutionDto procedureExecutionDto) { final DbApplication application = handleUnauthorized(applicationId, accessToken); // TODO: remove print // ProcedureExecutionPrinter.print(procedureExecutionDto, false); monitoringDataService.persist(application, procedureExecutionDto); return true; }
From source file:io.github.azige.bbs.web.controller.AccountController.java
@RequestMapping(value = "/profile/current.json", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody//from w w w .j a v a 2 s . c om public Profile profileCurrent() { return (Profile) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); }