Repository: camel Updated Branches: refs/heads/master 12e0ce4c0 -> 6fa5657fe
Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c68107d3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c68107d3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c68107d3 Branch: refs/heads/master Commit: c68107d3b1829fcf4d43ce93504cfd30fa320b8c Parents: 12e0ce4 Author: Claus Ibsen <[email protected]> Authored: Sun Jun 14 15:41:34 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Sun Jun 14 15:41:34 2015 +0200 ---------------------------------------------------------------------- .../camel/component/gae/mail/GMailEndpoint.java | 14 +++++- .../component/gae/task/GTaskComponent.java | 11 ++++- .../camel/component/gae/task/GTaskEndpoint.java | 47 +++++++++++++++----- .../camel/component/http/HttpEndpoint.java | 24 +++++----- 4 files changed, 72 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c68107d3/components/camel-gae/src/main/java/org/apache/camel/component/gae/mail/GMailEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/mail/GMailEndpoint.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/mail/GMailEndpoint.java index 93e25a8..1562601 100644 --- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/mail/GMailEndpoint.java +++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/mail/GMailEndpoint.java @@ -40,7 +40,7 @@ public class GMailEndpoint extends DefaultEndpoint implements OutboundBindingSup private OutboundBinding<GMailEndpoint, Message, Void> outboundBinding; private MailService mailService; - @UriPath @Metadata(required = "true") + @UriPath(description = "The email of the sender") @Metadata(required = "true") private String sender; @UriParam private String subject; @@ -77,6 +77,9 @@ public class GMailEndpoint extends DefaultEndpoint implements OutboundBindingSup return subject; } + /** + * Subject of the email. + */ public void setSubject(String subject) { this.subject = subject; } @@ -85,6 +88,9 @@ public class GMailEndpoint extends DefaultEndpoint implements OutboundBindingSup return to; } + /** + * To-receiver of the email. This can be a single receiver or a comma-separated list of receivers. + */ public void setTo(String to) { this.to = to; } @@ -93,6 +99,9 @@ public class GMailEndpoint extends DefaultEndpoint implements OutboundBindingSup return cc; } + /** + * Cc-receiver of the email. This can be a single receiver or a comma-separated list of receivers. + */ public void setCc(String cc) { this.cc = cc; } @@ -101,6 +110,9 @@ public class GMailEndpoint extends DefaultEndpoint implements OutboundBindingSup return bcc; } + /** + * Bcc-receiver of the email. This can be a single receiver or a comma-separated list of receivers. + */ public void setBcc(String bcc) { this.bcc = bcc; } http://git-wip-us.apache.org/repos/asf/camel/blob/c68107d3/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java index 8049806..d248d5d 100644 --- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java +++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java @@ -44,6 +44,7 @@ import org.apache.commons.httpclient.params.HttpClientParams; * for installing a web hook. */ public class GTaskComponent extends ServletComponent { + public GTaskComponent() { super(GTaskEndpoint.class); } @@ -51,23 +52,29 @@ public class GTaskComponent extends ServletComponent { @Override @SuppressWarnings("unchecked") protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { - String workerRoot = getAndRemoveParameter( - parameters, "workerRoot", String.class, "worker"); + String workerRoot = getAndRemoveParameter(parameters, "workerRoot", String.class, "worker"); + String inboundBindingRef = (String) parameters.get("inboundBindingRef"); + String outboundBindingRef = (String) parameters.get("outboundBindingRef"); + OutboundBinding<GTaskEndpoint, TaskOptions, Void> outboundBinding = resolveAndRemoveReferenceParameter( parameters, "outboundBindingRef", OutboundBinding.class, new GTaskBinding()); InboundBinding<GTaskEndpoint, HttpServletRequest, HttpServletResponse> inboundBinding = resolveAndRemoveReferenceParameter( parameters, "inboundBindingRef", InboundBinding.class, new GTaskBinding()); + GTaskEndpointInfo info = new GTaskEndpointInfo(uri, remaining); GTaskEndpoint endpoint = (GTaskEndpoint)super.createEndpoint( info.getCanonicalUri(), info.getCanonicalUriPath(), parameters); + endpoint.setServletName(getServletName()); endpoint.setWorkerRoot(workerRoot); endpoint.setOutboundBinding(outboundBinding); endpoint.setInboundBinding(inboundBinding); endpoint.setQueueName(remaining); endpoint.setQueue(QueueFactory.getQueue(remaining)); + endpoint.setInboundBindingRef(inboundBindingRef); + endpoint.setOutboundBindingRef(outboundBindingRef); return endpoint; } http://git-wip-us.apache.org/repos/asf/camel/blob/c68107d3/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java index 0e4a801..371094e 100644 --- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java +++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java @@ -50,11 +50,16 @@ public class GTaskEndpoint extends ServletEndpoint implements OutboundBindingSup private OutboundBinding<GTaskEndpoint, TaskOptions, Void> outboundBinding; private InboundBinding<GTaskEndpoint, HttpServletRequest, HttpServletResponse> inboundBinding; + private Queue queue; + @UriPath @Metadata(required = "true") private String queueName; - private Queue queue; - @UriParam + @UriParam(label = "producer", defaultValue = "worker") private String workerRoot; + @UriParam(label = "consumer") + private String inboundBindingRef; + @UriParam(label = "producer") + private String outboundBindingRef; public GTaskEndpoint(String endpointUri, ServletComponent component, URI httpUri, HttpClientParams params, @@ -94,20 +99,13 @@ public class GTaskEndpoint extends ServletEndpoint implements OutboundBindingSup this, super.getBinding(), getInboundBinding())); } - /** - * @see #setWorkerRoot(String) - */ public String getWorkerRoot() { return workerRoot; } /** - * Sets the web hook path root. - * - * @param workerRoot the assumed web hook path root. The default is <code>worker</code>. - * The servlet handling the callback from the task queueing service should have - * a <code>/worker/*</code> servlet mapping in this case. If another servlet mapping - * is used it must be set here accordingly. + * The servlet mapping for callback handlers. By default, this component requires a callback servlet mapping of /worker/*. + * If another servlet mapping is used e.g. /myworker/* it must be set as option on the producer side: to("gtask:myqueue?workerRoot=myworker"). */ public void setWorkerRoot(String workerRoot) { this.workerRoot = workerRoot; @@ -125,10 +123,37 @@ public class GTaskEndpoint extends ServletEndpoint implements OutboundBindingSup return queueName; } + /** + * Name of queue + */ public void setQueueName(String queueName) { this.queueName = queueName; } + public String getInboundBindingRef() { + return inboundBindingRef; + } + + /** + * Reference to an InboundBinding<GTaskEndpoint, HttpServletRequest, HttpServletResponse> in the Registry for + * customizing the binding of an Exchange to the Servlet API. + * The referenced binding is used as post-processor to org.apache.camel.component.http.HttpBinding. + */ + public void setInboundBindingRef(String inboundBindingRef) { + this.inboundBindingRef = inboundBindingRef; + } + + public String getOutboundBindingRef() { + return outboundBindingRef; + } + + /** + * Reference to an OutboundBinding<GTaskEndpoint, TaskOptions, void> in the Registry for customizing the binding of an Exchange to the task queueing service. + */ + public void setOutboundBindingRef(String outboundBindingRef) { + this.outboundBindingRef = outboundBindingRef; + } + public Producer createProducer() throws Exception { return new GTaskProducer(this); } http://git-wip-us.apache.org/repos/asf/camel/blob/c68107d3/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 38b9003..a78142c 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 @@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory; @UriEndpoint(scheme = "http,https", title = "HTTP,HTTPS", syntax = "http:httpUri", producerOnly = true, label = "http") public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware { - // Note: all consumer options must be documented with description in annotations so extended components can access the documentation + // Note: all options must be documented with description in annotations so extended components can access the documentation private static final Logger LOG = LoggerFactory.getLogger(HttpEndpoint.class); @@ -59,20 +59,24 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg private HttpConnectionManager httpConnectionManager; private UrlRewrite urlRewrite; - @UriPath(label = "producer") @Metadata(required = "true") + @UriPath(label = "producer", description = "The url of the HTTP endpoint to call.") @Metadata(required = "true") private URI httpUri; - @UriParam + @UriParam(description = "To use a custom HeaderFilterStrategy to filter header to and from Camel message.") private HeaderFilterStrategy headerFilterStrategy = new HttpHeaderFilterStrategy(); - @UriParam + @UriParam(description = "To use a custom HttpBinding to control the mapping between Camel message and HttpClient.") private HttpBinding binding; - @UriParam(label = "producer", defaultValue = "true") + @UriParam(label = "producer", defaultValue = "true", + description = "Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server." + + " This allows you to get all responses regardless of the HTTP status code.") private boolean throwExceptionOnFailure = true; - @UriParam(label = "producer") + @UriParam(label = "producer", + description = "If the option is true, HttpProducer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request." + + " You may also set the option throwExceptionOnFailure to be false to let the HttpProducer send all the fault response back.") private boolean bridgeEndpoint; @UriParam(label = "consumer", description = "Whether or not the consumer should try to find a target consumer by matching the URI prefix if no exact match is found.") private boolean matchOnUriPrefix; - @UriParam(defaultValue = "true") + @UriParam(defaultValue = "true", description = "If this option is false Jetty servlet will disable the HTTP streaming and set the content-length header on the response") private boolean chunked = true; @UriParam(label = "consumer", description = "Determines whether or not the raw input stream from Jetty is cached or not" @@ -85,11 +89,11 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg + " If you use Jetty to bridge/proxy an endpoint then consider enabling this option to improve performance," + " in case you do not need to read the message payload multiple times.") private boolean disableStreamCache; - @UriParam(label = "producer") + @UriParam(label = "producer", description = "The proxy host name") private String proxyHost; - @UriParam(label = "producer") + @UriParam(label = "producer", description = "The proxy port number") private int proxyPort; - @UriParam(label = "producer", enums = "Basic,Digest,NTLM") + @UriParam(label = "producer", enums = "Basic,Digest,NTLM", description = "Authentication method for proxy, either as Basic, Digest or NTLM.") private String authMethodPriority; @UriParam private boolean transferException;
