public class NetworkCmProxyController implements NetworkCmProxyApi {
private static final Gson GSON = new GsonBuilder().create();
+ private static final String NO_BODY = null;
private final ModelMapper modelMapper = new ModelMapper();
private final NetworkCmProxyDataService networkCmProxyDataService;
public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String resourceIdentifier,
final String cmHandle,
final Object requestBody, final String contentType) {
- networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
+ final Object responseObject = networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
resourceIdentifier, PATCH, GSON.toJson(requestBody), contentType);
- return new ResponseEntity<>(HttpStatus.OK);
+ return ResponseEntity.ok(responseObject);
}
/**
*
* @param resourceIdentifier resource identifier
* @param cmHandle cm handle identifier
- * @param requestBody the request body
* @param contentType content type of the body
* @return response entity no content if request is successful
*/
@Override
- public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String resourceIdentifier,
- final String cmHandle,
- final Object requestBody,
+ public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String cmHandle,
+ final String resourceIdentifier,
final String contentType) {
-
networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
- resourceIdentifier, DELETE, GSON.toJson(requestBody), contentType);
+ resourceIdentifier, DELETE, NO_BODY, contentType);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}