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 e784a045757873a69735987f0fa6bd44eff5fb09 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Feb 26 15:17:17 2021 +0100 CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-DDB component --- .../camel/catalog/docs/aws2-ddb-component.adoc | 8 +++- .../aws2/ddb/Ddb2ComponentConfigurer.java | 12 ++++++ .../component/aws2/ddb/Ddb2EndpointConfigurer.java | 12 ++++++ .../component/aws2/ddb/Ddb2EndpointUriFactory.java | 4 +- .../apache/camel/component/aws2/ddb/aws2-ddb.json | 4 ++ .../src/main/docs/aws2-ddb-component.adoc | 8 +++- .../aws2/ddb/DdbComponentConfigurationTest.java | 14 +++++++ .../dsl/Aws2DdbComponentBuilderFactory.java | 35 ++++++++++++++++ .../endpoint/dsl/Ddb2EndpointBuilderFactory.java | 49 ++++++++++++++++++++++ .../modules/ROOT/pages/aws2-ddb-component.adoc | 8 +++- 10 files changed, 147 insertions(+), 7 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc index 08f740e..659525f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 DynamoDB component supports 17 options, which are listed below. +The AWS 2 DynamoDB component supports 19 options, which are listed below. @@ -56,12 +56,14 @@ The AWS 2 DynamoDB component supports 17 options, which are listed below. | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String @@ -91,7 +93,7 @@ with the following path and query parameters: |=== -=== Query Parameters (15 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -103,12 +105,14 @@ with the following path and query parameters: | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java index 25021b8..2200433 100644 --- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java +++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java @@ -44,6 +44,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement 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.ddb.Ddb2Operations.class, value)); return true; + case "overrideendpoint": + case "overrideEndpoint": getOrCreateConfiguration(target).setOverrideEndpoint(property(camelContext, boolean.class, value)); return true; case "proxyhost": case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true; case "proxyport": @@ -57,6 +59,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true; case "trustallcertificates": case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; + case "uriendpointoverride": + case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; case "writecapacity": case "writeCapacity": getOrCreateConfiguration(target).setWriteCapacity(property(camelContext, java.lang.Long.class, value)); return true; default: return false; @@ -87,6 +91,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "operation": return org.apache.camel.component.aws2.ddb.Ddb2Operations.class; + case "overrideendpoint": + case "overrideEndpoint": return boolean.class; case "proxyhost": case "proxyHost": return java.lang.String.class; case "proxyport": @@ -100,6 +106,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "secretKey": return java.lang.String.class; case "trustallcertificates": case "trustAllCertificates": return boolean.class; + case "uriendpointoverride": + case "uriEndpointOverride": return java.lang.String.class; case "writecapacity": case "writeCapacity": return java.lang.Long.class; default: return null; @@ -126,6 +134,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "operation": return getOrCreateConfiguration(target).getOperation(); + case "overrideendpoint": + case "overrideEndpoint": return getOrCreateConfiguration(target).isOverrideEndpoint(); case "proxyhost": case "proxyHost": return getOrCreateConfiguration(target).getProxyHost(); case "proxyport": @@ -139,6 +149,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "secretKey": return getOrCreateConfiguration(target).getSecretKey(); case "trustallcertificates": case "trustAllCertificates": return getOrCreateConfiguration(target).isTrustAllCertificates(); + case "uriendpointoverride": + case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride(); case "writecapacity": case "writeCapacity": return getOrCreateConfiguration(target).getWriteCapacity(); default: return null; diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java index 86343a5..1797e9e 100644 --- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java +++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java @@ -34,6 +34,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.aws2.ddb.Ddb2Operations.class, value)); return true; + case "overrideendpoint": + case "overrideEndpoint": target.getConfiguration().setOverrideEndpoint(property(camelContext, boolean.class, value)); return true; case "proxyhost": case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true; case "proxyport": @@ -47,6 +49,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true; case "trustallcertificates": case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; + case "uriendpointoverride": + case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; case "writecapacity": case "writeCapacity": target.getConfiguration().setWriteCapacity(property(camelContext, java.lang.Long.class, value)); return true; default: return false; @@ -74,6 +78,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "operation": return org.apache.camel.component.aws2.ddb.Ddb2Operations.class; + case "overrideendpoint": + case "overrideEndpoint": return boolean.class; case "proxyhost": case "proxyHost": return java.lang.String.class; case "proxyport": @@ -87,6 +93,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "secretKey": return java.lang.String.class; case "trustallcertificates": case "trustAllCertificates": return boolean.class; + case "uriendpointoverride": + case "uriEndpointOverride": return java.lang.String.class; case "writecapacity": case "writeCapacity": return java.lang.Long.class; default: return null; @@ -110,6 +118,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "operation": return target.getConfiguration().getOperation(); + case "overrideendpoint": + case "overrideEndpoint": return target.getConfiguration().isOverrideEndpoint(); case "proxyhost": case "proxyHost": return target.getConfiguration().getProxyHost(); case "proxyport": @@ -123,6 +133,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "secretKey": return target.getConfiguration().getSecretKey(); case "trustallcertificates": case "trustAllCertificates": return target.getConfiguration().isTrustAllCertificates(); + case "uriendpointoverride": + case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride(); case "writecapacity": case "writeCapacity": return target.getConfiguration().getWriteCapacity(); default: return null; diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java index 15ab099..69a3e3f 100644 --- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java +++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java @@ -20,11 +20,12 @@ public class Ddb2EndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(16); + Set<String> props = new HashSet<>(18); props.add("amazonDDBClient"); props.add("proxyProtocol"); props.add("readCapacity"); props.add("secretKey"); + props.add("uriEndpointOverride"); props.add("keyAttributeType"); props.add("proxyHost"); props.add("tableName"); @@ -34,6 +35,7 @@ public class Ddb2EndpointUriFactory extends org.apache.camel.support.component.E props.add("lazyStartProducer"); props.add("accessKey"); props.add("consistentRead"); + props.add("overrideEndpoint"); props.add("region"); props.add("operation"); props.add("writeCapacity"); diff --git a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json index 981a346..9867048 100644 --- a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json +++ b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json @@ -29,12 +29,14 @@ "keyAttributeType": { "kind": "property", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" }, "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 star [...] "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Operations", "enum": [ "BatchGetItems", "DeleteItem", "DeleteTable", "DescribeTable", "GetItem", "PutItem", "Query", "Scan", "UpdateItem", "UpdateTable" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "PutItem", "configurationClass": "org.apache.camel.component.aws2.ddb.D [...] + "overrideEndpoint": { "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpoi [...] "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the DDB client" }, "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The region in which DynamoDB client needs to work. When using this parameter, the configuration will expect the lowercase name [...] "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating t [...] "readCapacity": { "kind": "property", "displayName": "Read Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The provisioned throughput to reserve for reading resources from your table" }, "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The region in which DDB client needs to work" }, "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" }, + "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" }, "writeCapacity": { "kind": "property", "displayName": "Write Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The provisioned throughput to reserved for writing resources to your table" }, "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...] "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, @@ -48,12 +50,14 @@ "keyAttributeType": { "kind": "parameter", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" }, "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 sta [...] "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Operations", "enum": [ "BatchGetItems", "DeleteItem", "DeleteTable", "DescribeTable", "GetItem", "PutItem", "Query", "Scan", "UpdateItem", "UpdateTable" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "PutItem", "configurationClass": "org.apache.camel.component.aws2.ddb. [...] + "overrideEndpoint": { "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpo [...] "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the DDB client" }, "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The region in which DynamoDB client needs to work. When using this parameter, the configuration will expect the lowercase name [...] "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating [...] "readCapacity": { "kind": "parameter", "displayName": "Read Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The provisioned throughput to reserve for reading resources from your table" }, "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The region in which DDB client needs to work" }, "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" }, + "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" }, "writeCapacity": { "kind": "parameter", "displayName": "Write Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The provisioned throughput to reserved for writing resources to your table" }, "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "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, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } diff --git a/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc b/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc index 08f740e..659525f 100644 --- a/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc +++ b/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 DynamoDB component supports 17 options, which are listed below. +The AWS 2 DynamoDB component supports 19 options, which are listed below. @@ -56,12 +56,14 @@ The AWS 2 DynamoDB component supports 17 options, which are listed below. | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String @@ -91,7 +93,7 @@ with the following path and query parameters: |=== -=== Query Parameters (15 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -103,12 +105,14 @@ with the following path and query parameters: | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String diff --git a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentConfigurationTest.java b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentConfigurationTest.java index c03ca83..c3a427e 100644 --- a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentConfigurationTest.java +++ b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentConfigurationTest.java @@ -22,6 +22,7 @@ import software.amazon.awssdk.core.Protocol; import software.amazon.awssdk.regions.Region; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class DdbComponentConfigurationTest extends CamelTestSupport { @@ -69,4 +70,17 @@ public class DdbComponentConfigurationTest extends CamelTestSupport { assertEquals(Protocol.HTTP, endpoint.getConfiguration().getProxyProtocol()); } + @Test + public void createEndpointWithOverrideEndpointElements() throws Exception { + Ddb2Component component = context.getComponent("aws2-ddb", Ddb2Component.class); + Ddb2Endpoint endpoint = (Ddb2Endpoint) component + .createEndpoint("aws2-ddb://myTable?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1&overrideEndpoint=true&uriEndpointOverride=http://localhost:9090"); + + assertEquals("myTable", endpoint.getConfiguration().getTableName()); + assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey()); + assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey()); + assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion()); + assertTrue(endpoint.getConfiguration().isOverrideEndpoint()); + assertEquals("http://localhost:9090", endpoint.getConfiguration().getUriEndpointOverride()); + } } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java index fe42d48..e44369b 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java @@ -169,6 +169,23 @@ public interface Aws2DdbComponentBuilderFactory { return this; } /** + * Set the need for overidding the endpoint. This option needs to be + * used in combination with uriEndpointOverride option. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param overrideEndpoint the value to set + * @return the dsl builder + */ + default Aws2DdbComponentBuilder overrideEndpoint( + boolean overrideEndpoint) { + doSetProperty("overrideEndpoint", overrideEndpoint); + return this; + } + /** * To define a proxy host when instantiating the DDB client. * * The option is a: <code>java.lang.String</code> type. @@ -263,6 +280,22 @@ public interface Aws2DdbComponentBuilderFactory { return this; } /** + * Set the overriding uri endpoint. This option needs to be used in + * combination with overrideEndpoint option. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param uriEndpointOverride the value to set + * @return the dsl builder + */ + default Aws2DdbComponentBuilder uriEndpointOverride( + java.lang.String uriEndpointOverride) { + doSetProperty("uriEndpointOverride", uriEndpointOverride); + return this; + } + /** * The provisioned throughput to reserved for writing resources to your * table. * @@ -358,12 +391,14 @@ public interface Aws2DdbComponentBuilderFactory { case "keyAttributeType": getOrCreateConfiguration((Ddb2Component) component).setKeyAttributeType((java.lang.String) value); return true; case "lazyStartProducer": ((Ddb2Component) component).setLazyStartProducer((boolean) value); return true; case "operation": getOrCreateConfiguration((Ddb2Component) component).setOperation((org.apache.camel.component.aws2.ddb.Ddb2Operations) value); return true; + case "overrideEndpoint": getOrCreateConfiguration((Ddb2Component) component).setOverrideEndpoint((boolean) value); return true; case "proxyHost": getOrCreateConfiguration((Ddb2Component) component).setProxyHost((java.lang.String) value); return true; case "proxyPort": getOrCreateConfiguration((Ddb2Component) component).setProxyPort((java.lang.Integer) value); return true; case "proxyProtocol": getOrCreateConfiguration((Ddb2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true; case "readCapacity": getOrCreateConfiguration((Ddb2Component) component).setReadCapacity((java.lang.Long) value); return true; case "region": getOrCreateConfiguration((Ddb2Component) component).setRegion((java.lang.String) value); return true; case "trustAllCertificates": getOrCreateConfiguration((Ddb2Component) component).setTrustAllCertificates((boolean) value); return true; + case "uriEndpointOverride": getOrCreateConfiguration((Ddb2Component) component).setUriEndpointOverride((java.lang.String) value); return true; case "writeCapacity": getOrCreateConfiguration((Ddb2Component) component).setWriteCapacity((java.lang.Long) value); return true; case "autowiredEnabled": ((Ddb2Component) component).setAutowiredEnabled((boolean) value); return true; case "accessKey": getOrCreateConfiguration((Ddb2Component) component).setAccessKey((java.lang.String) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java index aabbd03..d2e1b71 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java @@ -205,6 +205,39 @@ public interface Ddb2EndpointBuilderFactory { return this; } /** + * Set the need for overidding the endpoint. This option needs to be + * used in combination with uriEndpointOverride option. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param overrideEndpoint the value to set + * @return the dsl builder + */ + default Ddb2EndpointBuilder overrideEndpoint(boolean overrideEndpoint) { + doSetProperty("overrideEndpoint", overrideEndpoint); + return this; + } + /** + * Set the need for overidding the endpoint. This option needs to be + * used in combination with uriEndpointOverride option. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer + * + * @param overrideEndpoint the value to set + * @return the dsl builder + */ + default Ddb2EndpointBuilder overrideEndpoint(String overrideEndpoint) { + doSetProperty("overrideEndpoint", overrideEndpoint); + return this; + } + /** * To define a proxy host when instantiating the DDB client. * * The option is a: <code>java.lang.String</code> type. @@ -366,6 +399,22 @@ public interface Ddb2EndpointBuilderFactory { return this; } /** + * Set the overriding uri endpoint. This option needs to be used in + * combination with overrideEndpoint option. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param uriEndpointOverride the value to set + * @return the dsl builder + */ + default Ddb2EndpointBuilder uriEndpointOverride( + String uriEndpointOverride) { + doSetProperty("uriEndpointOverride", uriEndpointOverride); + return this; + } + /** * The provisioned throughput to reserved for writing resources to your * table. * diff --git a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc index c23a826..c26e14c 100644 --- a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc +++ b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc @@ -44,7 +44,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 DynamoDB component supports 17 options, which are listed below. +The AWS 2 DynamoDB component supports 19 options, which are listed below. @@ -58,12 +58,14 @@ The AWS 2 DynamoDB component supports 17 options, which are listed below. | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String @@ -93,7 +95,7 @@ with the following path and query parameters: |=== -=== Query Parameters (15 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -105,12 +107,14 @@ with the following path and query parameters: | *keyAttributeType* (producer) | Attribute type when creating table | | String | *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) | What operation to perform. There are 10 enums and the value can be one of: BatchGetItems, DeleteItem, DeleteTable, DescribeTable, GetItem, PutItem, Query, Scan, UpdateItem, UpdateTable | PutItem | Ddb2Operations +| *overrideEndpoint* (producer) | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | boolean | *proxyHost* (producer) | To define a proxy host when instantiating the DDB client | | String | *proxyPort* (producer) | The region in which DynamoDB 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() | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the DDB client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol | *readCapacity* (producer) | The provisioned throughput to reserve for reading resources from your table | | Long | *region* (producer) | The region in which DDB client needs to work | | String | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean +| *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String | *writeCapacity* (producer) | The provisioned throughput to reserved for writing resources to your table | | Long | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String