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 2020/02/29 09:01:39 UTC
[camel] 01/02: CAMEL-14568 - Fixed camel-aws2-translate
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c20ad86e63542b3dfa7270927bc8d0ef05017f88
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Feb 29 10:00:28 2020 +0100
CAMEL-14568 - Fixed camel-aws2-translate
---
.../translate/Translate2ComponentConfigurer.java | 11 ++--
.../translate/Translate2EndpointConfigurer.java | 8 +--
.../component/aws2/translate/aws2-translate.json | 40 ++++++-------
.../src/main/docs/aws2-translate-component.adoc | 10 ++--
.../aws2/translate/Translate2Component.java | 46 +--------------
.../aws2/translate/Translate2Configuration.java | 20 +++----
.../dsl/Aws2TranslateComponentBuilderFactory.java | 66 +++++++++++-----------
7 files changed, 79 insertions(+), 122 deletions(-)
diff --git a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
index 9672d0f..34e0e48 100644
--- a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
+++ b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
@@ -22,10 +22,9 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
Translate2Component target = (Translate2Component) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
case "autodetectsourcelanguage":
case "autodetectSourceLanguage": getOrCreateConfiguration(target).setAutodetectSourceLanguage(property(camelContext, boolean.class, value)); return true;
+ case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.translate.Translate2Configuration.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.aws2.translate.Translate2Operations.class, value)); return true;
@@ -35,10 +34,7 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp
case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
case "proxyprotocol":
case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
- case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true;
case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
- case "secretkey":
- case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
case "sourcelanguage":
case "sourceLanguage": getOrCreateConfiguration(target).setSourceLanguage(property(camelContext, java.lang.String.class, value)); return true;
case "targetlanguage":
@@ -47,7 +43,10 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp
case "translateClient": getOrCreateConfiguration(target).setTranslateClient(property(camelContext, software.amazon.awssdk.services.translate.TranslateClient.class, value)); return true;
case "basicpropertybinding":
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
- case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.translate.Translate2Configuration.class, value)); return true;
+ case "accesskey":
+ case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "secretkey":
+ case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
}
diff --git a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
index 73f9d07..0019602 100644
--- a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
+++ b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
@@ -15,8 +15,6 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
Translate2Endpoint target = (Translate2Endpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
case "autodetectsourcelanguage":
case "autodetectSourceLanguage": target.getConfiguration().setAutodetectSourceLanguage(property(camelContext, boolean.class, value)); return true;
case "lazystartproducer":
@@ -29,8 +27,6 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl
case "proxyprotocol":
case "proxyProtocol": target.getConfiguration().setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
case "region": target.getConfiguration().setRegion(property(camelContext, java.lang.String.class, value)); return true;
- case "secretkey":
- case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
case "sourcelanguage":
case "sourceLanguage": target.getConfiguration().setSourceLanguage(property(camelContext, java.lang.String.class, value)); return true;
case "targetlanguage":
@@ -40,6 +36,10 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl
case "basicpropertybinding":
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true;
+ case "accesskey":
+ case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "secretkey":
+ case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
}
diff --git a/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json b/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
index 08a0b43..19057f8 100644
--- a/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
+++ b/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
@@ -19,36 +19,36 @@
"version": "3.2.0-SNAPSHOT"
},
"componentProperties": {
- "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Access Key" },
- "autodetectSourceLanguage": { "kind": "property", "displayName": "Autodetect Source Language", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Being able to autodetect the source language" },
+ "autodetectSourceLanguage": { "kind": "property", "displayName": "Autodetect Source Language", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Being able to autodetect the source language" },
+ "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Configuration", "deprecated": false, "secret": false, "description": "Component configuration" },
"lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the r [...]
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ "translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "translateText", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": " [...]
- "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Translate client" },
- "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Translate client" },
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ "translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "translateText", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "The oper [...]
+ "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Translate client" },
+ "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Translate client" },
"proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the Trans [...]
"region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "The region in which Translate client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (f [...]
- "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Secret Key" },
- "sourceLanguage": { "kind": "property", "displayName": "Source Language", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Source language to use" },
- "targetLanguage": { "kind": "property", "displayName": "Target Language", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Target language to use" },
- "translateClient": { "kind": "property", "displayName": "Translate Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translate as client" },
+ "sourceLanguage": { "kind": "property", "displayName": "Source Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Source language to use" },
+ "targetLanguage": { "kind": "property", "displayName": "Target Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Target language to use" },
+ "translateClient": { "kind": "property", "displayName": "Translate Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translate as client" },
"basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Configuration", "deprecated": false, "secret": false, "description": "The AWS Translate default configuration" }
+ "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
},
"properties": {
"label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Logical name" },
- "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
- "autodetectSourceLanguage": { "kind": "parameter", "displayName": "Autodetect Source Language", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Being able to autodetect the source language" },
+ "autodetectSourceLanguage": { "kind": "parameter", "displayName": "Autodetect Source Language", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Being able to autodetect the source language" },
"lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the [...]
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ "translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "translateText", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": [...]
- "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Translate client" },
- "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Translate client" },
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ "translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "translateText", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "The ope [...]
+ "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Translate client" },
+ "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Translate client" },
"proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the Tran [...]
"region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "The region in which Translate client needs to work. When using this parameter, the configuration will expect the lowercase name of the region ( [...]
- "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
- "sourceLanguage": { "kind": "parameter", "displayName": "Source Language", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Source language to use" },
- "targetLanguage": { "kind": "parameter", "displayName": "Target Language", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Target language to use" },
- "translateClient": { "kind": "parameter", "displayName": "Translate Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translate as client" },
+ "sourceLanguage": { "kind": "parameter", "displayName": "Source Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Source language to use" },
+ "targetLanguage": { "kind": "parameter", "displayName": "Target Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Target language to use" },
+ "translateClient": { "kind": "parameter", "displayName": "Translate Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translate as client" },
"basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
- "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." }
+ "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." },
+ "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
}
}
diff --git a/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
index 6344f1f..9d59877 100644
--- a/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
+++ b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
@@ -43,20 +43,20 @@ The AWS 2 Translate component supports 14 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *accessKey* (producer) | Amazon AWS Access Key | | String
| *autodetectSourceLanguage* (producer) | Being able to autodetect the source language | false | boolean
+| *configuration* (producer) | Component configuration | | Translate2Configuration
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
| *operation* (producer) | *Required* The operation to perform. The value can be one of: translateText | translateText | Translate2Operations
| *proxyHost* (producer) | To define a proxy host when instantiating the Translate client | | String
| *proxyPort* (producer) | To define a proxy port when instantiating the Translate client | | Integer
| *proxyProtocol* (producer) | To define a proxy protocol when instantiating the Translate client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
| *region* (producer) | The region in which Translate 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
| *sourceLanguage* (producer) | Source language to use | | String
| *targetLanguage* (producer) | Target language to use | | String
| *translateClient* (producer) | To use a existing configured AWS Translate as client | | TranslateClient
| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *configuration* (advanced) | The AWS Translate default configuration | | Translate2Configuration
+| *accessKey* (security) | Amazon AWS Access Key | | String
+| *secretKey* (security) | Amazon AWS Secret Key | | String
|===
// component options: END
@@ -88,7 +88,6 @@ with the following path and query parameters:
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *accessKey* (producer) | Amazon AWS Access Key | | String
| *autodetectSourceLanguage* (producer) | Being able to autodetect the source language | false | boolean
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
| *operation* (producer) | *Required* The operation to perform. The value can be one of: translateText | translateText | Translate2Operations
@@ -96,12 +95,13 @@ with the following path and query parameters:
| *proxyPort* (producer) | To define a proxy port when instantiating the Translate client | | Integer
| *proxyProtocol* (producer) | To define a proxy protocol when instantiating the Translate client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
| *region* (producer) | The region in which Translate 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
| *sourceLanguage* (producer) | Source language to use | | String
| *targetLanguage* (producer) | Target language to use | | String
| *translateClient* (producer) | To use a existing configured AWS Translate as client | | TranslateClient
| *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
+| *accessKey* (security) | Amazon AWS Access Key | | String
+| *secretKey* (security) | Amazon AWS Secret Key | | String
|===
// endpoint options: END
diff --git a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java
index 6b79f09..c9e6243 100644
--- a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java
+++ b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java
@@ -33,13 +33,7 @@ import software.amazon.awssdk.services.translate.TranslateClient;
public class Translate2Component extends DefaultComponent {
@Metadata
- private String accessKey;
- @Metadata
- private String secretKey;
- @Metadata
- private String region;
- @Metadata(label = "advanced")
- private Translate2Configuration configuration;
+ private Translate2Configuration configuration = new Translate2Configuration();
public Translate2Component() {
this(null);
@@ -56,9 +50,6 @@ public class Translate2Component extends DefaultComponent {
Translate2Configuration configuration = this.configuration != null ? this.configuration.copy() : new Translate2Configuration();
Translate2Endpoint endpoint = new Translate2Endpoint(uri, this, configuration);
- endpoint.getConfiguration().setAccessKey(accessKey);
- endpoint.getConfiguration().setSecretKey(secretKey);
- endpoint.getConfiguration().setRegion(region);
setProperties(endpoint, parameters);
checkAndSetRegistryClient(configuration);
if (configuration.getTranslateClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
@@ -72,45 +63,12 @@ public class Translate2Component extends DefaultComponent {
}
/**
- * The AWS Translate default configuration
+ * Component configuration
*/
public void setConfiguration(Translate2Configuration configuration) {
this.configuration = configuration;
}
- public String getAccessKey() {
- return accessKey;
- }
-
- /**
- * Amazon AWS Access Key
- */
- public void setAccessKey(String accessKey) {
- this.accessKey = accessKey;
- }
-
- public String getSecretKey() {
- return secretKey;
- }
-
- /**
- * Amazon AWS Secret Key
- */
- public void setSecretKey(String secretKey) {
- this.secretKey = secretKey;
- }
-
- public String getRegion() {
- return region;
- }
-
- /**
- * The region in which Translate client needs to work
- */
- public void setRegion(String region) {
- this.region = region;
- }
-
private void checkAndSetRegistryClient(Translate2Configuration configuration) {
Set<TranslateClient> clients = getCamelContext().getRegistry().findByType(TranslateClient.class);
if (clients.size() == 1) {
diff --git a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
index d458b30..60017e3 100644
--- a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
+++ b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
@@ -30,28 +30,28 @@ public class Translate2Configuration implements Cloneable {
@UriPath(description = "Logical name")
@Metadata(required = true)
private String label;
- @UriParam(label = "producer")
+ @UriParam
private TranslateClient translateClient;
- @UriParam(label = "producer", secret = true)
+ @UriParam(label = "security", secret = true)
private String accessKey;
- @UriParam(label = "producer", secret = true)
+ @UriParam(label = "security", secret = true)
private String secretKey;
- @UriParam(label = "producer")
- @Metadata(required = true, defaultValue = "translateText")
+ @UriParam(defaultValue = "translateText")
+ @Metadata(required = true)
private Translate2Operations operation = Translate2Operations.translateText;
@UriParam(enums = "HTTP,HTTPS", defaultValue = "HTTPS")
private Protocol proxyProtocol = Protocol.HTTPS;
- @UriParam(label = "producer")
+ @UriParam
private String proxyHost;
- @UriParam(label = "producer")
+ @UriParam
private String sourceLanguage;
- @UriParam(label = "producer")
+ @UriParam
private String targetLanguage;
- @UriParam(label = "producer")
+ @UriParam
private Integer proxyPort;
@UriParam
private String region;
- @UriParam(label = "producer", defaultValue = "false")
+ @UriParam(defaultValue = "false")
private boolean autodetectSourceLanguage;
public TranslateClient getTranslateClient() {
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
index f68ceb2..549b727 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
@@ -49,28 +49,29 @@ public interface Aws2TranslateComponentBuilderFactory {
extends
ComponentBuilder<Translate2Component> {
/**
- * Amazon AWS Access Key.
+ * Being able to autodetect the source language.
*
- * The option is a: <code>java.lang.String</code> type.
+ * The option is a: <code>boolean</code> type.
*
+ * Default: false
* Group: producer
*/
- default Aws2TranslateComponentBuilder accessKey(
- java.lang.String accessKey) {
- doSetProperty("accessKey", accessKey);
+ default Aws2TranslateComponentBuilder autodetectSourceLanguage(
+ boolean autodetectSourceLanguage) {
+ doSetProperty("autodetectSourceLanguage", autodetectSourceLanguage);
return this;
}
/**
- * Being able to autodetect the source language.
+ * Component configuration.
*
- * The option is a: <code>boolean</code> type.
+ * The option is a:
+ * <code>org.apache.camel.component.aws2.translate.Translate2Configuration</code> type.
*
- * Default: false
* Group: producer
*/
- default Aws2TranslateComponentBuilder autodetectSourceLanguage(
- boolean autodetectSourceLanguage) {
- doSetProperty("autodetectSourceLanguage", autodetectSourceLanguage);
+ default Aws2TranslateComponentBuilder configuration(
+ org.apache.camel.component.aws2.translate.Translate2Configuration configuration) {
+ doSetProperty("configuration", configuration);
return this;
}
/**
@@ -161,18 +162,6 @@ public interface Aws2TranslateComponentBuilderFactory {
return this;
}
/**
- * Amazon AWS Secret Key.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: producer
- */
- default Aws2TranslateComponentBuilder secretKey(
- java.lang.String secretKey) {
- doSetProperty("secretKey", secretKey);
- return this;
- }
- /**
* Source language to use.
*
* The option is a: <code>java.lang.String</code> type.
@@ -224,16 +213,27 @@ public interface Aws2TranslateComponentBuilderFactory {
return this;
}
/**
- * The AWS Translate default configuration.
+ * Amazon AWS Access Key.
*
- * The option is a:
- * <code>org.apache.camel.component.aws2.translate.Translate2Configuration</code> type.
+ * The option is a: <code>java.lang.String</code> type.
*
- * Group: advanced
+ * Group: security
*/
- default Aws2TranslateComponentBuilder configuration(
- org.apache.camel.component.aws2.translate.Translate2Configuration configuration) {
- doSetProperty("configuration", configuration);
+ default Aws2TranslateComponentBuilder accessKey(
+ java.lang.String accessKey) {
+ doSetProperty("accessKey", accessKey);
+ return this;
+ }
+ /**
+ * Amazon AWS Secret Key.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ */
+ default Aws2TranslateComponentBuilder secretKey(
+ java.lang.String secretKey) {
+ doSetProperty("secretKey", secretKey);
return this;
}
}
@@ -260,20 +260,20 @@ public interface Aws2TranslateComponentBuilderFactory {
String name,
Object value) {
switch (name) {
- case "accessKey": ((Translate2Component) component).setAccessKey((java.lang.String) value); return true;
case "autodetectSourceLanguage": getOrCreateConfiguration((Translate2Component) component).setAutodetectSourceLanguage((boolean) value); return true;
+ case "configuration": ((Translate2Component) component).setConfiguration((org.apache.camel.component.aws2.translate.Translate2Configuration) value); return true;
case "lazyStartProducer": ((Translate2Component) component).setLazyStartProducer((boolean) value); return true;
case "operation": getOrCreateConfiguration((Translate2Component) component).setOperation((org.apache.camel.component.aws2.translate.Translate2Operations) value); return true;
case "proxyHost": getOrCreateConfiguration((Translate2Component) component).setProxyHost((java.lang.String) value); return true;
case "proxyPort": getOrCreateConfiguration((Translate2Component) component).setProxyPort((java.lang.Integer) value); return true;
case "proxyProtocol": getOrCreateConfiguration((Translate2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true;
case "region": getOrCreateConfiguration((Translate2Component) component).setRegion((java.lang.String) value); return true;
- case "secretKey": ((Translate2Component) component).setSecretKey((java.lang.String) value); return true;
case "sourceLanguage": getOrCreateConfiguration((Translate2Component) component).setSourceLanguage((java.lang.String) value); return true;
case "targetLanguage": getOrCreateConfiguration((Translate2Component) component).setTargetLanguage((java.lang.String) value); return true;
case "translateClient": getOrCreateConfiguration((Translate2Component) component).setTranslateClient((software.amazon.awssdk.services.translate.TranslateClient) value); return true;
case "basicPropertyBinding": ((Translate2Component) component).setBasicPropertyBinding((boolean) value); return true;
- case "configuration": ((Translate2Component) component).setConfiguration((org.apache.camel.component.aws2.translate.Translate2Configuration) value); return true;
+ case "accessKey": getOrCreateConfiguration((Translate2Component) component).setAccessKey((java.lang.String) value); return true;
+ case "secretKey": getOrCreateConfiguration((Translate2Component) component).setSecretKey((java.lang.String) value); return true;
default: return false;
}
}