This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 00373971e93 Regen
00373971e93 is described below

commit 00373971e93cbd404d523d0363536cedd4454ba6
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Tue Jun 11 07:13:00 2024 +0200

    Regen
---
 .../components/elasticsearch-rest-client.json      |  14 ++-
 .../src/main/docs/elasticsearch-rest-client.json   |  65 +++++++++++
 ...searchRestClientComponentAutoConfiguration.java |   2 +-
 ...sticsearchRestClientComponentConfiguration.java | 122 +++++++++++++++++++++
 .../ElasticsearchRestClientComponentConverter.java |  65 +++++++++++
 ...rk.boot.autoconfigure.AutoConfiguration.imports |   3 +-
 6 files changed, 267 insertions(+), 4 deletions(-)

diff --git 
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/elasticsearch-rest-client.json
 
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/elasticsearch-rest-client.json
index dd1dbda3bd0..fe3151ddda5 100644
--- 
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/elasticsearch-rest-client.json
+++ 
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/elasticsearch-rest-client.json
@@ -23,8 +23,18 @@
     "remote": true
   },
   "componentProperties": {
-    "lazyStartProducer": { "index": 0, "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 [...]
-    "autowiredEnabled": { "index": 1, "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 t [...]
+    "connectionTimeout": { "index": 0, "kind": "property", "displayName": 
"Connection Timeout", "group": "producer", "label": "", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 30000, "description": "Connection timeout" },
+    "hostAddressesList": { "index": 1, "kind": "property", "displayName": 
"Host Addresses List", "group": "producer", "label": "", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "description": "List of host Addresses, 
multiple hosts can be separated by comma." },
+    "lazyStartProducer": { "index": 2, "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 [...]
+    "socketTimeout": { "index": 3, "kind": "property", "displayName": "Socket 
Timeout", "group": "producer", "label": "", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 30000, "description": "Socket timeout" },
+    "autowiredEnabled": { "index": 4, "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 t [...]
+    "enableSniffer": { "index": 5, "kind": "property", "displayName": "Enable 
Sniffer", "group": "advanced", "label": "advanced", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Enabling Sniffer" },
+    "restClient": { "index": 6, "kind": "property", "displayName": "Rest 
Client", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "org.elasticsearch.client.RestClient", "deprecated": 
false, "autowired": true, "secret": false, "description": "Rest Client of type 
org.elasticsearch.client.RestClient. This is only for advanced usage" },
+    "sniffAfterFailureDelay": { "index": 7, "kind": "property", "displayName": 
"Sniff After Failure Delay", "group": "advanced", "label": "advanced", 
"required": false, "type": "integer", "javaType": "int", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 60000, "description": 
"Sniffer after failure delay (in millis)" },
+    "snifferInterval": { "index": 8, "kind": "property", "displayName": 
"Sniffer Interval", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 60000, "description": "Sniffer interval 
(in millis)" },
+    "certificatePath": { "index": 9, "kind": "property", "displayName": 
"Certificate Path", "group": "security", "label": "security", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "supportFileReference": true, 
"description": "Certificate Path" },
+    "password": { "index": 10, "kind": "property", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "description": "Password" },
+    "user": { "index": 11, "kind": "property", "displayName": "User", "group": 
"security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "description": "Username" }
   },
   "properties": {
     "clusterName": { "index": 0, "kind": "path", "displayName": "Cluster 
Name", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "description": "Cluster Name" },
diff --git 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/docs/elasticsearch-rest-client.json
 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/docs/elasticsearch-rest-client.json
index 76de58cd8e8..76fbc1811e9 100644
--- 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/docs/elasticsearch-rest-client.json
+++ 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/docs/elasticsearch-rest-client.json
@@ -20,23 +20,88 @@
       "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
       "defaultValue": true
     },
+    {
+      "name": "camel.component.elasticsearch-rest-client.certificate-path",
+      "type": "java.lang.String",
+      "description": "Certificate Path",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.connection-timeout",
+      "type": "java.lang.Integer",
+      "description": "Connection timeout",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
+      "defaultValue": 30000
+    },
     {
       "name": "camel.component.elasticsearch-rest-client.customizer.enabled",
       "type": "java.lang.Boolean",
       "sourceType": 
"org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties"
     },
+    {
+      "name": "camel.component.elasticsearch-rest-client.enable-sniffer",
+      "type": "java.lang.Boolean",
+      "description": "Enabling Sniffer",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
+      "defaultValue": false
+    },
     {
       "name": "camel.component.elasticsearch-rest-client.enabled",
       "type": "java.lang.Boolean",
       "description": "Whether to enable auto configuration of the 
elasticsearch-rest-client component. This is enabled by default.",
       "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
     },
+    {
+      "name": "camel.component.elasticsearch-rest-client.host-addresses-list",
+      "type": "java.lang.String",
+      "description": "List of host Addresses, multiple hosts can be separated 
by comma.",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
+    },
     {
       "name": "camel.component.elasticsearch-rest-client.lazy-start-producer",
       "type": "java.lang.Boolean",
       "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 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 starting the [...]
       "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
       "defaultValue": false
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.password",
+      "type": "java.lang.String",
+      "description": "Password",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.rest-client",
+      "type": "org.elasticsearch.client.RestClient",
+      "description": "Rest Client of type org.elasticsearch.client.RestClient. 
This is only for advanced usage. The option is a 
org.elasticsearch.client.RestClient type.",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
+    },
+    {
+      "name": 
"camel.component.elasticsearch-rest-client.sniff-after-failure-delay",
+      "type": "java.lang.Integer",
+      "description": "Sniffer after failure delay (in millis)",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
+      "defaultValue": 60000
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.sniffer-interval",
+      "type": "java.lang.Integer",
+      "description": "Sniffer interval (in millis)",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
+      "defaultValue": 60000
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.socket-timeout",
+      "type": "java.lang.Integer",
+      "description": "Socket timeout",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration",
+      "defaultValue": 30000
+    },
+    {
+      "name": "camel.component.elasticsearch-rest-client.user",
+      "type": "java.lang.String",
+      "description": "Username",
+      "sourceType": 
"org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConfiguration"
     }
   ],
   "hints": []
diff --git 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
index 920ba5659f4..eea80255b62 100644
--- 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
+++ 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
@@ -42,7 +42,7 @@ import org.springframework.context.annotation.Lazy;
 @Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
 
@EnableConfigurationProperties({ComponentConfigurationProperties.class,ElasticsearchRestClientComponentConfiguration.class})
 @ConditionalOnHierarchicalProperties({"camel.component", 
"camel.component.elasticsearch-rest-client"})
-@AutoConfigureAfter(CamelAutoConfiguration.class)
+@AutoConfigureAfter({CamelAutoConfiguration.class, 
ElasticsearchRestClientComponentConverter.class})
 public class ElasticsearchRestClientComponentAutoConfiguration {
 
     @Autowired
diff --git 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConfiguration.java
 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConfiguration.java
index 656477e0aec..524842ec5bf 100644
--- 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConfiguration.java
+++ 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConfiguration.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.elasticsearch.rest.client.springboot;
 
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
+import org.elasticsearch.client.RestClient;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
@@ -35,6 +36,14 @@ public class ElasticsearchRestClientComponentConfiguration
      * component. This is enabled by default.
      */
     private Boolean enabled;
+    /**
+     * Connection timeout
+     */
+    private Integer connectionTimeout = 30000;
+    /**
+     * List of host Addresses, multiple hosts can be separated by comma.
+     */
+    private String hostAddressesList;
     /**
      * Whether the producer should be started lazy (on the first message). By
      * starting lazy you can use this to allow CamelContext and routes to
@@ -46,6 +55,10 @@ public class ElasticsearchRestClientComponentConfiguration
      * and prolong the total processing time of the processing.
      */
     private Boolean lazyStartProducer = false;
+    /**
+     * Socket timeout
+     */
+    private Integer socketTimeout = 30000;
     /**
      * Whether autowiring is enabled. This is used for automatic autowiring
      * options (the option must be marked as autowired) by looking up in the
@@ -55,6 +68,51 @@ public class ElasticsearchRestClientComponentConfiguration
      * etc.
      */
     private Boolean autowiredEnabled = true;
+    /**
+     * Enabling Sniffer
+     */
+    private Boolean enableSniffer = false;
+    /**
+     * Rest Client of type org.elasticsearch.client.RestClient. This is only 
for
+     * advanced usage. The option is a org.elasticsearch.client.RestClient 
type.
+     */
+    private RestClient restClient;
+    /**
+     * Sniffer after failure delay (in millis)
+     */
+    private Integer sniffAfterFailureDelay = 60000;
+    /**
+     * Sniffer interval (in millis)
+     */
+    private Integer snifferInterval = 60000;
+    /**
+     * Certificate Path
+     */
+    private String certificatePath;
+    /**
+     * Password
+     */
+    private String password;
+    /**
+     * Username
+     */
+    private String user;
+
+    public Integer getConnectionTimeout() {
+        return connectionTimeout;
+    }
+
+    public void setConnectionTimeout(Integer connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
+
+    public String getHostAddressesList() {
+        return hostAddressesList;
+    }
+
+    public void setHostAddressesList(String hostAddressesList) {
+        this.hostAddressesList = hostAddressesList;
+    }
 
     public Boolean getLazyStartProducer() {
         return lazyStartProducer;
@@ -64,6 +122,14 @@ public class ElasticsearchRestClientComponentConfiguration
         this.lazyStartProducer = lazyStartProducer;
     }
 
+    public Integer getSocketTimeout() {
+        return socketTimeout;
+    }
+
+    public void setSocketTimeout(Integer socketTimeout) {
+        this.socketTimeout = socketTimeout;
+    }
+
     public Boolean getAutowiredEnabled() {
         return autowiredEnabled;
     }
@@ -71,4 +137,60 @@ public class ElasticsearchRestClientComponentConfiguration
     public void setAutowiredEnabled(Boolean autowiredEnabled) {
         this.autowiredEnabled = autowiredEnabled;
     }
+
+    public Boolean getEnableSniffer() {
+        return enableSniffer;
+    }
+
+    public void setEnableSniffer(Boolean enableSniffer) {
+        this.enableSniffer = enableSniffer;
+    }
+
+    public RestClient getRestClient() {
+        return restClient;
+    }
+
+    public void setRestClient(RestClient restClient) {
+        this.restClient = restClient;
+    }
+
+    public Integer getSniffAfterFailureDelay() {
+        return sniffAfterFailureDelay;
+    }
+
+    public void setSniffAfterFailureDelay(Integer sniffAfterFailureDelay) {
+        this.sniffAfterFailureDelay = sniffAfterFailureDelay;
+    }
+
+    public Integer getSnifferInterval() {
+        return snifferInterval;
+    }
+
+    public void setSnifferInterval(Integer snifferInterval) {
+        this.snifferInterval = snifferInterval;
+    }
+
+    public String getCertificatePath() {
+        return certificatePath;
+    }
+
+    public void setCertificatePath(String certificatePath) {
+        this.certificatePath = certificatePath;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUser() {
+        return user;
+    }
+
+    public void setUser(String user) {
+        this.user = user;
+    }
 }
\ No newline at end of file
diff --git 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
new file mode 100644
index 00000000000..ed5beda868b
--- /dev/null
+++ 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.elasticsearch.rest.client.springboot;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.core.convert.converter.GenericConverter;
+import org.springframework.stereotype.Component;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration(proxyBeanMethods = false)
+@ConfigurationPropertiesBinding
+@Component
+public class ElasticsearchRestClientComponentConverter
+        implements
+            GenericConverter {
+
+    @Autowired
+    private ApplicationContext applicationContext;
+
+    public Set<ConvertiblePair> getConvertibleTypes() {
+        Set<ConvertiblePair> answer = new LinkedHashSet<>();
+        answer.add(new ConvertiblePair(String.class, 
org.elasticsearch.client.RestClient.class));
+        return answer;
+    }
+
+    public Object convert(
+            Object source,
+            TypeDescriptor sourceType,
+            TypeDescriptor targetType) {
+        if (source == null) {
+            return null;
+        }
+        String ref = source.toString();
+        if (!ref.startsWith("#")) {
+            return null;
+        }
+        ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
+        switch (targetType.getName()) {
+            case "org.elasticsearch.client.RestClient": return 
applicationContext.getBean(ref, org.elasticsearch.client.RestClient.class);
+        }
+        return null;
+    }
+}
\ No newline at end of file
diff --git 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index d04b4c4f95a..79b67d4ece4 100644
--- 
a/components-starter/camel-elasticsearch-rest-client-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ 
b/components-starter/camel-elasticsearch-rest-client-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,4 +15,5 @@
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
 
-org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentAutoConfiguration
+org.apache.camel.component.elasticsearch.rest.client.springboot.ElasticsearchRestClientComponentConverter

Reply via email to