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
The following commit(s) were added to refs/heads/master by this push: new fd41e01 CAMEL-16142: Enable PubNub client to be autowired fd41e01 is described below commit fd41e010cef09ce797203b8f3fd00bf8595b0d1f Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Thu Feb 4 09:13:19 2021 +0000 CAMEL-16142: Enable PubNub client to be autowired --- .../resources/org/apache/camel/catalog/docs/pubnub-component.adoc | 2 +- .../org/apache/camel/component/pubnub/PubNubEndpointConfigurer.java | 5 +++++ .../resources/org/apache/camel/component/pubnub/pubnub.json | 2 +- components/camel-pubnub/src/main/docs/pubnub-component.adoc | 2 +- .../main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java | 2 ++ docs/components/modules/ROOT/pages/pubnub-component.adoc | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc index 7cefc90..5466695 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc @@ -99,7 +99,7 @@ with the following path and query parameters: | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern | *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) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...] -| *pubnub* (advanced) | Reference to a Pubnub client in the registry. | | PubNub +| *pubnub* (advanced) | *Autowired* Reference to a Pubnub client in the registry. | | PubNub | *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. | | String | *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. | | String | *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. | | String diff --git a/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubEndpointConfigurer.java b/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubEndpointConfigurer.java index 3537469..8611c3c 100644 --- a/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubEndpointConfigurer.java +++ b/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubEndpointConfigurer.java @@ -50,6 +50,11 @@ public class PubNubEndpointConfigurer extends PropertyConfigurerSupport implemen } @Override + public String[] getAutowiredNames() { + return new String[]{"pubnub"}; + } + + @Override public Class<?> getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "authkey": diff --git a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json index a02b24c..ada63e4 100644 --- a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json +++ b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json @@ -35,7 +35,7 @@ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "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": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "HERENOW", "WHERENOW", "GETSTATE", "SETSTATE", "GETHISTORY", "PUBLISH", "FIRE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The operation to perform. PUB [...] - "pubnub": { "kind": "parameter", "displayName": "Pubnub", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.pubnub.api.PubNub", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to a Pubnub client in the registry." }, + "pubnub": { "kind": "parameter", "displayName": "Pubnub", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.pubnub.api.PubNub", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "description": "Reference to a Pubnub client in the registry." }, "authKey": { "kind": "parameter", "displayName": "Auth Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "If Access Manager is utilized, client will use this authKey in all restricted requests." }, "cipherKey": { "kind": "parameter", "displayName": "Cipher Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "If cipher is passed, all communications to\/from PubNub will be encrypted." }, "publishKey": { "kind": "parameter", "displayName": "Publish Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The publish key obtained from your PubNub account. Required when publishing messages." }, diff --git a/components/camel-pubnub/src/main/docs/pubnub-component.adoc b/components/camel-pubnub/src/main/docs/pubnub-component.adoc index 7cefc90..5466695 100644 --- a/components/camel-pubnub/src/main/docs/pubnub-component.adoc +++ b/components/camel-pubnub/src/main/docs/pubnub-component.adoc @@ -99,7 +99,7 @@ with the following path and query parameters: | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern | *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) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...] -| *pubnub* (advanced) | Reference to a Pubnub client in the registry. | | PubNub +| *pubnub* (advanced) | *Autowired* Reference to a Pubnub client in the registry. | | PubNub | *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. | | String | *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. | | String | *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. | | String diff --git a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java index 5b087f4..8bd06ac 100644 --- a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java +++ b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubEndpoint.java @@ -22,6 +22,7 @@ import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -35,6 +36,7 @@ import org.apache.camel.util.ObjectHelper; public class PubNubEndpoint extends DefaultEndpoint { @UriParam(label = "advanced") + @Metadata(autowired = true) private PubNub pubnub; @UriParam diff --git a/docs/components/modules/ROOT/pages/pubnub-component.adoc b/docs/components/modules/ROOT/pages/pubnub-component.adoc index d3302e5..830feac 100644 --- a/docs/components/modules/ROOT/pages/pubnub-component.adoc +++ b/docs/components/modules/ROOT/pages/pubnub-component.adoc @@ -101,7 +101,7 @@ with the following path and query parameters: | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern | *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) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...] -| *pubnub* (advanced) | Reference to a Pubnub client in the registry. | | PubNub +| *pubnub* (advanced) | *Autowired* Reference to a Pubnub client in the registry. | | PubNub | *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. | | String | *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. | | String | *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. | | String