Skip to content

Commit 0fb153a

Browse files
committed
Regen
1 parent 8ac4ee9 commit 0fb153a

File tree

6 files changed

+289
-32
lines changed

6 files changed

+289
-32
lines changed

catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/solr.json

Lines changed: 55 additions & 30 deletions
Large diffs are not rendered by default.

components-starter/camel-solr-starter/src/main/docs/solr.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,80 @@
2020
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration",
2121
"defaultValue": true
2222
},
23+
{
24+
"name": "camel.component.solr.connection-timeout",
25+
"type": "java.lang.Long",
26+
"description": "The time in ms to wait before connection will time out.",
27+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration",
28+
"defaultValue": 60000
29+
},
2330
{
2431
"name": "camel.component.solr.customizer.enabled",
2532
"type": "java.lang.Boolean",
2633
"sourceType": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties"
2734
},
35+
{
36+
"name": "camel.component.solr.default-collection",
37+
"type": "java.lang.String",
38+
"description": "Solr default collection name",
39+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
40+
},
41+
{
42+
"name": "camel.component.solr.enable-s-s-l",
43+
"type": "java.lang.Boolean",
44+
"description": "Enable SSL",
45+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration",
46+
"defaultValue": false
47+
},
2848
{
2949
"name": "camel.component.solr.enabled",
3050
"type": "java.lang.Boolean",
3151
"description": "Whether to enable auto configuration of the solr component. This is enabled by default.",
3252
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
3353
},
54+
{
55+
"name": "camel.component.solr.host",
56+
"type": "java.lang.String",
57+
"description": "The solr instance host name",
58+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
59+
},
3460
{
3561
"name": "camel.component.solr.lazy-start-producer",
3662
"type": "java.lang.Boolean",
3763
"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 producer may take a little time and prolong the total processing time of the processing.",
3864
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration",
3965
"defaultValue": false
66+
},
67+
{
68+
"name": "camel.component.solr.password",
69+
"type": "java.lang.String",
70+
"description": "Password for authenticating",
71+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
72+
},
73+
{
74+
"name": "camel.component.solr.port",
75+
"type": "java.lang.Integer",
76+
"description": "The solr instance port number",
77+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
78+
},
79+
{
80+
"name": "camel.component.solr.request-timeout",
81+
"type": "java.lang.Long",
82+
"description": "The timeout in ms to wait before the socket will time out.",
83+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration",
84+
"defaultValue": 600000
85+
},
86+
{
87+
"name": "camel.component.solr.solr-client",
88+
"type": "org.apache.solr.client.solrj.SolrClient",
89+
"description": "To use an existing configured solr client, instead of creating a client per endpoint. This allows customizing the client with specific advanced settings. The option is a org.apache.solr.client.solrj.SolrClient type.",
90+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
91+
},
92+
{
93+
"name": "camel.component.solr.username",
94+
"type": "java.lang.String",
95+
"description": "Basic authenticate user",
96+
"sourceType": "org.apache.camel.component.solr.springboot.SolrComponentConfiguration"
4097
}
4198
],
4299
"hints": []

components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
4343
@EnableConfigurationProperties({ComponentConfigurationProperties.class,SolrComponentConfiguration.class})
4444
@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.solr"})
45-
@AutoConfigureAfter(CamelAutoConfiguration.class)
45+
@AutoConfigureAfter({CamelAutoConfiguration.class, SolrComponentConverter.class})
4646
public class SolrComponentAutoConfiguration {
4747

4848
@Autowired

components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentConfiguration.java

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.camel.component.solr.springboot;
1818

1919
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
20+
import org.apache.solr.client.solrj.SolrClient;
2021
import org.springframework.boot.context.properties.ConfigurationProperties;
2122

2223
/**
@@ -34,6 +35,18 @@ public class SolrComponentConfiguration
3435
* enabled by default.
3536
*/
3637
private Boolean enabled;
38+
/**
39+
* The time in ms to wait before connection will time out.
40+
*/
41+
private Long connectionTimeout = 60000L;
42+
/**
43+
* Solr default collection name
44+
*/
45+
private String defaultCollection;
46+
/**
47+
* The solr instance host name
48+
*/
49+
private String host;
3750
/**
3851
* Whether the producer should be started lazy (on the first message). By
3952
* starting lazy you can use this to allow CamelContext and routes to
@@ -45,6 +58,14 @@ public class SolrComponentConfiguration
4558
* and prolong the total processing time of the processing.
4659
*/
4760
private Boolean lazyStartProducer = false;
61+
/**
62+
* The solr instance port number
63+
*/
64+
private Integer port;
65+
/**
66+
* The timeout in ms to wait before the socket will time out.
67+
*/
68+
private Long requestTimeout = 600000L;
4869
/**
4970
* Whether autowiring is enabled. This is used for automatic autowiring
5071
* options (the option must be marked as autowired) by looking up in the
@@ -54,6 +75,48 @@ public class SolrComponentConfiguration
5475
* etc.
5576
*/
5677
private Boolean autowiredEnabled = true;
78+
/**
79+
* To use an existing configured solr client, instead of creating a client
80+
* per endpoint. This allows customizing the client with specific advanced
81+
* settings. The option is a org.apache.solr.client.solrj.SolrClient type.
82+
*/
83+
private SolrClient solrClient;
84+
/**
85+
* Enable SSL
86+
*/
87+
private Boolean enableSSL = false;
88+
/**
89+
* Password for authenticating
90+
*/
91+
private String password;
92+
/**
93+
* Basic authenticate user
94+
*/
95+
private String username;
96+
97+
public Long getConnectionTimeout() {
98+
return connectionTimeout;
99+
}
100+
101+
public void setConnectionTimeout(Long connectionTimeout) {
102+
this.connectionTimeout = connectionTimeout;
103+
}
104+
105+
public String getDefaultCollection() {
106+
return defaultCollection;
107+
}
108+
109+
public void setDefaultCollection(String defaultCollection) {
110+
this.defaultCollection = defaultCollection;
111+
}
112+
113+
public String getHost() {
114+
return host;
115+
}
116+
117+
public void setHost(String host) {
118+
this.host = host;
119+
}
57120

58121
public Boolean getLazyStartProducer() {
59122
return lazyStartProducer;
@@ -63,11 +126,59 @@ public void setLazyStartProducer(Boolean lazyStartProducer) {
63126
this.lazyStartProducer = lazyStartProducer;
64127
}
65128

129+
public Integer getPort() {
130+
return port;
131+
}
132+
133+
public void setPort(Integer port) {
134+
this.port = port;
135+
}
136+
137+
public Long getRequestTimeout() {
138+
return requestTimeout;
139+
}
140+
141+
public void setRequestTimeout(Long requestTimeout) {
142+
this.requestTimeout = requestTimeout;
143+
}
144+
66145
public Boolean getAutowiredEnabled() {
67146
return autowiredEnabled;
68147
}
69148

70149
public void setAutowiredEnabled(Boolean autowiredEnabled) {
71150
this.autowiredEnabled = autowiredEnabled;
72151
}
152+
153+
public SolrClient getSolrClient() {
154+
return solrClient;
155+
}
156+
157+
public void setSolrClient(SolrClient solrClient) {
158+
this.solrClient = solrClient;
159+
}
160+
161+
public Boolean getEnableSSL() {
162+
return enableSSL;
163+
}
164+
165+
public void setEnableSSL(Boolean enableSSL) {
166+
this.enableSSL = enableSSL;
167+
}
168+
169+
public String getPassword() {
170+
return password;
171+
}
172+
173+
public void setPassword(String password) {
174+
this.password = password;
175+
}
176+
177+
public String getUsername() {
178+
return username;
179+
}
180+
181+
public void setUsername(String username) {
182+
this.username = username;
183+
}
73184
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.camel.component.solr.springboot;
18+
19+
import java.util.LinkedHashSet;
20+
import java.util.Set;
21+
import org.springframework.beans.factory.annotation.Autowired;
22+
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
23+
import org.springframework.context.ApplicationContext;
24+
import org.springframework.context.annotation.Configuration;
25+
import org.springframework.core.convert.TypeDescriptor;
26+
import org.springframework.core.convert.converter.GenericConverter;
27+
import org.springframework.stereotype.Component;
28+
29+
/**
30+
* Generated by camel-package-maven-plugin - do not edit this file!
31+
*/
32+
@Configuration(proxyBeanMethods = false)
33+
@ConfigurationPropertiesBinding
34+
@Component
35+
public class SolrComponentConverter implements GenericConverter {
36+
37+
@Autowired
38+
private ApplicationContext applicationContext;
39+
40+
public Set<ConvertiblePair> getConvertibleTypes() {
41+
Set<ConvertiblePair> answer = new LinkedHashSet<>();
42+
answer.add(new ConvertiblePair(String.class, org.apache.solr.client.solrj.SolrClient.class));
43+
return answer;
44+
}
45+
46+
public Object convert(
47+
Object source,
48+
TypeDescriptor sourceType,
49+
TypeDescriptor targetType) {
50+
if (source == null) {
51+
return null;
52+
}
53+
String ref = source.toString();
54+
if (!ref.startsWith("#")) {
55+
return null;
56+
}
57+
ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
58+
switch (targetType.getName()) {
59+
case "org.apache.solr.client.solrj.SolrClient": return applicationContext.getBean(ref, org.apache.solr.client.solrj.SolrClient.class);
60+
}
61+
return null;
62+
}
63+
}

components-starter/camel-solr-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
## limitations under the License.
1616
## ---------------------------------------------------------------------------
1717

18-
org.apache.camel.component.solr.springboot.SolrComponentAutoConfiguration
18+
org.apache.camel.component.solr.springboot.SolrComponentAutoConfiguration
19+
org.apache.camel.component.solr.springboot.SolrComponentConverter

0 commit comments

Comments
 (0)