This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 07af13b2e76aec812e79d6d43a4f241f5e60dd0b Author: James Netherton <[email protected]> AuthorDate: Fri Nov 13 11:06:15 2020 +0000 CAMEL-15836: Add autowired metadata to camel-twilio restClient option --- .../resources/org/apache/camel/catalog/components/twilio.json | 2 +- .../resources/org/apache/camel/catalog/docs/twilio-component.adoc | 2 +- .../org/apache/camel/component/twilio/TwilioComponentConfigurer.java | 5 +++++ .../resources/org/apache/camel/component/twilio/twilio.json | 2 +- components/camel-twilio/src/main/docs/twilio-component.adoc | 2 +- .../main/java/org/apache/camel/component/twilio/TwilioComponent.java | 2 +- docs/components/modules/ROOT/pages/twilio-component.adoc | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json index db96966..f98068c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json @@ -27,7 +27,7 @@ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...] "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 [...] "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 [...] - "restClient": { "kind": "property", "displayName": "Rest Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.twilio.http.TwilioRestClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared REST client" }, + "restClient": { "kind": "property", "displayName": "Rest Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.twilio.http.TwilioRestClient", "deprecated": false, "autowired": true, "secret": false, "description": "To use the shared REST client" }, "accountSid": { "kind": "property", "displayName": "Account Sid", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The account SID to use." }, "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Auth token for the account." }, "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The account to use." } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/twilio-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/twilio-component.adoc index c49821f..34e368d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/twilio-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/twilio-component.adoc @@ -42,7 +42,7 @@ The Twilio component supports 8 options, which are listed below. | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | 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 [...] | *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 -| *restClient* (advanced) | To use the shared REST client | | TwilioRestClient +| *restClient* (advanced) | *Autowired* To use the shared REST client | | TwilioRestClient | *accountSid* (security) | The account SID to use. | | String | *password* (security) | Auth token for the account. | | String | *username* (security) | The account to use. | | String diff --git a/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/TwilioComponentConfigurer.java b/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/TwilioComponentConfigurer.java index a14e3b4..5b40960 100644 --- a/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/TwilioComponentConfigurer.java +++ b/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/TwilioComponentConfigurer.java @@ -58,6 +58,11 @@ public class TwilioComponentConfigurer extends PropertyConfigurerSupport impleme } @Override + public String[] getAutowiredNames() { + return new String[]{"restClient"}; + } + + @Override public Class<?> getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "accountsid": diff --git a/components/camel-twilio/src/generated/resources/org/apache/camel/component/twilio/twilio.json b/components/camel-twilio/src/generated/resources/org/apache/camel/component/twilio/twilio.json index db96966..f98068c 100644 --- a/components/camel-twilio/src/generated/resources/org/apache/camel/component/twilio/twilio.json +++ b/components/camel-twilio/src/generated/resources/org/apache/camel/component/twilio/twilio.json @@ -27,7 +27,7 @@ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...] "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 [...] "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 [...] - "restClient": { "kind": "property", "displayName": "Rest Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.twilio.http.TwilioRestClient", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared REST client" }, + "restClient": { "kind": "property", "displayName": "Rest Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.twilio.http.TwilioRestClient", "deprecated": false, "autowired": true, "secret": false, "description": "To use the shared REST client" }, "accountSid": { "kind": "property", "displayName": "Account Sid", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The account SID to use." }, "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Auth token for the account." }, "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The account to use." } diff --git a/components/camel-twilio/src/main/docs/twilio-component.adoc b/components/camel-twilio/src/main/docs/twilio-component.adoc index c49821f..34e368d 100644 --- a/components/camel-twilio/src/main/docs/twilio-component.adoc +++ b/components/camel-twilio/src/main/docs/twilio-component.adoc @@ -42,7 +42,7 @@ The Twilio component supports 8 options, which are listed below. | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | 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 [...] | *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 -| *restClient* (advanced) | To use the shared REST client | | TwilioRestClient +| *restClient* (advanced) | *Autowired* To use the shared REST client | | TwilioRestClient | *accountSid* (security) | The account SID to use. | | String | *password* (security) | Auth token for the account. | | String | *username* (security) | The account to use. | | String diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioComponent.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioComponent.java index a606379..8dae292 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioComponent.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioComponent.java @@ -37,7 +37,7 @@ public class TwilioComponent extends AbstractApiComponent<TwilioApiName, TwilioC private String password; @Metadata(label = "common,security", secret = true) private String accountSid; - @Metadata(label = "advanced") + @Metadata(label = "advanced", autowired = true) private TwilioRestClient restClient; public TwilioComponent() { diff --git a/docs/components/modules/ROOT/pages/twilio-component.adoc b/docs/components/modules/ROOT/pages/twilio-component.adoc index 7572d51..986b57c 100644 --- a/docs/components/modules/ROOT/pages/twilio-component.adoc +++ b/docs/components/modules/ROOT/pages/twilio-component.adoc @@ -44,7 +44,7 @@ The Twilio component supports 8 options, which are listed below. | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | 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 [...] | *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 -| *restClient* (advanced) | To use the shared REST client | | TwilioRestClient +| *restClient* (advanced) | *Autowired* To use the shared REST client | | TwilioRestClient | *accountSid* (security) | The account SID to use. | | String | *password* (security) | Auth token for the account. | | String | *username* (security) | The account to use. | | String
