Repository: camel Updated Branches: refs/heads/master f9f158cbd -> 9d17405ad
Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9d17405a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9d17405a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9d17405a Branch: refs/heads/master Commit: 9d17405ad58805ce73ba60cfd15119a221cd9b38 Parents: f9f158c Author: Claus Ibsen <davscl...@apache.org> Authored: Tue May 26 16:27:08 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue May 26 17:44:50 2015 +0200 ---------------------------------------------------------------------- .../apache/camel/component/http/AuthMethod.java | 2 +- .../camel/component/http/HttpComponent.java | 12 +++ .../camel/component/http/HttpEndpoint.java | 91 +++++++++++++++++--- 3 files changed, 90 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9d17405a/components/camel-http/src/main/java/org/apache/camel/component/http/AuthMethod.java ---------------------------------------------------------------------- diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/AuthMethod.java b/components/camel-http/src/main/java/org/apache/camel/component/http/AuthMethod.java index 84b67e8..44c62bf 100644 --- a/components/camel-http/src/main/java/org/apache/camel/component/http/AuthMethod.java +++ b/components/camel-http/src/main/java/org/apache/camel/component/http/AuthMethod.java @@ -23,5 +23,5 @@ package org.apache.camel.component.http; */ public enum AuthMethod { - Basic, Digest, NTLM; + Basic, Digest, NTLM } http://git-wip-us.apache.org/repos/asf/camel/blob/9d17405a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java index 9256c9b..5c6f80f 100644 --- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java +++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java @@ -320,6 +320,9 @@ public class HttpComponent extends HeaderFilterStrategyComponent { return httpClientConfigurer; } + /** + * To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used. + */ public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer) { this.httpClientConfigurer = httpClientConfigurer; } @@ -328,6 +331,9 @@ public class HttpComponent extends HeaderFilterStrategyComponent { return httpConnectionManager; } + /** + * To use a custom HttpConnectionManager to manage connections + */ public void setHttpConnectionManager(HttpConnectionManager httpConnectionManager) { this.httpConnectionManager = httpConnectionManager; } @@ -336,6 +342,9 @@ public class HttpComponent extends HeaderFilterStrategyComponent { return httpBinding; } + /** + * To use a custom HttpBinding to control the mapping between Camel message and HttpClient. + */ public void setHttpBinding(HttpBinding httpBinding) { this.httpBinding = httpBinding; } @@ -344,6 +353,9 @@ public class HttpComponent extends HeaderFilterStrategyComponent { return httpConfiguration; } + /** + * To use the shared HttpConfiguration as base configuration. + */ public void setHttpConfiguration(HttpConfiguration httpConfiguration) { this.httpConfiguration = httpConfiguration; } http://git-wip-us.apache.org/repos/asf/camel/blob/9d17405a/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 ac82939..b4caea7 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 @@ -63,29 +63,29 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg private HeaderFilterStrategy headerFilterStrategy = new HttpHeaderFilterStrategy(); @UriParam private HttpBinding binding; - @UriParam(defaultValue = "true") + @UriParam(label = "producer", defaultValue = "true") private boolean throwExceptionOnFailure = true; - @UriParam + @UriParam(label = "producer") private boolean bridgeEndpoint; - @UriParam + @UriParam(label = "consumer") private boolean matchOnUriPrefix; @UriParam(defaultValue = "true") private boolean chunked = true; - @UriParam + @UriParam(label = "consumer") private boolean disableStreamCache; - @UriParam + @UriParam(label = "producer") private String proxyHost; - @UriParam + @UriParam(label = "producer") private int proxyPort; - @UriParam + @UriParam(label = "producer", enums = "Basic,Digest,NTLM") private String authMethodPriority; @UriParam private boolean transferException; - @UriParam + @UriParam(label = "consumer") private boolean traceEnabled; - @UriParam + @UriParam(label = "consumer") private String httpMethodRestrict; - @UriParam + @UriParam(label = "consumer") private Integer responseBufferSize; public HttpEndpoint() { @@ -239,6 +239,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return binding; } + /** + * To use a custom HttpBinding to control the mapping between Camel message and HttpClient. + */ public void setBinding(HttpBinding binding) { this.binding = binding; } @@ -278,6 +281,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return httpConnectionManager; } + /** + * To use a custom HttpConnectionManager to manage connections + */ public void setHttpConnectionManager(HttpConnectionManager httpConnectionManager) { this.httpConnectionManager = httpConnectionManager; } @@ -286,6 +292,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return headerFilterStrategy; } + /** + * To use a custom HeaderFilterStrategy to filter header to and from Camel message. + */ public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) { this.headerFilterStrategy = headerFilterStrategy; } @@ -294,6 +303,10 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return throwExceptionOnFailure; } + /** + * 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. + */ public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure) { this.throwExceptionOnFailure = throwExceptionOnFailure; } @@ -301,7 +314,11 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg public boolean isBridgeEndpoint() { return bridgeEndpoint; } - + + /** + * 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. + */ public void setBridgeEndpoint(boolean bridge) { this.bridgeEndpoint = bridge; } @@ -309,7 +326,12 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg public boolean isMatchOnUriPrefix() { return matchOnUriPrefix; } - + + /** + * Whether or not the consumer should try to find a target consumer by matching the URI prefix if no exact match is found. + * <p/> + * See more details at: http://camel.apache.org/how-do-i-let-jetty-match-wildcards.html + */ public void setMatchOnUriPrefix(boolean match) { this.matchOnUriPrefix = match; } @@ -317,7 +339,18 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg public boolean isDisableStreamCache() { return this.disableStreamCache; } - + + /** + * Determines whether or not the raw input stream from Jetty is cached or not + * (Camel will read the stream into a in memory/overflow to file, Stream caching) cache. + * By default Camel will cache the Jetty input stream to support reading it multiple times to ensure it Camel + * can retrieve all data from the stream. However you can set this option to true when you for example need + * to access the raw stream, such as streaming it directly to a file or other persistent store. + * DefaultHttpBinding will copy the request input stream into a stream cache and put it into message bod + * if this option is false to support reading the stream multiple times. + * 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. + */ public void setDisableStreamCache(boolean disable) { this.disableStreamCache = disable; } @@ -325,7 +358,10 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg public boolean isChunked() { return this.chunked; } - + + /** + * If this option is false Jetty servlet will disable the HTTP streaming and set the content-length header on the response + */ public void setChunked(boolean chunked) { this.chunked = chunked; } @@ -334,6 +370,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return proxyHost; } + /** + * The proxy host name + */ public void setProxyHost(String proxyHost) { this.proxyHost = proxyHost; } @@ -342,6 +381,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return proxyPort; } + /** + * The proxy port number + */ public void setProxyPort(int proxyPort) { this.proxyPort = proxyPort; } @@ -350,6 +392,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return authMethodPriority; } + /** + * Authentication method for proxy, either as Basic, Digest or NTLM. + */ public void setAuthMethodPriority(String authMethodPriority) { this.authMethodPriority = authMethodPriority; } @@ -358,6 +403,10 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return transferException; } + /** + * 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. + */ public void setTransferException(boolean transferException) { this.transferException = transferException; } @@ -366,6 +415,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return this.traceEnabled; } + /** + * Specifies whether to enable HTTP TRACE for this Jetty consumer. By default TRACE is turned off. + */ public void setTraceEnabled(boolean traceEnabled) { this.traceEnabled = traceEnabled; } @@ -374,6 +426,10 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return httpMethodRestrict; } + /** + * Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT etc. + * Multiple methods can be specified separated by comma. + */ public void setHttpMethodRestrict(String httpMethodRestrict) { this.httpMethodRestrict = httpMethodRestrict; } @@ -382,6 +438,10 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return urlRewrite; } + /** + * Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints. + * See more details at http://camel.apache.org/urlrewrite.html + */ public void setUrlRewrite(UrlRewrite urlRewrite) { this.urlRewrite = urlRewrite; } @@ -390,6 +450,9 @@ public class HttpEndpoint extends DefaultEndpoint implements HeaderFilterStrateg return responseBufferSize; } + /** + * To use a custom buffer size on the javax.servlet.ServletResponse. + */ public void setResponseBufferSize(Integer responseBufferSize) { this.responseBufferSize = responseBufferSize; }