diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java index 1fe87ab06f..09abe5381d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java @@ -677,9 +677,9 @@ public class ControllerResource extends ApplicationResource { authorizeController(RequestAction.WRITE); }, null, - (endDateEtity) -> { + (endDateEntity) -> { // purge the actions - serviceFacade.deleteActions(endDateEtity.getEndDate()); + serviceFacade.deleteActions(endDateEntity.getEndDate()); // generate the response return generateOkResponse(new HistoryEntity()).build(); @@ -700,6 +700,7 @@ public class ControllerResource extends ApplicationResource { } // setters + public void setServiceFacade(final NiFiServiceFacade serviceFacade) { this.serviceFacade = serviceFacade; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/CountersResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/CountersResource.java index a8be20d93b..e3a2b9eeab 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/CountersResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/CountersResource.java @@ -226,6 +226,9 @@ public class CountersResource extends ApplicationResource { ) public Response updateCounter( @Context final HttpServletRequest httpServletRequest, + @ApiParam( + value = "The id of the counter." + ) @PathParam("id") final String id) { if (isReplicateRequest()) { @@ -244,7 +247,7 @@ public class CountersResource extends ApplicationResource { null, (componentEntity) -> { // reset the specified counter - final CounterDTO counter = serviceFacade.updateCounter(requestComponentEntity.getId()); + final CounterDTO counter = serviceFacade.updateCounter(componentEntity.getId()); // create the response entity final CounterEntity entity = new CounterEntity(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java index 64ddde3bd4..78c7287574 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java @@ -173,7 +173,7 @@ public class LabelResource extends ApplicationResource { ) @PathParam("id") final String id, @ApiParam( - value = "The label configuraiton details.", + value = "The label configuration details.", required = true ) final LabelEntity requestLabelEntity) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java index b348828fec..527364c291 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java @@ -387,10 +387,10 @@ public class ProcessGroupResource extends ApplicationResource { // delete the process group final ProcessGroupEntity entity = serviceFacade.deleteProcessGroup(revision, processGroupEntity.getId()); - // create the response - return clusterContext(generateOkResponse(entity)).build(); - } - ); + // create the response + return clusterContext(generateOkResponse(entity)).build(); + } + ); } /** @@ -548,7 +548,7 @@ public class ProcessGroupResource extends ApplicationResource { * * @param httpServletRequest request * @param groupId The group id - * @param processorEntity A processorEntity. + * @param requestProcessorEntity A processorEntity. * @return A processorEntity. */ @POST @@ -582,17 +582,17 @@ public class ProcessGroupResource extends ApplicationResource { @ApiParam( value = "The processor configuration details.", required = true - ) final ProcessorEntity processorEntity) { + ) final ProcessorEntity requestProcessorEntity) { - if (processorEntity == null || processorEntity.getComponent() == null) { + if (requestProcessorEntity == null || requestProcessorEntity.getComponent() == null) { throw new IllegalArgumentException("Processor details must be specified."); } - if (processorEntity.getRevision() == null || (processorEntity.getRevision().getVersion() == null || processorEntity.getRevision().getVersion() != 0)) { + if (requestProcessorEntity.getRevision() == null || (requestProcessorEntity.getRevision().getVersion() == null || requestProcessorEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Processor."); } - final ProcessorDTO requestProcessor = processorEntity.getComponent(); + final ProcessorDTO requestProcessor = requestProcessorEntity.getComponent(); if (requestProcessor.getId() != null) { throw new IllegalArgumentException("Processor ID cannot be specified."); } @@ -608,12 +608,12 @@ public class ProcessGroupResource extends ApplicationResource { requestProcessor.setParentGroupId(groupId); if (isReplicateRequest()) { - return replicate(HttpMethod.POST, processorEntity); + return replicate(HttpMethod.POST, requestProcessorEntity); } return withWriteLock( serviceFacade, - processorEntity, + requestProcessorEntity, lookup -> { final Authorizable processGroup = lookup.getProcessGroup(groupId).getAuthorizable(); processGroup.authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); @@ -625,13 +625,15 @@ public class ProcessGroupResource extends ApplicationResource { } }, null, - procEntity -> { + processorEntity -> { + final ProcessorDTO processor = processorEntity.getComponent(); + // set the processor id as appropriate - requestProcessor.setId(generateUuid()); + processor.setId(generateUuid()); // create the new processor - final Revision revision = getRevision(processorEntity, requestProcessor.getId()); - final ProcessorEntity entity = serviceFacade.createProcessor(revision, groupId, requestProcessor); + final Revision revision = getRevision(processorEntity, processor.getId()); + final ProcessorEntity entity = serviceFacade.createProcessor(revision, groupId, processor); processorResource.populateRemainingProcessorEntityContent(entity); // generate a 201 created response