NIFI-2252: Fixed issue where POST to Controller Resource createControllerService and also ensure that URI is set on the entity. This closes #641

This commit is contained in:
Mark Payne 2016-07-13 10:54:27 -04:00 committed by Matt Gilman
parent 252bfb5c31
commit 6b87e1ea84
3 changed files with 4 additions and 4 deletions

View File

@ -416,7 +416,7 @@ public class ControllerResource extends ApplicationResource {
} }
if (isReplicateRequest()) { if (isReplicateRequest()) {
return replicate(HttpMethod.GET); return replicate(HttpMethod.POST, controllerServiceEntity);
} }
// handle expects request (usually from the cluster manager) // handle expects request (usually from the cluster manager)
@ -437,7 +437,7 @@ public class ControllerResource extends ApplicationResource {
// create the controller service and generate the json // create the controller service and generate the json
final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId()); final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId());
final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, null, controllerServiceEntity.getComponent()); final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, null, controllerServiceEntity.getComponent());
controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent()); controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
// build the response // build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();

View File

@ -616,7 +616,7 @@ public class ControllerServiceResource extends ApplicationResource {
() -> { () -> {
// update the controller service // update the controller service
final ControllerServiceEntity entity = serviceFacade.updateControllerService(revision, requestControllerServiceDTO); final ControllerServiceEntity entity = serviceFacade.updateControllerService(revision, requestControllerServiceDTO);
populateRemainingControllerServiceContent(entity.getComponent()); populateRemainingControllerServiceEntityContent(entity);
return clusterContext(generateOkResponse(entity)).build(); return clusterContext(generateOkResponse(entity)).build();
} }

View File

@ -2125,7 +2125,7 @@ public class ProcessGroupResource extends ApplicationResource {
// create the controller service and generate the json // create the controller service and generate the json
final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId()); final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId());
final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, groupId, controllerServiceEntity.getComponent()); final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, groupId, controllerServiceEntity.getComponent());
controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent()); controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
// build the response // build the response
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();