Created
March 16, 2015 19:56
-
-
Save krujos/79fa1d2a1ccefe022936 to your computer and use it in GitHub Desktop.
ResponseEntity<?>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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