Repository: nifi
Updated Branches:
  refs/heads/NIFI-1563 61a7cbeaa -> 3337ea951


NIFI-1563:
- Removing unused endpoints.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8f28237f
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8f28237f
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8f28237f

Branch: refs/heads/NIFI-1563
Commit: 8f28237ff32acda4e937c8a06417019554657692
Parents: 61a7cbe
Author: Matt Gilman <[email protected]>
Authored: Fri Mar 18 12:46:44 2016 -0400
Committer: Matt Gilman <[email protected]>
Committed: Fri Mar 18 12:46:44 2016 -0400

----------------------------------------------------------------------
 .../org/apache/nifi/web/NiFiServiceFacade.java  |  7 --
 .../nifi/web/StandardNiFiServiceFacade.java     | 85 +++++---------------
 .../apache/nifi/web/api/ClusterResource.java    | 62 --------------
 .../src/main/resources/nifi-web-api-context.xml |  1 -
 4 files changed, 18 insertions(+), 137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
index d642079..c6e7ebb 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
@@ -1548,13 +1548,6 @@ public interface NiFiServiceFacade {
      */
     void deleteNode(String nodeId);
 
-    /**
-     * Returns the cluster's status.
-     *
-     * @return The cluster status
-     */
-    ClusterStatusDTO getClusterStatus();
-
     // ----------------------------------------
     // BulletinBoard methods
     // ----------------------------------------

http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 563e7aa..b981bde 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -16,25 +16,6 @@
  */
 package org.apache.nifi.web;
 
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TimeZone;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import javax.ws.rs.WebApplicationException;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.action.Action;
@@ -46,7 +27,6 @@ import org.apache.nifi.admin.service.AccountNotFoundException;
 import org.apache.nifi.admin.service.AuditService;
 import org.apache.nifi.admin.service.UserService;
 import org.apache.nifi.authorization.Authority;
-import org.apache.nifi.cluster.HeartbeatPayload;
 import org.apache.nifi.cluster.context.ClusterContext;
 import org.apache.nifi.cluster.context.ClusterContextThreadLocal;
 import org.apache.nifi.cluster.manager.exception.UnknownNodeException;
@@ -72,7 +52,6 @@ import 
org.apache.nifi.controller.repository.claim.ContentDirection;
 import org.apache.nifi.controller.service.ControllerServiceNode;
 import org.apache.nifi.controller.service.ControllerServiceReference;
 import org.apache.nifi.controller.service.ControllerServiceState;
-import org.apache.nifi.controller.status.ProcessGroupStatus;
 import org.apache.nifi.diagnostics.SystemDiagnostics;
 import org.apache.nifi.groups.ProcessGroup;
 import org.apache.nifi.groups.ProcessGroupCounts;
@@ -137,10 +116,8 @@ import 
org.apache.nifi.web.api.dto.provenance.ProvenanceEventDTO;
 import org.apache.nifi.web.api.dto.provenance.ProvenanceOptionsDTO;
 import org.apache.nifi.web.api.dto.provenance.lineage.LineageDTO;
 import org.apache.nifi.web.api.dto.search.SearchResultsDTO;
-import org.apache.nifi.web.api.dto.status.ClusterStatusDTO;
 import org.apache.nifi.web.api.dto.status.ConnectionStatusDTO;
 import org.apache.nifi.web.api.dto.status.ControllerStatusDTO;
-import org.apache.nifi.web.api.dto.status.NodeStatusDTO;
 import org.apache.nifi.web.api.dto.status.PortStatusDTO;
 import org.apache.nifi.web.api.dto.status.ProcessGroupStatusDTO;
 import org.apache.nifi.web.api.dto.status.ProcessorStatusDTO;
@@ -165,6 +142,24 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.security.access.AccessDeniedException;
 
+import javax.ws.rs.WebApplicationException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
 /**
  * Implementation of NiFiServiceFacade that performs revision checking.
  */
@@ -2836,50 +2831,6 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
     }
 
     @Override
-    public ClusterStatusDTO getClusterStatus() {
-
-        // create cluster status dto
-        final ClusterStatusDTO clusterStatusDto = new ClusterStatusDTO();
-
-        // populate node status dtos
-        final Collection<NodeStatusDTO> nodeStatusDtos = new ArrayList<>();
-        clusterStatusDto.setNodeStatus(nodeStatusDtos);
-
-        for (final Node node : clusterManager.getNodes()) {
-
-            if (Node.Status.CONNECTED != node.getStatus()) {
-                continue;
-            }
-
-            final HeartbeatPayload nodeHeartbeatPayload = 
node.getHeartbeatPayload();
-            if (nodeHeartbeatPayload == null) {
-                continue;
-            }
-
-            final ProcessGroupStatus nodeProcessGroupStatus = 
nodeHeartbeatPayload.getProcessGroupStatus();
-            if (nodeProcessGroupStatus == null) {
-                continue;
-            }
-
-            final ProcessGroupStatusDTO nodeProcessGroupStatusDto = 
dtoFactory.createProcessGroupStatusDto(clusterManager.getBulletinRepository(), 
nodeProcessGroupStatus);
-
-            // create node status dto
-            final NodeStatusDTO nodeStatusDto = new NodeStatusDTO();
-            nodeStatusDtos.add(nodeStatusDto);
-
-            // populate the status
-            nodeStatusDto.setControllerStatus(nodeProcessGroupStatusDto);
-
-            // create and add node dto
-            final String nodeId = node.getNodeId().getId();
-            nodeStatusDto.setNode(dtoFactory.createNodeDTO(node, 
clusterManager.getNodeEvents(nodeId), isPrimaryNode(nodeId)));
-
-        }
-
-        return clusterStatusDto;
-    }
-
-    @Override
     public ProcessorDTO getProcessor(String id) {
         ClassLoader currentContextClassLoader = 
Thread.currentThread().getContextClassLoader();
         try {

http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
index bd6a39a..ec4c69e 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
@@ -37,10 +37,8 @@ import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
 import org.apache.nifi.web.api.dto.ProcessorDTO;
 import org.apache.nifi.web.api.dto.RevisionDTO;
 import org.apache.nifi.web.api.dto.search.NodeSearchResultDTO;
-import org.apache.nifi.web.api.dto.status.ClusterStatusDTO;
 import org.apache.nifi.web.api.entity.ClusterEntity;
 import org.apache.nifi.web.api.entity.ClusterSearchResultsEntity;
-import org.apache.nifi.web.api.entity.ClusterStatusEntity;
 import org.apache.nifi.web.api.entity.ProcessorEntity;
 import org.apache.nifi.web.api.request.ClientIdParameter;
 import org.apache.nifi.web.api.request.LongParameter;
@@ -77,7 +75,6 @@ public class ClusterResource extends ApplicationResource {
     private ResourceContext resourceContext;
     private NiFiServiceFacade serviceFacade;
     private NiFiProperties properties;
-    private WebClusterManager clusterManager;
 
     /**
      * Locates the ClusterConnection sub-resource.
@@ -94,62 +91,6 @@ public class ClusterResource extends ApplicationResource {
     }
 
     /**
-     * Gets the status of this NiFi cluster.
-     *
-     * @param clientId Optional client id. If the client id is not specified, 
a new one will be generated. This value (whether specified or generated) is 
included in the response.
-     * @return A clusterStatusEntity
-     */
-    @GET
-    @Consumes(MediaType.WILDCARD)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Path("/status")
-    @PreAuthorize("hasAnyRole('ROLE_MONITOR', 'ROLE_DFM', 'ROLE_ADMIN')")
-    @ApiOperation(
-            value = "Gets the status of the cluster",
-            response = ClusterStatusEntity.class,
-            authorizations = {
-                @Authorization(value = "Read Only", type = "ROLE_MONITOR"),
-                @Authorization(value = "DFM", type = "ROLE_DFM"),
-                @Authorization(value = "Admin", type = "ROLE_ADMIN")
-            }
-    )
-    @ApiResponses(
-            value = {
-                @ApiResponse(code = 400, message = "NiFi was unable to 
complete the request because it was invalid. The request should not be retried 
without modification."),
-                @ApiResponse(code = 401, message = "Client could not be 
authenticated."),
-                @ApiResponse(code = 403, message = "Client is not authorized 
to make this request."),
-                @ApiResponse(code = 409, message = "The request was valid but 
NiFi was not in the appropriate state to process it. Retrying the same request 
later may be successful.")
-            }
-    )
-    public Response getClusterStatus(
-            @ApiParam(
-                    value = "If the client id is not specified, new one will 
be generated. This value (whether specified or generated) is included in the 
response.",
-                    required = false
-            )
-            @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) 
ClientIdParameter clientId) {
-
-        if (properties.isClusterManager()) {
-
-            ClusterStatusDTO dto = serviceFacade.getClusterStatus();
-
-            // create the revision
-            RevisionDTO revision = new RevisionDTO();
-            revision.setClientId(clientId.getClientId());
-
-            // create entity
-            final ClusterStatusEntity entity = new ClusterStatusEntity();
-            entity.setClusterStatus(dto);
-            entity.setRevision(revision);
-
-            // generate the response
-            return generateOkResponse(entity).build();
-        }
-
-        throw new IllegalClusterResourceRequestException("Only a cluster 
manager can process the request.");
-
-    }
-
-    /**
      * Returns a 200 OK response to indicate this is a valid cluster endpoint.
      *
      * @return An OK response with an empty entity body.
@@ -514,7 +455,4 @@ public class ClusterResource extends ApplicationResource {
         this.properties = properties;
     }
 
-    public void setClusterManager(WebClusterManager clusterManager) {
-        this.clusterManager = clusterManager;
-    }
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
index d5c5487..8afe59f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
@@ -247,7 +247,6 @@
     <bean id="clusterResource" class="org.apache.nifi.web.api.ClusterResource" 
scope="singleton">
         <property name="serviceFacade" ref="serviceFacade"/>
         <property name="properties" ref="nifiProperties"/>
-        <property name="clusterManager" ref="clusterManager"/>
     </bean>
     <bean id="nodeResource" class="org.apache.nifi.web.api.NodeResource" 
scope="singleton">
         <property name="serviceFacade" ref="serviceFacade"/>

Reply via email to