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


##########
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:
   Thanks for clarifying the expected behavior.



##########
nifi-manifest/nifi-extension-manifest-model/src/main/java/org/apache/nifi/extension/manifest/ListenPortDefinition.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.extension.manifest;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlElementWrapper;
+
+import java.util.List;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ListenPortDefinition {
+
+    private TransportProtocol transportProtocol;
+
+    @XmlElementWrapper
+    @XmlElement(name = "applicationProtocol")

Review Comment:
   Thanks for providing the example, that makes sense.



-- 
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