Skip to content

Instantly share code, notes, and snippets.

@krujos
Created March 16, 2015 19:56
Show Gist options
  • Save krujos/79fa1d2a1ccefe022936 to your computer and use it in GitHub Desktop.
Save krujos/79fa1d2a1ccefe022936 to your computer and use it in GitHub Desktop.
ResponseEntity<?>
@RequestMapping(value = BASE_PATH + "/{instanceId}", method = RequestMethod.GET)
public ResponseEntity<?> getServiceInstance(
@PathVariable("instanceId") String instanceId) {
logger.debug("GET: " + BASE_PATH + "/{instanceId}"
+ ", getServiceInstance(), serviceInstanceId = " + instanceId);
ServiceInstance instance = service.getServiceInstance(instanceId);
if (null == instance) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<String>("{}", headers, HttpStatus.GONE);
}
logger.debug("ServiceInstance: " + instance.getServiceInstanceId());
return new ResponseEntity<ServiceInstance>(instance, HttpStatus.OK);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment