Camel component docs - Should include information if an endpoint is lenient properties
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d6eaf21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d6eaf21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d6eaf21 Branch: refs/heads/camel-2.16.x Commit: 7d6eaf21714e3186c007e48769a050cac7446e7e Parents: 3f70c32 Author: Claus Ibsen <davscl...@apache.org> Authored: Mon Jan 4 21:25:16 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Mon Jan 4 21:47:41 2016 +0100 ---------------------------------------------------------------------- .../apache/camel/component/mock/MockEndpoint.java | 2 +- .../camel/component/rest/RestApiEndpoint.java | 5 ++++- .../apache/camel/component/rest/RestEndpoint.java | 5 ++++- .../apache/camel/component/stub/StubEndpoint.java | 16 +++++++++++++++- .../apache/camel/component/ahc/AhcEndpoint.java | 5 ++++- .../apache/camel/component/atom/AtomEndpoint.java | 7 +++---- .../camel/component/cxf/jaxrs/CxfRsEndpoint.java | 5 ++++- .../camel/component/docker/DockerEndpoint.java | 5 +++-- .../camel/component/gae/http/GHttpEndpoint.java | 5 ++--- .../apache/camel/component/http/HttpEndpoint.java | 2 +- .../camel/component/kestrel/KestrelEndpoint.java | 7 +------ .../component/netty/http/NettyHttpEndpoint.java | 2 +- .../component/netty4/http/NettyHttpEndpoint.java | 2 +- .../camel/component/restlet/RestletEndpoint.java | 3 ++- .../apache/camel/component/smpp/SmppEndpoint.java | 7 +++---- .../component/undertow/UndertowEndpoint.java | 2 +- .../tools/apt/EndpointAnnotationProcessor.java | 4 ++++ .../camel/tools/apt/model/ComponentModel.java | 18 ++++++++++++++++++ .../java/org/apache/camel/spi/UriEndpoint.java | 16 ++++++++++++++++ 19 files changed, 88 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java index b38a7cc..10cf2e8 100644 --- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java @@ -92,7 +92,7 @@ import org.slf4j.LoggerFactory; * * @version */ -@UriEndpoint(scheme = "mock", title = "Mock", syntax = "mock:name", producerOnly = true, label = "core,testing") +@UriEndpoint(scheme = "mock", title = "Mock", syntax = "mock:name", producerOnly = true, label = "core,testing", lenientProperties = true) public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint { private static final Logger LOG = LoggerFactory.getLogger(MockEndpoint.class); // must be volatile so changes is visible between the thread which performs the assertions http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java index f2ee48d..113d9d4 100644 --- a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java @@ -38,7 +38,10 @@ import org.apache.camel.spi.UriPath; import org.apache.camel.util.HostUtils; import org.apache.camel.util.ObjectHelper; -@UriEndpoint(scheme = "rest-api", title = "REST API", syntax = "rest-api:path/contextId", consumerOnly = true, label = "core,rest") +/** + * The rest-api component is used for providing Swagger API of the REST services which has been defined using the rest-dsl in Camel. + */ +@UriEndpoint(scheme = "rest-api", title = "REST API", syntax = "rest-api:path/contextId", consumerOnly = true, label = "core,rest", lenientProperties = true) public class RestApiEndpoint extends DefaultEndpoint { public static final String DEFAULT_API_COMPONENT_NAME = "swagger"; http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java index f17110d..bf475b3 100644 --- a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java @@ -35,7 +35,10 @@ import org.apache.camel.spi.UriPath; import org.apache.camel.util.HostUtils; import org.apache.camel.util.ObjectHelper; -@UriEndpoint(scheme = "rest", title = "REST", syntax = "rest:method:path:uriTemplate", consumerOnly = true, label = "core,rest") +/** + * The rest component is used for hosting REST services which has been defined using the rest-dsl in Camel. + */ +@UriEndpoint(scheme = "rest", title = "REST", syntax = "rest:method:path:uriTemplate", consumerOnly = true, label = "core,rest", lenientProperties = true) public class RestEndpoint extends DefaultEndpoint { @UriPath(enums = "get,post,put,delete,patch,head,trace,connect,options") @Metadata(required = "true") http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/camel-core/src/main/java/org/apache/camel/component/stub/StubEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/stub/StubEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/stub/StubEndpoint.java index 594437b..9a96e9d 100644 --- a/camel-core/src/main/java/org/apache/camel/component/stub/StubEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/stub/StubEndpoint.java @@ -26,7 +26,17 @@ import org.apache.camel.component.vm.VmConsumer; import org.apache.camel.component.vm.VmEndpoint; import org.apache.camel.spi.UriEndpoint; -@UriEndpoint(scheme = "stub", title = "Stub", syntax = "stub:name", consumerClass = VmConsumer.class, label = "core,testing") +/** + * The stub component provides a simple way to stub out any physical endpoints while in development or testing. + * + * For example to run a route without needing to actually connect to a specific SMTP or Http endpoint. + * Just add stub: in front of any endpoint URI to stub out the endpoint. + * Internally the Stub component creates VM endpoints. The main difference between Stub and VM is that VM + * will validate the URI and parameters you give it, so putting vm: in front of a typical URI with + * query arguments will usually fail. Stub won't though, as it basically ignores all query parameters + * to let you quickly stub out one or more endpoints in your route temporarily. + */ +@UriEndpoint(scheme = "stub", title = "Stub", syntax = "stub:name", consumerClass = VmConsumer.class, label = "core,testing", lenientProperties = true) public class StubEndpoint extends VmEndpoint { public StubEndpoint(String endpointUri, Component component, BlockingQueue<Exchange> queue) { @@ -46,4 +56,8 @@ public class StubEndpoint extends VmEndpoint { return new StubConsumer(this, processor); } + @Override + public boolean isLenientProperties() { + return true; + } } http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/AhcEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/AhcEndpoint.java b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/AhcEndpoint.java index 4448936..9a2c098 100644 --- a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/AhcEndpoint.java +++ b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/AhcEndpoint.java @@ -35,7 +35,10 @@ import org.apache.camel.spi.UriPath; import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.jsse.SSLContextParameters; -@UriEndpoint(scheme = "ahc", title = "AHC", syntax = "ahc:httpUri", producerOnly = true, label = "http") +/** + * To call external HTTP services using <a href="http://github.com/sonatype/async-http-client">Async Http Client</a>. + */ +@UriEndpoint(scheme = "ahc", title = "AHC", syntax = "ahc:httpUri", producerOnly = true, label = "http", lenientProperties = true) public class AhcEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware { private AsyncHttpClient client; http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java b/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java index 55c4a5e..04e69c7 100644 --- a/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java +++ b/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java @@ -27,11 +27,10 @@ import org.apache.camel.component.feed.FeedPollingConsumer; import org.apache.camel.spi.UriEndpoint; /** - * Atom is used for polling atom feeds - * - * @version + * The atom component is used for consuming Atom RSS feeds. */ -@UriEndpoint(scheme = "atom", title = "Atom", syntax = "atom:feedUri", consumerOnly = true, consumerClass = FeedPollingConsumer.class, label = "feeds") +@UriEndpoint(scheme = "atom", title = "Atom", syntax = "atom:feedUri", consumerOnly = true, + consumerClass = FeedPollingConsumer.class, label = "rss", lenientProperties = true) public class AtomEndpoint extends FeedEndpoint { public AtomEndpoint() { http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java index 19ae089..67dc946 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java @@ -56,7 +56,10 @@ import org.apache.cxf.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@UriEndpoint(scheme = "cxfrs", title = "CXF-RS", syntax = "cxfrs:beanId:address", consumerClass = CxfRsConsumer.class, label = "rest") +/** + * The cxfrs component is used for JAX-RS REST services using Apache CXF. + */ +@UriEndpoint(scheme = "cxfrs", title = "CXF-RS", syntax = "cxfrs:beanId:address", consumerClass = CxfRsConsumer.class, label = "rest", lenientProperties = true) public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, Service { private static final Logger LOG = LoggerFactory.getLogger(CxfRsEndpoint.class); http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java index de40ca3..b62c994 100644 --- a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java +++ b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerEndpoint.java @@ -28,9 +28,10 @@ import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; /** - * Represents a Docker endpoint. + * The docker component is used for managing Docker containers. */ -@UriEndpoint(scheme = "docker", title = "Docker", syntax = "docker:operation", consumerClass = DockerEventsConsumer.class, label = "container,cloud,platform") +@UriEndpoint(scheme = "docker", title = "Docker", syntax = "docker:operation", consumerClass = DockerEventsConsumer.class, + label = "container,cloud,paas", lenientProperties = true) public class DockerEndpoint extends DefaultEndpoint { @UriParam http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java index 75e3cf7..364307b 100644 --- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java +++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java @@ -42,11 +42,10 @@ import org.apache.camel.util.URISupport; import org.apache.camel.util.UnsafeUriCharactersEncoder; /** - * Represents a <a href="http://camel.apache.org/ghttp.html">Google App Engine - * HTTP endpoint</a>. + * The ghttp component provides HTTP connectivity to the GAE. */ @UriEndpoint(scheme = "ghttp", extendsScheme = "servlet", title = "Google HTTP", - syntax = "ghttp:httpUri", producerOnly = true, label = "cloud") + syntax = "ghttp:httpUri", producerOnly = true, label = "cloud,paas", lenientProperties = true) public class GHttpEndpoint extends ServletEndpoint implements OutboundBindingSupport<GHttpEndpoint, HTTPRequest, HTTPResponse> { public static final String GHTTP_SCHEME = "ghttp"; http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java index 98df503..6d6704c 100644 --- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java +++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java @@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory; * * @version */ -@UriEndpoint(scheme = "http,https", title = "HTTP,HTTPS", syntax = "http:httpUri", producerOnly = true, label = "http") +@UriEndpoint(scheme = "http,https", title = "HTTP,HTTPS", syntax = "http:httpUri", producerOnly = true, label = "http", lenientProperties = true) public class HttpEndpoint extends HttpCommonEndpoint { // Note: all options must be documented with description in annotations so extended components can access the documentation http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelEndpoint.java b/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelEndpoint.java index ad245c1..9efcc00 100644 --- a/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelEndpoint.java +++ b/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelEndpoint.java @@ -89,12 +89,7 @@ public class KestrelEndpoint extends DefaultEndpoint { return component.getMemcachedClient(configuration, queue); } - @Override - public boolean isLenientProperties() { - return false; - } - public boolean isSingleton() { - return false; + return true; } } http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java index 7121d84..364123a 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java @@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory; * HTTP based {@link NettyEndpoint} */ @UriEndpoint(scheme = "netty-http", extendsScheme = "netty", title = "Netty HTTP", - syntax = "netty-http:protocol:host:port/path", consumerClass = NettyHttpConsumer.class, label = "http") + syntax = "netty-http:protocol:host:port/path", consumerClass = NettyHttpConsumer.class, label = "http", lenientProperties = true) public class NettyHttpEndpoint extends NettyEndpoint implements HeaderFilterStrategyAware { private static final Logger LOG = LoggerFactory.getLogger(NettyHttpEndpoint.class); http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java index 22e56db..8071fcb 100644 --- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java +++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpEndpoint.java @@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory; * HTTP based {@link NettyEndpoint} */ @UriEndpoint(scheme = "netty4-http", extendsScheme = "netty4", title = "Netty4 HTTP", - syntax = "netty4-http:protocol:host:port/path", consumerClass = NettyHttpConsumer.class, label = "http") + syntax = "netty4-http:protocol:host:port/path", consumerClass = NettyHttpConsumer.class, label = "http", lenientProperties = true) public class NettyHttpEndpoint extends NettyEndpoint implements HeaderFilterStrategyAware { private static final Logger LOG = LoggerFactory.getLogger(NettyHttpEndpoint.class); http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java index 770cb6f..4136f40 100644 --- a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java +++ b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java @@ -40,7 +40,8 @@ import org.restlet.data.Method; * * @version */ -@UriEndpoint(scheme = "restlet", title = "Restlet", syntax = "restlet:protocol:host:port/uriPattern", consumerClass = RestletConsumer.class, label = "rest") +@UriEndpoint(scheme = "restlet", title = "Restlet", syntax = "restlet:protocol:host:port/uriPattern", + consumerClass = RestletConsumer.class, label = "rest", lenientProperties = true) public class RestletEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware { private static final int DEFAULT_PORT = 80; http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppEndpoint.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppEndpoint.java index 99cd38f..54f17ff 100644 --- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppEndpoint.java +++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppEndpoint.java @@ -30,11 +30,10 @@ import org.jsmpp.bean.DataSm; import org.jsmpp.bean.DeliverSm; /** - * A SMPP Endpoint - * - * @version + * To send and receive SMS using a SMSC (Short Message Service Center). */ -@UriEndpoint(scheme = "smpp,smpps", title = "SMPP", syntax = "smpp:host:port", consumerClass = SmppConsumer.class, label = "mobile,messaging") +@UriEndpoint(scheme = "smpp,smpps", title = "SMPP", syntax = "smpp:host:port", + consumerClass = SmppConsumer.class, label = "mobile", lenientProperties = true) public class SmppEndpoint extends DefaultEndpoint { private SmppBinding binding; http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java index d892dba..92eecaf 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java @@ -47,7 +47,7 @@ import org.xnio.Options; * Represents an Undertow endpoint. */ @UriEndpoint(scheme = "undertow", title = "Undertow", syntax = "undertow:httpURI", - consumerClass = UndertowConsumer.class, label = "http") + consumerClass = UndertowConsumer.class, label = "http", lenientProperties = true) public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware { private static final Logger LOG = LoggerFactory.getLogger(UndertowEndpoint.class); http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java index 00bd362..a1c52db 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java @@ -217,6 +217,9 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor { } else if (componentModel.isProducerOnly()) { buffer.append("\n \"producerOnly\": \"").append("true").append("\","); } + if (componentModel.isLenientProperties()) { + buffer.append("\n \"lenientProperties\": \"").append("true").append("\","); + } buffer.append("\n \"javaType\": \"").append(componentModel.getJavaType()).append("\","); buffer.append("\n \"groupId\": \"").append(componentModel.getGroupId()).append("\","); buffer.append("\n \"artifactId\": \"").append(componentModel.getArtifactId()).append("\","); @@ -437,6 +440,7 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor { model.setLabel(label); model.setConsumerOnly(uriEndpoint.consumerOnly()); model.setProducerOnly(uriEndpoint.producerOnly()); + model.setLenientProperties(uriEndpoint.lenientProperties()); String data = loadResource("META-INF/services/org/apache/camel/component", scheme); if (data != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java index 56810ec..2962e91 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java @@ -30,6 +30,8 @@ public final class ComponentModel { private String label; private boolean consumerOnly; private boolean producerOnly; + private boolean deprecated; + private boolean lenientProperties; public ComponentModel(String scheme) { this.scheme = scheme; @@ -126,4 +128,20 @@ public final class ComponentModel { public void setProducerOnly(boolean producerOnly) { this.producerOnly = producerOnly; } + + public boolean isDeprecated() { + return deprecated; + } + + public void setDeprecated(boolean deprecated) { + this.deprecated = deprecated; + } + + public boolean isLenientProperties() { + return lenientProperties; + } + + public void setLenientProperties(boolean lenientProperties) { + this.lenientProperties = lenientProperties; + } } http://git-wip-us.apache.org/repos/asf/camel/blob/7d6eaf21/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java ---------------------------------------------------------------------- diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java index 772b140..e989ce9 100644 --- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java +++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java @@ -114,4 +114,20 @@ public @interface UriEndpoint { */ boolean consumerOnly() default false; + /** + * Should all properties be known or does the endpoint allow unknown options? + * <p/> + * <tt>lenient = false</tt> means that the endpoint should validate that all + * given options is known and configured properly. + * <tt>lenient = true</tt> means that the endpoint allows additional unknown options to + * be passed to it but does not throw a ResolveEndpointFailedException when creating + * the endpoint. + * <p/> + * This options is used by a few components for instance the HTTP based that can have + * dynamic URI options appended that is targeted for an external system. + * <p/> + * Most endpoints is configured to be <b>not</b> lenient. + */ + boolean lenientProperties() default false; + } \ No newline at end of file