You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/02 15:49:05 UTC

[GitHub] [nifi] simonbence opened a new pull request, #6750: NIFI-10934 Adding uniqueness check for Regisrty Client creation

simonbence opened a new pull request, #6750:
URL: https://github.com/apache/nifi/pull/6750

   
   
   # Summary
   
   [NIFI-10934](https://issues.apache.org/jira/browse/NIFI-10934)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 8
     - [ ] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] ChrisSamo632 commented on a diff in pull request #6750: NIFI-10934 Adding uniqueness check for Registry Client creation

Posted by GitBox <gi...@apache.org>.
ChrisSamo632 commented on code in PR #6750:
URL: https://github.com/apache/nifi/pull/6750#discussion_r1059061359


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java:
##########
@@ -494,22 +495,26 @@ public Response createFlowRegistryClient(
         preprocessObsoleteRequest(requestFlowRegistryClientEntity);
 
         if (requestFlowRegistryClientEntity == null || requestFlowRegistryClientEntity.getComponent() == null) {
-            throw new IllegalArgumentException("Flow registry client details must be specified.");
+            throw new IllegalArgumentException("Flow Registry client details must be specified.");
         }
 
         if (requestFlowRegistryClientEntity.getRevision() == null
                 || (requestFlowRegistryClientEntity.getRevision().getVersion() == null
                 || requestFlowRegistryClientEntity.getRevision().getVersion() != 0)) {
-            throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Registry.");
+            throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Flow Registry.");
         }
 
         final FlowRegistryClientDTO requestRegistryClient = requestFlowRegistryClientEntity.getComponent();
         if (requestRegistryClient.getId() != null) {
-            throw new IllegalArgumentException("Registry ID cannot be specified.");
+            throw new IllegalArgumentException("Flow Registry ID cannot be specified.");
         }
 
         if (StringUtils.isBlank(requestRegistryClient.getName())) {
-            throw new IllegalArgumentException("Registry name must be specified.");
+            throw new IllegalArgumentException("Flow Registry name must be specified.");
+        }
+
+        if (serviceFacade.getRegistryClients().stream().map(rce -> rce.getComponent().getName()).collect(Collectors.toSet()).contains(requestRegistryClient.getName())) {

Review Comment:
   ```suggestion
           if (serviceFacade.getRegistryClients().stream().anyMatch(rce -> requestRegistryClient.getName().equals(rce.getComponent().getName()))) {
   ```
   
   I think use of the `anyMatch` stream function is more obvious than collecting everything into a `Set` and checking for `contains`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] NissimShiman commented on pull request #6750: NIFI-10934 Adding uniqueness check for Regisrty Client creation

Posted by GitBox <gi...@apache.org>.
NissimShiman commented on PR #6750:
URL: https://github.com/apache/nifi/pull/6750#issuecomment-1344334227

   reviewing/testing pr...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory closed pull request #6750: NIFI-10934 Adding uniqueness check for Registry Client creation

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #6750: NIFI-10934 Adding uniqueness check for Registry Client creation
URL: https://github.com/apache/nifi/pull/6750


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org