http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java new file mode 100644 index 0000000..ac2f43b --- /dev/null +++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.splunk.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.splunk.SplunkComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SplunkComponentConfiguration.class) +public class SplunkComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SplunkComponent.class) + public SplunkComponent configureComponent(CamelContext camelContext, + SplunkComponentConfiguration configuration) throws Exception { + SplunkComponent component = new SplunkComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentConfiguration.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentConfiguration.java new file mode 100644 index 0000000..2100393 --- /dev/null +++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentConfiguration.java @@ -0,0 +1,43 @@ +/** + * 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.splunk.springboot; + +import org.apache.camel.component.splunk.SplunkConfigurationFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The splunk component allows to publish or search for events in Splunk. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.splunk") +public class SplunkComponentConfiguration { + + /** + * To use the SplunkConfigurationFactory + */ + private SplunkConfigurationFactory splunkConfigurationFactory; + + public SplunkConfigurationFactory getSplunkConfigurationFactory() { + return splunkConfigurationFactory; + } + + public void setSplunkConfigurationFactory( + SplunkConfigurationFactory splunkConfigurationFactory) { + this.splunkConfigurationFactory = splunkConfigurationFactory; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-splunk/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/resources/META-INF/spring.factories b/components/camel-splunk/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..f508243 --- /dev/null +++ b/components/camel-splunk/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.splunk.springboot.SplunkComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java new file mode 100644 index 0000000..bd8d10d --- /dev/null +++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.spring.batch.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.spring.batch.SpringBatchComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SpringBatchComponentConfiguration.class) +public class SpringBatchComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SpringBatchComponent.class) + public SpringBatchComponent configureComponent(CamelContext camelContext, + SpringBatchComponentConfiguration configuration) throws Exception { + SpringBatchComponent component = new SpringBatchComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentConfiguration.java b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentConfiguration.java new file mode 100644 index 0000000..a1d5b8e --- /dev/null +++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentConfiguration.java @@ -0,0 +1,43 @@ +/** + * 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.spring.batch.springboot; + +import org.springframework.batch.core.launch.JobLauncher; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The spring-batch component allows to send messages to Spring Batch for + * further processing. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.spring-batch") +public class SpringBatchComponentConfiguration { + + /** + * Explicitly specifies a JobLauncher to be used. + */ + private JobLauncher jobLauncher; + + public JobLauncher getJobLauncher() { + return jobLauncher; + } + + public void setJobLauncher(JobLauncher jobLauncher) { + this.jobLauncher = jobLauncher; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring-batch/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-spring-batch/src/main/resources/META-INF/spring.factories b/components/camel-spring-batch/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..e3c5109 --- /dev/null +++ b/components/camel-spring-batch/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.spring.batch.springboot.SpringBatchComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentAutoConfiguration.java b/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentAutoConfiguration.java new file mode 100644 index 0000000..605a467 --- /dev/null +++ b/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.event.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.event.EventComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(EventComponentConfiguration.class) +public class EventComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(EventComponent.class) + public EventComponent configureComponent(CamelContext camelContext, + EventComponentConfiguration configuration) throws Exception { + EventComponent component = new EventComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentConfiguration.java b/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentConfiguration.java new file mode 100644 index 0000000..a2cc856 --- /dev/null +++ b/components/camel-spring/src/main/java/org/apache/camel/component/event/springboot/EventComponentConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.event.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.ApplicationContext; + +/** + * The spring-event component allows to listen for Spring Application Events. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.spring-event") +public class EventComponentConfiguration { + + /** + * The Spring ApplicationContext + */ + private ApplicationContext applicationContext; + + public ApplicationContext getApplicationContext() { + return applicationContext; + } + + public void setApplicationContext(ApplicationContext applicationContext) { + this.applicationContext = applicationContext; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-spring/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/resources/META-INF/spring.factories b/components/camel-spring/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..3b58cd1 --- /dev/null +++ b/components/camel-spring/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.event.springboot.EventComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentAutoConfiguration.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentAutoConfiguration.java new file mode 100644 index 0000000..72e4166 --- /dev/null +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.sql.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.sql.SqlComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SqlComponentConfiguration.class) +public class SqlComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SqlComponent.class) + public SqlComponent configureComponent(CamelContext camelContext, + SqlComponentConfiguration configuration) throws Exception { + SqlComponent component = new SqlComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentConfiguration.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentConfiguration.java new file mode 100644 index 0000000..f8d5ea6 --- /dev/null +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/springboot/SqlComponentConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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.sql.springboot; + +import javax.sql.DataSource; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The sql component can be used to perform SQL query to a database. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sql") +public class SqlComponentConfiguration { + + /** + * Sets the DataSource to use to communicate with the database. + */ + private DataSource dataSource; + /** + * Sets whether to use placeholder and replace all placeholder characters + * with sign in the SQL queries. This option is default true + */ + private boolean usePlaceholder; + + public DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } + + public boolean isUsePlaceholder() { + return usePlaceholder; + } + + public void setUsePlaceholder(boolean usePlaceholder) { + this.usePlaceholder = usePlaceholder; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentAutoConfiguration.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentAutoConfiguration.java new file mode 100644 index 0000000..e3fd0eb --- /dev/null +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.sql.stored.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.sql.stored.SqlStoredComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SqlStoredComponentConfiguration.class) +public class SqlStoredComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SqlStoredComponent.class) + public SqlStoredComponent configureComponent(CamelContext camelContext, + SqlStoredComponentConfiguration configuration) throws Exception { + SqlStoredComponent component = new SqlStoredComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentConfiguration.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentConfiguration.java new file mode 100644 index 0000000..22dc8f7 --- /dev/null +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/springboot/SqlStoredComponentConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.sql.stored.springboot; + +import javax.sql.DataSource; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Camel SQL support + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sql-stored") +public class SqlStoredComponentConfiguration { + + /** + * Sets the DataSource to use to communicate with the database. + */ + private DataSource dataSource; + + public DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-sql/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-sql/src/main/resources/META-INF/spring.factories b/components/camel-sql/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..1412326 --- /dev/null +++ b/components/camel-sql/src/main/resources/META-INF/spring.factories @@ -0,0 +1,21 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.sql.springboot.SqlComponentAutoConfiguration,\ +org.apache.camel.component.sql.stored.springboot.SqlStoredComponentAutoConfiguration + http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentAutoConfiguration.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentAutoConfiguration.java new file mode 100644 index 0000000..2db11d3 --- /dev/null +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.ssh.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.ssh.SshComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SshComponentConfiguration.class) +public class SshComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SshComponent.class) + public SshComponent configureComponent(CamelContext camelContext, + SshComponentConfiguration configuration) throws Exception { + SshComponent component = new SshComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentConfiguration.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentConfiguration.java new file mode 100644 index 0000000..36fca04 --- /dev/null +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentConfiguration.java @@ -0,0 +1,175 @@ +/** + * 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.ssh.springboot; + +import org.apache.camel.component.ssh.SshConfiguration; +import org.apache.sshd.common.KeyPairProvider; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The ssh component enables access to SSH servers such that you can send an SSH + * command and process the response. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.ssh") +public class SshComponentConfiguration { + + /** + * To use the shared SSH configuration + */ + private SshConfiguration configuration; + /** + * Sets the hostname of the remote SSH server. + */ + private String host; + /** + * Sets the port number for the remote SSH server. + */ + private int port; + /** + * Sets the username to use in logging into the remote SSH server. + */ + private String username; + /** + * Sets the password to use in connecting to remote SSH server. Requires + * keyPairProvider to be set to null. + */ + private String password; + /** + * Sets the command string to send to the remote SSH server during every + * poll cycle. Only works with camel-ssh component being used as a consumer + * i.e. from(ssh://...). You may need to end your command with a newline and + * that must be URL encoded 0A + */ + private String pollCommand; + /** + * Sets the KeyPairProvider reference to use when connecting using + * Certificates to the remote SSH Server. + */ + private KeyPairProvider keyPairProvider; + /** + * Sets the key type to pass to the KeyPairProvider as part of + * authentication. KeyPairProvider.loadKey(...) will be passed this value. + * Defaults to ssh-rsa. + */ + private String keyType; + /** + * Sets the timeout in milliseconds to wait in establishing the remote SSH + * server connection. Defaults to 30000 milliseconds. + */ + private long timeout; + /** + * Sets the resource path of the certificate to use for Authentication. + */ + @Deprecated + private String certFilename; + /** + * Sets the resource path of the certificate to use for Authentication. Will + * use ResourceHelperKeyPairProvider to resolve file based certificate and + * depends on keyType setting. + */ + private String certResource; + + public SshConfiguration getConfiguration() { + return configuration; + } + + public void setConfiguration(SshConfiguration configuration) { + this.configuration = configuration; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getPollCommand() { + return pollCommand; + } + + public void setPollCommand(String pollCommand) { + this.pollCommand = pollCommand; + } + + public KeyPairProvider getKeyPairProvider() { + return keyPairProvider; + } + + public void setKeyPairProvider(KeyPairProvider keyPairProvider) { + this.keyPairProvider = keyPairProvider; + } + + public String getKeyType() { + return keyType; + } + + public void setKeyType(String keyType) { + this.keyType = keyType; + } + + public long getTimeout() { + return timeout; + } + + public void setTimeout(long timeout) { + this.timeout = timeout; + } + + public String getCertFilename() { + return certFilename; + } + + public void setCertFilename(String certFilename) { + this.certFilename = certFilename; + } + + public String getCertResource() { + return certResource; + } + + public void setCertResource(String certResource) { + this.certResource = certResource; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-ssh/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-ssh/src/main/resources/META-INF/spring.factories b/components/camel-ssh/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..67aa6d0 --- /dev/null +++ b/components/camel-ssh/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.ssh.springboot.SshComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java index 8a87a87..c74becc 100644 --- a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java +++ b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java @@ -23,7 +23,30 @@ import org.apache.camel.impl.UriEndpointComponent; public class StompComponent extends UriEndpointComponent { - private StompConfiguration configuration = new StompConfiguration(); + /** + * To use the shared stomp configuration + */ + private StompConfiguration configuration; + + /** + * The URI of the Stomp broker to connect to + */ + private String brokerUrl; + + /** + * The username + */ + private String login; + + /** + * The password + */ + private String passcode; + + /** + * The virtual host + */ + private String host; public StompComponent() { super(StompEndpoint.class); @@ -43,6 +66,13 @@ public class StompComponent extends UriEndpointComponent { return endpoint; } + @Override + protected void doStart() throws Exception { + super.doStart(); + + configuration.setBrokerURL(brokerUrl); + } + public StompConfiguration getConfiguration() { return configuration; } http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentAutoConfiguration.java b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentAutoConfiguration.java new file mode 100644 index 0000000..10f73e2 --- /dev/null +++ b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.stomp.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.stomp.StompComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(StompComponentConfiguration.class) +public class StompComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(StompComponent.class) + public StompComponent configureComponent(CamelContext camelContext, + StompComponentConfiguration configuration) throws Exception { + StompComponent component = new StompComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentConfiguration.java b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentConfiguration.java new file mode 100644 index 0000000..f664a2d --- /dev/null +++ b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/springboot/StompComponentConfiguration.java @@ -0,0 +1,91 @@ +/** + * 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.stomp.springboot; + +import org.apache.camel.component.stomp.StompConfiguration; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The stomp component is used for communicating with Stomp compliant message + * brokers. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.stomp") +public class StompComponentConfiguration { + + /** + * To use the shared stomp configuration + */ + private StompConfiguration configuration; + /** + * The URI of the Stomp broker to connect to + */ + private String brokerURL; + /** + * The username + */ + private String login; + /** + * The password + */ + private String passcode; + /** + * The virtual host + */ + private String host; + + public StompConfiguration getConfiguration() { + return configuration; + } + + public void setConfiguration(StompConfiguration configuration) { + this.configuration = configuration; + } + + public String getBrokerURL() { + return brokerURL; + } + + public void setBrokerURL(String brokerURL) { + this.brokerURL = brokerURL; + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getPasscode() { + return passcode; + } + + public void setPasscode(String passcode) { + this.passcode = passcode; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-stomp/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-stomp/src/main/resources/META-INF/spring.factories b/components/camel-stomp/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..1f38a87 --- /dev/null +++ b/components/camel-stomp/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.stomp.springboot.StompComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentAutoConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentAutoConfiguration.java new file mode 100644 index 0000000..33e46ff --- /dev/null +++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.twitter.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.twitter.TwitterComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(TwitterComponentConfiguration.class) +public class TwitterComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(TwitterComponent.class) + public TwitterComponent configureComponent(CamelContext camelContext, + TwitterComponentConfiguration configuration) throws Exception { + TwitterComponent component = new TwitterComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentConfiguration.java new file mode 100644 index 0000000..8ce5105 --- /dev/null +++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/springboot/TwitterComponentConfiguration.java @@ -0,0 +1,126 @@ +/** + * 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.twitter.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * This component integrates with Twitter to send tweets or search for tweets + * and more. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.twitter") +public class TwitterComponentConfiguration { + + /** + * The access token + */ + private String accessToken; + /** + * The access token secret + */ + private String accessTokenSecret; + /** + * The consumer key + */ + private String consumerKey; + /** + * The consumer secret + */ + private String consumerSecret; + /** + * The http proxy host which can be used for the camel-twitter. + */ + private String httpProxyHost; + /** + * The http proxy user which can be used for the camel-twitter. + */ + private String httpProxyUser; + /** + * The http proxy password which can be used for the camel-twitter. + */ + private String httpProxyPassword; + /** + * The http proxy port which can be used for the camel-twitter. + */ + private int httpProxyPort; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getAccessTokenSecret() { + return accessTokenSecret; + } + + public void setAccessTokenSecret(String accessTokenSecret) { + this.accessTokenSecret = accessTokenSecret; + } + + public String getConsumerKey() { + return consumerKey; + } + + public void setConsumerKey(String consumerKey) { + this.consumerKey = consumerKey; + } + + public String getConsumerSecret() { + return consumerSecret; + } + + public void setConsumerSecret(String consumerSecret) { + this.consumerSecret = consumerSecret; + } + + public String getHttpProxyHost() { + return httpProxyHost; + } + + public void setHttpProxyHost(String httpProxyHost) { + this.httpProxyHost = httpProxyHost; + } + + public String getHttpProxyUser() { + return httpProxyUser; + } + + public void setHttpProxyUser(String httpProxyUser) { + this.httpProxyUser = httpProxyUser; + } + + public String getHttpProxyPassword() { + return httpProxyPassword; + } + + public void setHttpProxyPassword(String httpProxyPassword) { + this.httpProxyPassword = httpProxyPassword; + } + + public int getHttpProxyPort() { + return httpProxyPort; + } + + public void setHttpProxyPort(int httpProxyPort) { + this.httpProxyPort = httpProxyPort; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-twitter/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-twitter/src/main/resources/META-INF/spring.factories b/components/camel-twitter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..8694c3b --- /dev/null +++ b/components/camel-twitter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.twitter.springboot.TwitterComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java new file mode 100644 index 0000000..68b4ac5 --- /dev/null +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.undertow.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.undertow.UndertowComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(UndertowComponentConfiguration.class) +public class UndertowComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(UndertowComponent.class) + public UndertowComponent configureComponent(CamelContext camelContext, + UndertowComponentConfiguration configuration) throws Exception { + UndertowComponent component = new UndertowComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java new file mode 100644 index 0000000..4bece05 --- /dev/null +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java @@ -0,0 +1,58 @@ +/** + * 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.undertow.springboot; + +import org.apache.camel.component.undertow.UndertowHttpBinding; +import org.apache.camel.util.jsse.SSLContextParameters; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The undertow component provides HTTP-based endpoints for consuming and + * producing HTTP requests. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.undertow") +public class UndertowComponentConfiguration { + + /** + * To use a custom HttpBinding to control the mapping between Camel message + * and HttpClient. + */ + private UndertowHttpBinding undertowHttpBinding; + /** + * To configure security using SSLContextParameters + */ + private SSLContextParameters sslContextParameters; + + public UndertowHttpBinding getUndertowHttpBinding() { + return undertowHttpBinding; + } + + public void setUndertowHttpBinding(UndertowHttpBinding undertowHttpBinding) { + this.undertowHttpBinding = undertowHttpBinding; + } + + public SSLContextParameters getSslContextParameters() { + return sslContextParameters; + } + + public void setSslContextParameters( + SSLContextParameters sslContextParameters) { + this.sslContextParameters = sslContextParameters; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-undertow/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/resources/META-INF/spring.factories b/components/camel-undertow/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..effa0bf --- /dev/null +++ b/components/camel-undertow/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.undertow.springboot.UndertowComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java new file mode 100644 index 0000000..0221cf4 --- /dev/null +++ b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.velocity.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.velocity.VelocityComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(VelocityComponentConfiguration.class) +public class VelocityComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(VelocityComponent.class) + public VelocityComponent configureComponent(CamelContext camelContext, + VelocityComponentConfiguration configuration) throws Exception { + VelocityComponent component = new VelocityComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentConfiguration.java b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentConfiguration.java new file mode 100644 index 0000000..70776ac --- /dev/null +++ b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.velocity.springboot; + +import org.apache.velocity.app.VelocityEngine; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Transforms the message using a Velocity template. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.velocity") +public class VelocityComponentConfiguration { + + /** + * To use the VelocityEngine otherwise a new engine is created + */ + private VelocityEngine velocityEngine; + + public VelocityEngine getVelocityEngine() { + return velocityEngine; + } + + public void setVelocityEngine(VelocityEngine velocityEngine) { + this.velocityEngine = velocityEngine; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-velocity/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-velocity/src/main/resources/META-INF/spring.factories b/components/camel-velocity/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..aca4338 --- /dev/null +++ b/components/camel-velocity/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.velocity.springboot.VelocityComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentAutoConfiguration.java b/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentAutoConfiguration.java new file mode 100644 index 0000000..b8bf9e1 --- /dev/null +++ b/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.vertx.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.vertx.VertxComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(VertxComponentConfiguration.class) +public class VertxComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(VertxComponent.class) + public VertxComponent configureComponent(CamelContext camelContext, + VertxComponentConfiguration configuration) throws Exception { + VertxComponent component = new VertxComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentConfiguration.java b/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentConfiguration.java new file mode 100644 index 0000000..1cd228b --- /dev/null +++ b/components/camel-vertx/src/main/java/org/apache/camel/component/vertx/springboot/VertxComponentConfiguration.java @@ -0,0 +1,107 @@ +/** + * 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.vertx.springboot; + +import io.vertx.core.Vertx; +import io.vertx.core.VertxOptions; +import io.vertx.core.spi.VertxFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The vertx component is used for sending and receive messages from a vertx + * event bus. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.vertx") +public class VertxComponentConfiguration { + + /** + * To use a custom VertxFactory implementation + */ + private VertxFactory vertxFactory; + /** + * Hostname for creating an embedded clustered EventBus + */ + private String host; + /** + * Port for creating an embedded clustered EventBus + */ + private int port; + /** + * Options to use for creating vertx + */ + private VertxOptions vertxOptions; + /** + * To use the given vertx EventBus instead of creating a new embedded + * EventBus + */ + private Vertx vertx; + /** + * Timeout in seconds to wait for clustered Vertx EventBus to be ready. The + * default value is 60. + */ + private int timeout; + + public VertxFactory getVertxFactory() { + return vertxFactory; + } + + public void setVertxFactory(VertxFactory vertxFactory) { + this.vertxFactory = vertxFactory; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public VertxOptions getVertxOptions() { + return vertxOptions; + } + + public void setVertxOptions(VertxOptions vertxOptions) { + this.vertxOptions = vertxOptions; + } + + public Vertx getVertx() { + return vertx; + } + + public void setVertx(Vertx vertx) { + this.vertx = vertx; + } + + public int getTimeout() { + return timeout; + } + + public void setTimeout(int timeout) { + this.timeout = timeout; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-vertx/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-vertx/src/main/resources/META-INF/spring.factories b/components/camel-vertx/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..2b84e83 --- /dev/null +++ b/components/camel-vertx/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.vertx.springboot.VertxComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/75251730/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/springboot/WebsocketComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/springboot/WebsocketComponentAutoConfiguration.java b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/springboot/WebsocketComponentAutoConfiguration.java new file mode 100644 index 0000000..a127ede --- /dev/null +++ b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/springboot/WebsocketComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.websocket.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.websocket.WebsocketComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(WebsocketComponentConfiguration.class) +public class WebsocketComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(WebsocketComponent.class) + public WebsocketComponent configureComponent(CamelContext camelContext, + WebsocketComponentConfiguration configuration) throws Exception { + WebsocketComponent component = new WebsocketComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file