You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/01/27 10:53:26 UTC

[2/2] camel git commit: First cut of mvn goal to generate/update component readme.md file. Make the plugin update the existing adoc file to keep the endpoint options up to date.

First cut of mvn goal to generate/update component readme.md file. Make the plugin update the existing adoc file to keep the endpoint options up to date.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c2614eee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c2614eee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c2614eee

Branch: refs/heads/master
Commit: c2614eee53312a6d2038265f3c136be2902656c9
Parents: bf4b884
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jan 27 10:53:15 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jan 27 10:53:15 2016 +0100

----------------------------------------------------------------------
 components/camel-ahc/src/main/docs/ahc.adoc     | 22 +++++++++++++++++++-
 .../maven/packaging/ReadmeComponentMojo.java    |  5 ++++-
 .../src/main/resources/endpoint-options.mvel    |  2 --
 3 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c2614eee/components/camel-ahc/src/main/docs/ahc.adoc
----------------------------------------------------------------------
diff --git a/components/camel-ahc/src/main/docs/ahc.adoc b/components/camel-ahc/src/main/docs/ahc.adoc
index 2a37109..1ed462a 100644
--- a/components/camel-ahc/src/main/docs/ahc.adoc
+++ b/components/camel-ahc/src/main/docs/ahc.adoc
@@ -44,7 +44,27 @@ AhcEndpoint Options
 ^^^^^^^^^^^^^^^^^^^
 
 //// endpoint options: START
-//// endpoint options: END
+The AHC component supports 12 endpoint options which are listed below:
+
+[width="100%",cols="10%,5%,5%,10%,5%,65%",options="header",]
+|=======================================================================
+| Name | Group | Required | Default | Java Type | Description |
+| `httpUri` | `producer` | `true` | `` | `URI` | The URI to use such as http://hostname:port/path |
+| `binding` | `producer` | `` | `` | `AhcBinding` | To use a custom AhcBinding which allows to control how to bind between AHC and Camel. |
+| `bridgeEndpoint` | `producer` | `` | `false` | `boolean` | If the option is true then the Exchange.HTTP_URI header is ignored and use the endpoint's URI for request. You may also set the throwExceptionOnFailure to be false to let the AhcProducer send all the fault response back. |
+| `bufferSize` | `producer` | `` | `4096` | `int` | The initial in-memory buffer size used when transferring data between Camel and AHC Client. |
+| `headerFilterStrategy` | `producer` | `` | `` | `HeaderFilterStrategy` | To use a custom HeaderFilterStrategy to filter header to and from Camel message. |
+| `throwExceptionOnFailure` | `producer` | `` | `true` | `boolean` | Option to disable throwing the AhcOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code. |
+| `transferException` | `producer` | `` | `false` | `boolean` | If enabled and an Exchange failed processing on the consumer side and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type (for example using Jetty or Servlet Camel components). On the producer side the exception will be deserialized and thrown as is instead of the AhcOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. |
+| `clientConfig` | `advanced` | `` | `` | `AsyncHttpClientConfig` | To configure the AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig instance. |
+| `clientConfigOptions` | `advanced` | `` | `` | `Object>` | To configure the AsyncHttpClientConfig using the key/values from the Map. |
+| `exchangePattern` | `advanced` | `` | `InOnly` | `ExchangePattern` | Sets the default exchange pattern when creating an exchange |
+| `synchronous` | `advanced` | `` | `false` | `boolean` | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). |
+| `sslContextParameters` | `security` | `` | `` | `SSLContextParameters` | Reference to a org.apache.camel.util.jsse.SSLContextParameters in the Registry. This reference overrides any configured SSLContextParameters at the component level. See Using the JSSE Configuration Utility. Note that configuring this option will override any SSL/TLS configuration options provided through the clientConfig option at the endpoint or component level. |
+|=======================================================================//// endpoint options: END
+
+
+
 
 [[AHC-AhcComponentOptions]]
 AhcComponent Options

http://git-wip-us.apache.org/repos/asf/camel/blob/c2614eee/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
index 09a7811..78acfb0 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
@@ -125,13 +125,16 @@ public class ReadmeComponentMojo extends AbstractMojo {
 
             String existing = StringHelper.between(text, "//// endpoint options: START", "//// endpoint options: END");
             if (existing != null) {
+                // remove leading line breaks etc
+                existing = existing.trim();
+                changed = changed.trim();
                 if (existing.equals(changed)) {
                     getLog().info("No changes to file: " + file);
                 } else {
                     getLog().info("Updating file: " + file);
                     String before = StringHelper.before(text, "//// endpoint options: START");
                     String after = StringHelper.after(text, "//// endpoint options: END");
-                    text = before + changed + after;
+                    text = before + "//// endpoint options: START\n" + changed + "//// endpoint options: END\n" + after;
                     writeText(file, text);
                 }
             } else {

http://git-wip-us.apache.org/repos/asf/camel/blob/c2614eee/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
index 51e6821..4cc4b9b 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
+++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
@@ -1,4 +1,3 @@
-//// endpoint options: START
 The @{title} component supports @{endpointOptions.size()} endpoint options which are listed below:
 
 [width="100%",cols="10%,5%,5%,10%,5%,65%",options="header",]
@@ -6,4 +5,3 @@ The @{title} component supports @{endpointOptions.size()} endpoint options which
 | Name | Group | Required | Default | Java Type | Description |
 @foreach{row : endpointOptions}| `@{row.name}` | `@{row.group}` | `@{row.required}` | `@{row.defaultValue}` | `@{row.shortJavaType}` | @{row.description} |
 @end{}|=======================================================================
-//// endpoint options: END
\ No newline at end of file