This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit dc6719f42d82f61c6cf28e1323897f0c4821b7b7 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Feb 3 18:30:43 2020 +0100 CAMEL-14478 - Create an AWS-KMS component based on SDK v2, Regen --- .../src/main/docs/aws2-kms-component.adoc | 6 ++- .../camel-weka/src/main/docs/weka-component.adoc | 2 +- .../endpoint/dsl/KMS2EndpointBuilderFactory.java | 8 ++-- .../endpoint/dsl/WekaEndpointBuilderFactory.java | 4 +- docs/components/modules/ROOT/nav.adoc | 1 + .../modules/ROOT/pages}/aws2-kms-component.adoc | 7 +++- docs/components/modules/ROOT/pages/index.adoc | 4 +- .../modules/ROOT/pages/weka-component.adoc | 48 ++++++++++++++++------ 8 files changed, 55 insertions(+), 25 deletions(-) diff --git a/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc b/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc index 247abd8..fb09661 100644 --- a/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc +++ b/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc @@ -1,6 +1,8 @@ +[[aws2-kms-component]] = AWS 2 KMS Component -*Since Camel 2.21* +*Since Camel 3.1* + *Since Camel 3.1* @@ -87,7 +89,7 @@ with the following path and query parameters: | *proxyHost* (producer) | To define a proxy host when instantiating the KMS client | | String | *proxyPort* (producer) | To define a proxy port when instantiating the KMS client | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the KMS client | HTTPS | Protocol -| *region* (producer) | The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() | | String +| *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | | String | *secretKey* (producer) | Amazon AWS Secret Key | | String | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean diff --git a/components/camel-weka/src/main/docs/weka-component.adoc b/components/camel-weka/src/main/docs/weka-component.adoc index 9cf52ca..aa0cc93 100644 --- a/components/camel-weka/src/main/docs/weka-component.adoc +++ b/components/camel-weka/src/main/docs/weka-component.adoc @@ -50,7 +50,7 @@ The Weka component supports 2 options, which are listed below. The Weka endpoint is configured using URI syntax: ---- -weka:cmd?options +weka:cmd ---- with the following path and query parameters: diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java index de314d8..4b5e527 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java @@ -199,10 +199,10 @@ public interface KMS2EndpointBuilderFactory { return this; } /** - * The region in which KMS client needs to work. When using this - * parameter, the configuration will expect the capitalized name of the - * region (for example AP_EAST_1) You'll need to use the name - * Regions.EU_WEST_1.name(). + * The region in which EKS client needs to work. When using this + * parameter, the configuration will expect the lowercase name of the + * region (for example ap-east-1) You'll need to use the name + * Region.EU_WEST_1.id(). * * The option is a: <code>java.lang.String</code> type. * diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java index 8dfffe6..3da42fb 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/WekaEndpointBuilderFactory.java @@ -292,7 +292,7 @@ public interface WekaEndpointBuilderFactory { * Since: 3.1 * Maven coordinates: org.apache.camel:camel-weka * - * Syntax: <code>weka:cmd?options</code> + * Syntax: <code>weka:cmd</code> * * Path parameter: read * The read command @@ -327,7 +327,7 @@ public interface WekaEndpointBuilderFactory { * Since: 3.1 * Maven coordinates: org.apache.camel:camel-weka * - * Syntax: <code>weka:cmd?options</code> + * Syntax: <code>weka:cmd</code> * * Path parameter: read * The read command diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index b40392f..da9de75 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -45,6 +45,7 @@ * xref:aws-xray.adoc[AWS XRay Component] * xref:aws2-ecs-component.adoc[AWS 2 ECS Component] * xref:aws2-eks-component.adoc[AWS 2 EKS Component] +* xref:aws2-kms-component.adoc[AWS 2 KMS Component] * xref:aws2-mq-component.adoc[AWS 2 MQ Component] * xref:aws2-msk-component.adoc[AWS 2 MSK Component] * xref:aws2-translate-component.adoc[AWS 2 Translate Component] diff --git a/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc b/docs/components/modules/ROOT/pages/aws2-kms-component.adoc similarity index 95% copy from components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc copy to docs/components/modules/ROOT/pages/aws2-kms-component.adoc index 247abd8..b658ae7 100644 --- a/components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc +++ b/docs/components/modules/ROOT/pages/aws2-kms-component.adoc @@ -1,6 +1,9 @@ +[[aws2-kms-component]] = AWS 2 KMS Component +:page-source: components/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc + +*Since Camel 3.1* -*Since Camel 2.21* *Since Camel 3.1* @@ -87,7 +90,7 @@ with the following path and query parameters: | *proxyHost* (producer) | To define a proxy host when instantiating the KMS client | | String | *proxyPort* (producer) | To define a proxy port when instantiating the KMS client | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the KMS client | HTTPS | Protocol -| *region* (producer) | The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() | | String +| *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | | String | *secretKey* (producer) | Amazon AWS Secret Key | | String | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean diff --git a/docs/components/modules/ROOT/pages/index.adoc b/docs/components/modules/ROOT/pages/index.adoc index 9b3b599..f56c81e 100644 --- a/docs/components/modules/ROOT/pages/index.adoc +++ b/docs/components/modules/ROOT/pages/index.adoc @@ -6,7 +6,7 @@ The following Apache Camel artifacts are provided: == Components // components: START -Number of Components: 316 in 254 JAR artifacts (1 deprecated) +Number of Components: 317 in 255 JAR artifacts (1 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -50,6 +50,8 @@ Number of Components: 316 in 254 JAR artifacts (1 deprecated) | xref:aws2-eks-component.adoc[AWS 2 EKS] (camel-aws2-eks) | 3.1 | The aws-eks is used for managing Amazon EKS +| xref:aws2-kms-component.adoc[AWS 2 KMS] (camel-aws2-kms) | 3.1 | The aws-kms is used for managing Amazon KMS + | xref:aws2-mq-component.adoc[AWS 2 MQ] (camel-aws2-mq) | 3.1 | The aws2-mq is used for managing Amazon MQ instances. | xref:aws2-msk-component.adoc[AWS 2 MSK] (camel-aws2-msk) | 3.1 | The aws2-msk is used for managing Amazon MSK diff --git a/docs/components/modules/ROOT/pages/weka-component.adoc b/docs/components/modules/ROOT/pages/weka-component.adoc index 87d574f..e885a72 100644 --- a/docs/components/modules/ROOT/pages/weka-component.adoc +++ b/docs/components/modules/ROOT/pages/weka-component.adoc @@ -29,7 +29,7 @@ for this component: [source,java] --------------------------------- -weka://cmd?options +weka://cmd --------------------------------- == Options @@ -51,7 +51,7 @@ The Weka component supports 2 options, which are listed below. The Weka endpoint is configured using URI syntax: ---- -weka:cmd?options +weka:cmd ---- with the following path and query parameters: @@ -133,8 +133,7 @@ This component is not supported in Karaf === Read + Filter + Write -This first example shows how to read a CSV file with the file component and then pass it on to Weka. -In Weka we apply a few filters to the data set and then pass it on to the file component for writing. +This first example shows how to read a CSV file with the file component and then pass it on to Weka. In Weka we apply a few filters to the data set and then pass it on to the file component for writing. [source,java] ---- @@ -158,16 +157,43 @@ In Weka we apply a few filters to the data set and then pass it on to the file c } ---- -The second example does the same as above without use of the file component. -For supported input types see `WekaTypeConverters`. +Here we do the same as above without use of the file component. [source,java] ---- @Override public void configure() throws Exception { + // Initiate the route from somewhere + .from("...") + // Use Weka to read the CSV file - .from("direct:start") + .to("weka:read?path=src/test/resources/data/sfny.csv") + + // Convert the 'in_sf' attribute to nominal + .to("weka:filter?apply=NumericToNominal -R first") + + // Move the 'in_sf' attribute to the end + .to("weka:filter?apply=Reorder -R 2-last,1") + + // Rename the relation + .to("weka:filter?apply=RenameRelation -modify sfny") + + // Use Weka to write the Arff file + .to("weka:write?path=target/data/sfny.arff"); + } +---- + +In this example, would the client provide the input path or some other supported type. +Have a look at the `WekaTypeConverters` for the set of supported input types. + +[source,java] +---- + @Override + public void configure() throws Exception { + + // Initiate the route from somewhere + .from("...") // Convert the 'in_sf' attribute to nominal .to("weka:filter?apply=NumericToNominal -R first") @@ -198,7 +224,7 @@ try (CamelContext camelctx = new DefaultCamelContext()) { @Override public void configure() throws Exception { - // Use weka to read the model training data + // Use the file component to read the training data from("file:src/test/resources/data?fileName=sfny-train.arff") // Build a J48 classifier using cross-validation with 10 folds @@ -227,7 +253,7 @@ try (CamelContext camelctx = new DefaultCamelContext()) { @Override public void configure() throws Exception { - // Use weka to read the data file + // Use the file component to read the test data from("file:src/test/resources/data?fileName=sfny-test.arff") // Remove the class attribute @@ -264,7 +290,3 @@ try (CamelContext camelctx = new DefaultCamelContext()) { * https://www.cs.waikato.ac.nz/ml/weka/courses.html[Machine Learning Courses,window=_blank] * https://waikato.github.io/weka-wiki/documentation/[Weka Documentation,window=_blank] * https://tdiesler.github.io/nessus-weka[Nessus-Weka,window=_blank] - - - -