From 78fbb8f2ee70d264787856e4a6337217bcfeba79 Mon Sep 17 00:00:00 2001 From: m-hogue Date: Mon, 10 Jul 2017 11:41:50 -0400 Subject: [PATCH] NIFI-3939: Reviewed and corrected all incorrect nifi-web-api resource response types. This closes #1999 --- .../org/apache/nifi/web/api/ControllerServiceResource.java | 6 +++--- .../java/org/apache/nifi/web/api/FlowFileQueueResource.java | 4 +++- .../src/main/java/org/apache/nifi/web/api/FlowResource.java | 3 +-- .../java/org/apache/nifi/web/api/ProcessGroupResource.java | 5 ++--- .../java/org/apache/nifi/web/api/ProcessorResource.java | 4 ++-- .../org/apache/nifi/web/api/ProvenanceEventResource.java | 2 ++ .../java/org/apache/nifi/web/api/ReportingTaskResource.java | 4 ++-- .../main/java/org/apache/nifi/web/api/TemplateResource.java | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java index 6cbc2410ec..fdaff5ab26 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java @@ -268,7 +268,7 @@ public class ControllerServiceResource extends ApplicationResource { @Path("{id}/state") @ApiOperation( value = "Gets the state for a controller service", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /controller-services/{uuid}", type = "") } @@ -323,7 +323,7 @@ public class ControllerServiceResource extends ApplicationResource { @Path("{id}/state/clear-requests") @ApiOperation( value = "Clears the state for a controller service", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /controller-services/{uuid}", type = "") } @@ -385,7 +385,7 @@ public class ControllerServiceResource extends ApplicationResource { @Path("{id}/references") @ApiOperation( value = "Gets a controller service", - response = ControllerServiceEntity.class, + response = ControllerServiceReferencingComponentsEntity.class, authorizations = { @Authorization(value = "Read - /controller-services/{uuid}", type = "") } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowFileQueueResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowFileQueueResource.java index ab232e836b..1017aca052 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowFileQueueResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowFileQueueResource.java @@ -126,6 +126,7 @@ public class FlowFileQueueResource extends ApplicationResource { @Path("{id}/flowfiles/{flowfile-uuid}") @ApiOperation( value = "Gets a FlowFile from a Connection.", + response = FlowFileEntity.class, authorizations = { @Authorization(value = "Read Source Data - /data/{component-type}/{uuid}", type = "") } @@ -201,6 +202,7 @@ public class FlowFileQueueResource extends ApplicationResource { @Path("{id}/flowfiles/{flowfile-uuid}/content") @ApiOperation( value = "Gets the content for a FlowFile in a Connection.", + response = StreamingOutput.class, authorizations = { @Authorization(value = "Read Source Data - /data/{component-type}/{uuid}", type = "") } @@ -429,7 +431,7 @@ public class FlowFileQueueResource extends ApplicationResource { @Path("{id}/listing-requests/{listing-request-id}") @ApiOperation( value = "Cancels and/or removes a request to list the contents of this connection.", - response = DropRequestEntity.class, + response = ListingRequestEntity.class, authorizations = { @Authorization(value = "Read Source Data - /data/{component-type}/{uuid}", type = "") } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java index a4b96c985f..94361a3687 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java @@ -540,7 +540,6 @@ public class FlowResource extends ApplicationResource { @Path("process-groups/{id}") @ApiOperation( value = "Schedule or unschedule comopnents in the specified Process Group.", - notes = "", response = ScheduleComponentsEntity.class, authorizations = { @Authorization(value = "Read - /flow", type = ""), @@ -1547,7 +1546,7 @@ public class FlowResource extends ApplicationResource { @Path("remote-process-groups/{id}/status") @ApiOperation( value = "Gets status for a remote process group", - response = ProcessorStatusEntity.class, + response = RemoteProcessGroupStatusEntity.class, authorizations = { @Authorization(value = "Read - /flow", type = "") } 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 5b3ba843e7..a9167aea07 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 @@ -61,7 +61,6 @@ import org.apache.nifi.web.api.entity.ControllerServiceEntity; import org.apache.nifi.web.api.entity.CopySnippetRequestEntity; import org.apache.nifi.web.api.entity.CreateTemplateRequestEntity; import org.apache.nifi.web.api.entity.FlowEntity; -import org.apache.nifi.web.api.entity.FlowSnippetEntity; import org.apache.nifi.web.api.entity.FunnelEntity; import org.apache.nifi.web.api.entity.FunnelsEntity; import org.apache.nifi.web.api.entity.InputPortsEntity; @@ -519,7 +518,7 @@ public class ProcessGroupResource extends ApplicationResource { @Path("{id}/process-groups") @ApiOperation( value = "Gets all process groups", - response = ProcessorsEntity.class, + response = ProcessGroupsEntity.class, authorizations = { @Authorization(value = "Read - /process-groups/{uuid}", type = "") } @@ -1756,7 +1755,7 @@ public class ProcessGroupResource extends ApplicationResource { @Path("{id}/snippet-instance") @ApiOperation( value = "Copies a snippet and discards it.", - response = FlowSnippetEntity.class, + response = FlowEntity.class, authorizations = { @Authorization(value = "Write - /process-groups/{uuid}", type = ""), @Authorization(value = "Read - /{component-type}/{uuid} - For each component in the snippet and their descendant components", type = ""), diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java index 4c53ef7ba5..a56241c3c5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java @@ -276,7 +276,7 @@ public class ProcessorResource extends ApplicationResource { @Path("/{id}/state") @ApiOperation( value = "Gets the state for a processor", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /processors/{uuid}", type = "") } @@ -332,7 +332,7 @@ public class ProcessorResource extends ApplicationResource { @Path("{id}/state/clear-requests") @ApiOperation( value = "Clears the state for a processor", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /processors/{uuid}", type = "") } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java index 55f78e8b24..559aeac1e8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java @@ -79,6 +79,7 @@ public class ProvenanceEventResource extends ApplicationResource { @Path("{id}/content/input") @ApiOperation( value = "Gets the input content for a provenance event", + response = StreamingOutput.class, authorizations = { @Authorization(value = "Read Component Data - /data/{component-type}/{uuid}", type = "") } @@ -161,6 +162,7 @@ public class ProvenanceEventResource extends ApplicationResource { @Path("{id}/content/output") @ApiOperation( value = "Gets the output content for a provenance event", + response = StreamingOutput.class, authorizations = { @Authorization(value = "Read Component Data - /data/{component-type}/{uuid}", type = "") } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java index ad035fc0a1..d1b43048ed 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java @@ -255,7 +255,7 @@ public class ReportingTaskResource extends ApplicationResource { @Path("{id}/state") @ApiOperation( value = "Gets the state for a reporting task", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /reporting-tasks/{uuid}", type = "") } @@ -310,7 +310,7 @@ public class ReportingTaskResource extends ApplicationResource { @Path("{id}/state/clear-requests") @ApiOperation( value = "Clears the state for a reporting task", - response = ComponentStateDTO.class, + response = ComponentStateEntity.class, authorizations = { @Authorization(value = "Write - /reporting-tasks/{uuid}", type = "") } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java index 36823f5dd2..052f75cbb0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java @@ -95,7 +95,7 @@ public class TemplateResource extends ApplicationResource { @Path("{id}/download") @ApiOperation( value = "Exports a template", - response = TemplateDTO.class, + response = String.class, authorizations = { @Authorization(value = "Read - /templates/{uuid}", type = "") }