kevdoran commented on code in PR #10476:
URL: https://github.com/apache/nifi/pull/10476#discussion_r2523399361


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenHTTP.java:
##########
@@ -422,6 +429,47 @@ public void shutdownHttpServer() {
         shutdownHttpServer(toShutdown);
     }
 
+    @Override
+    public List<ListenPort> getListenPorts(final ConfigurationContext context) 
{
+
+        final List<ListenPort> ports = new ArrayList<>();
+
+        final Integer primaryPortNumber = 
context.getProperty(PORT).evaluateAttributeExpressions().asInteger();
+        final Integer healthCheckPortNumber = 
context.getProperty(HEALTH_CHECK_PORT).evaluateAttributeExpressions().asInteger();
+        final SSLContextProvider sslContextProvider = 
context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextProvider.class);
+        final HttpProtocolStrategy httpProtocolStrategy = sslContextProvider 
== null
+            ? 
HttpProtocolStrategy.valueOf(HTTP_PROTOCOL_STRATEGY.getDefaultValue())
+            : 
context.getProperty(HTTP_PROTOCOL_STRATEGY).asAllowableValue(HttpProtocolStrategy.class);
+        final List<String> applicationProtocols = switch 
(httpProtocolStrategy) {
+            case H2 -> List.of("h2");
+            case HTTP_1_1 -> List.of("http/1.1");
+            case H2_HTTP_1_1 -> List.of("h2", "http/1.1");
+            case null -> List.of("h2", "http/1.1");
+        };
+
+        if (primaryPortNumber != null) {

Review Comment:
   It does not have a default value, so it could be null before the processor 
is configured, ie, the invalid state after it has been added to the canvas but 
before it has been configured. With the current design, that means that  Listen 
Port would not be discoverable until the port property is configured.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to