lburgazzoli commented on a change in pull request #201: Fix #184 Leverage 
platform http service
URL: https://github.com/apache/camel-quarkus/pull/201#discussion_r324166313
 
 

 ##########
 File path: 
extensions/platform-http/component/src/main/java/org/apache/camel/component/http/server/PlatformHttpEndpoint.java
 ##########
 @@ -0,0 +1,74 @@
+/*
+ * 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.camel.component.http.server;
+
+import java.util.Set;
+
+import org.apache.camel.AsyncEndpoint;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.http.server.spi.Method;
+import org.apache.camel.spi.HeaderFilterStrategy;
+import org.apache.camel.spi.HeaderFilterStrategyAware;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.DefaultEndpoint;
+
+public class PlatformHttpEndpoint extends DefaultEndpoint implements 
AsyncEndpoint, HeaderFilterStrategyAware {
+
+    private final String path;
+    private final Set<Method> methods;
+
+    @UriParam(label = "advanced")
+    private HeaderFilterStrategy headerFilterStrategy = new 
PlatformHttpHeaderFilterStrategy();
+
+    public PlatformHttpEndpoint(String uri, Component component, Set<Method> 
methods, String path) {
+        super(uri, component);
+        this.methods = methods;
+        this.path = path;
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        throw new UnsupportedOperationException("Producer is not supported");
+    }
+
+    @Override
+    public Consumer createConsumer(Processor processor) throws Exception {
+        return new PlatformHttpConsumer(this, processor);
+    }
+
+    @Override
+    public HeaderFilterStrategy getHeaderFilterStrategy() {
+        return headerFilterStrategy;
+    }
+
+    @Override
+    public void setHeaderFilterStrategy(HeaderFilterStrategy 
headerFilterStrategy) {
+        this.headerFilterStrategy = headerFilterStrategy;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public Set<Method> getMethods() {
+        return methods;
+    }
 
 Review comment:
   There should be a getter/setter to set the engine. Discovering it through 
the registry is one of the options but usually camel component have much more 
flexibility.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to