This is an automated email from the ASF dual-hosted git repository. fmariani pushed a commit to branch camel-spring-boot-4.0.0-branch in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit 26aa619416ca8308373ad4615fe9b3220ecce1c0 Author: Tom Cunningham <[email protected]> AuthorDate: Mon May 15 16:14:32 2023 -0400 Add camel-sap-starter --- pom.xml | 3 + sap/camel-sap-starter/pom.xml | 255 ++++++ .../src/main/java/META-INF/MANIFEST.MF | 3 + .../SapClearCacheComponentAutoConfiguration.java | 61 ++ .../SapClearCacheComponentConfiguration.java | 58 ++ .../springboot/SapConnectionAutoConfiguration.java | 241 ++++++ .../sap/springboot/SapConnectionConfiguration.java | 959 +++++++++++++++++++++ ...dIDocDestinationComponentAutoConfiguration.java | 61 ++ ...ueuedIDocDestinationComponentConfiguration.java | 58 ++ ...cListDestinationComponentAutoConfiguration.java | 61 ++ ...dIDocListDestinationComponentConfiguration.java | 58 ++ ...edRfcDestinationComponentAutoConfiguration.java | 61 ++ ...QueuedRfcDestinationComponentConfiguration.java | 58 ++ ...usRfcDestinationComponentAutoConfiguration.java | 61 ++ ...ronousRfcDestinationComponentConfiguration.java | 58 ++ ...hronousRfcServerComponentAutoConfiguration.java | 61 ++ ...SynchronousRfcServerComponentConfiguration.java | 56 ++ ...lIDocDestinationComponentAutoConfiguration.java | 61 ++ ...ionalIDocDestinationComponentConfiguration.java | 58 ++ ...cListDestinationComponentAutoConfiguration.java | 61 ++ ...lIDocListDestinationComponentConfiguration.java | 58 ++ ...alIDocListServerComponentAutoConfiguration.java | 61 ++ ...tionalIDocListServerComponentConfiguration.java | 56 ++ ...alRfcDestinationComponentAutoConfiguration.java | 61 ++ ...tionalRfcDestinationComponentConfiguration.java | 58 ++ ...ctionalRfcServerComponentAutoConfiguration.java | 61 ++ ...ansactionalRfcServerComponentConfiguration.java | 56 ++ .../additional-spring-configuration-metadata.json | 10 + .../src/main/resources/META-INF/spring.factories | 40 + .../src/main/resources/META-INF/spring.provides | 17 + sap/pom.xml | 40 + 31 files changed, 2871 insertions(+) diff --git a/pom.xml b/pom.xml index c1486ac4f30..86df4deafe4 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,7 @@ <module>catalog</module> <!-- <module>tests</module> disabled by camel-spring-boot-prod-maven-plugin:camel-prod-excludes --> <!-- <module>docs</module> disabled by camel-spring-boot-prod-maven-plugin:camel-prod-excludes --> + <module>sap</module> <module>archetypes</module> </modules> @@ -120,6 +121,8 @@ <camel-sap.version>4.0.0.redhat-00001</camel-sap.version> + <camel-sap.version>4.0.0.redhat-00001</camel-sap.version> + <!-- narayana spring boot version --> <narayana-spring-boot.version>3.0.0.redhat-00017</narayana-spring-boot.version> diff --git a/sap/camel-sap-starter/pom.xml b/sap/camel-sap-starter/pom.xml new file mode 100644 index 00000000000..fe42c7d7d22 --- /dev/null +++ b/sap/camel-sap-starter/pom.xml @@ -0,0 +1,255 @@ +<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.springboot</groupId> + <artifactId>camel-sap-starter-parent</artifactId> + <version>4.0.0-RC2-SNAPSHOT</version> + </parent> + <groupId>org.fusesource</groupId> + <artifactId>camel-sap-starter</artifactId> + <packaging>jar</packaging> + <name>JBoss Fuse :: Components :: SAP JCO :: Spring-Boot Starter</name> + <description>SAP Camel Componet Spring Boot Starter</description> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <sapjco3-version>3.1.4</sapjco3-version> + <sapidoc3-version>3.1.1</sapidoc3-version> + <lib.directory>${project.build.directory}/lib</lib.directory> + </properties> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <dependency> + <groupId>org.fusesource</groupId> + <artifactId>camel-sap</artifactId> + <version>${camel-sap.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-support</artifactId> + <version>${camel-version}</version> + </dependency> + + + <!-- JCO jars --> + + <dependency> + <groupId>com.sap.conn.jco</groupId> + <artifactId>sapjco3</artifactId> + <version>${sapjco3-version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.sap.conn.idoc</groupId> + <artifactId>sapidoc3</artifactId> + <version>${sapidoc3-version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + <!--START OF GENERATED CODE--> + <dependency> + <groupId>org.apache.camel.springboot</groupId> + <artifactId>camel-core-starter</artifactId> + </dependency> + <!--END OF GENERATED CODE--> + </dependencies> + <build> + <defaultGoal>install</defaultGoal> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>3.0.1</version> + <executions> + <execution> + <id>attach-sources</id> + <phase>process-classes</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-jco-idoc-libs</id> + <phase>validate</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <stripVersion>true</stripVersion> + <outputDirectory>${lib.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>com.sap.conn.jco</groupId> + <artifactId>sapjco3</artifactId> + <overWrite>true</overWrite> + <destFileName>sapjco3.jar</destFileName> + </artifactItem> + <artifactItem> + <groupId>com.sap.conn.idoc</groupId> + <artifactId>sapidoc3</artifactId> + <overWrite>true</overWrite> + <destFileName>sapidoc3.jar</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement/> + </build> + <distributionManagement> + <repository> + <id>jboss-releases-repository</id> + <name>JBoss Releases Repository</name> + <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2</url> + </repository> + <snapshotRepository> + <id>jboss-snapshots-repository</id> + <name>JBoss Snapshots Repository</name> + <url>https://repository.jboss.org/nexus/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + <profiles> + <profile> + <id>regen</id> + <build> + <plugins> + <plugin> + <!-- This is copy-pasted from the components-starter pom. Ideally this should be inherited like the other + starters. + --> + <groupId>org.apache.camel.springboot</groupId> + <artifactId>camel-spring-boot-generator-maven-plugin</artifactId> + <version>${project.version}</version> + <configuration> + <!-- set to true to make build fail fast if missing documentation in docs files --> + <failFast>false</failFast> + <!-- set to true to make build fail if an option has no description --> + <failOnMissingDescription>false</failOnMissingDescription> + </configuration> + <executions> + <execution> + <id>generate</id> + <goals> + <goal>prepare-spring-boot-starter</goal> + <goal>prepare-spring-boot-auto-configuration</goal> + <goal>prepare-catalog-springboot</goal> + </goals> + <phase>generate-resources</phase> + </execution> + <execution> + <id>readme</id> + <goals> + <goal>update-spring-boot-auto-configuration-readme</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + </plugin> + <!-- This is somehow needed by the camel-spring-boot-generator-maven-plugin that is trying to resolve camel-sap's system path dependencies. Needs to be investigated further.--> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-jco-idoc-libs-system-path</id> + <phase>validate</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <stripVersion>true</stripVersion> + <outputDirectory>/tmp/fuse-components-3.20.1/camel-sap/camel-sap-component/target/lib</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>com.sap.conn.jco</groupId> + <artifactId>sapjco3</artifactId> + <overWrite>true</overWrite> + <destFileName>sapjco3.jar</destFileName> + </artifactItem> + <artifactItem> + <groupId>com.sap.conn.idoc</groupId> + <artifactId>sapidoc3</artifactId> + <overWrite>true</overWrite> + <destFileName>sapidoc3.jar</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <!--START OF GENERATED CODE--> + <repositories> + <repository> + <id>fusesource-third-party-internal</id> + <url>https://repository.jboss.org/nexus/content/repositories/fs-releases/</url> + <layout>default</layout> + <snapshots> + <enabled>true</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + </releases> + </repository> + <repository> + <id>brewroot</id> + <name>Brew Repository</name> + <url>http://download.eng.bos.redhat.com/brewroot/repos/jb-fuse-6.2-build/latest/maven</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + <updatePolicy>never</updatePolicy> + </releases> + </repository> + <repository> + <id>jboss-ea</id> + <name>Fuse Early Access Repository</name> + <url>https://repository.jboss.org/nexus/content/groups/ea</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + </releases> + </repository> + <repository> + <id>redhat-ga-repository</id> + <url>https://maven.repository.redhat.com/ga</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <!--END OF GENERATED CODE--> +</project> diff --git a/sap/camel-sap-starter/src/main/java/META-INF/MANIFEST.MF b/sap/camel-sap-starter/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..5e9495128c0 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentAutoConfiguration.java new file mode 100644 index 00000000000..aea1b53d3dd --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapClearCacheComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapClearCacheComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-clear-cache"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapClearCacheComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapClearCacheComponentConfiguration configuration; + + public SapClearCacheComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapClearCacheComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-clear-cache.customizer") + && target instanceof SapClearCacheComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentConfiguration.java new file mode 100644 index 00000000000..3d7278053d2 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapClearCacheComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing an endpoint to clear meta-data from JCo Repository + * and Data Layer. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-clear-cache") +public class SapClearCacheComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-clear-cache component. + * This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionAutoConfiguration.java new file mode 100644 index 00000000000..dc080cf9bf0 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionAutoConfiguration.java @@ -0,0 +1,241 @@ +package org.fusesource.camel.component.sap.springboot; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.camel.CamelContext; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.GroupCondition; +import org.apache.camel.spi.BeanIntrospection; +import org.apache.camel.support.PluginHelper; +import org.fusesource.camel.component.sap.model.rfc.DataType; +import org.fusesource.camel.component.sap.model.rfc.impl.AbapExceptionImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.DestinationDataImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.FieldMetaDataImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.FunctionTemplateImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.ListFieldMetaDataImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.RecordMetaDataImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.RepositoryDataImpl; +import org.fusesource.camel.component.sap.model.rfc.impl.ServerDataImpl; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.AbapException; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.DestinationData; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.FieldMetaData; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.FunctionTemplate; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.ListFieldMetaData; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.RecordMetaData; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.RepositoryData; +import org.fusesource.camel.component.sap.springboot.SapConnectionConfiguration.SapConnectionConfigurationNestedConfiguration.ServerData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; +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.Conditional; +import org.springframework.context.annotation.Configuration; + +@Configuration +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SapConnectionAutoConfiguration.GroupConditions.class}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +@AutoConfigureBefore({ + org.fusesource.camel.component.sap.SapSynchronousRfcDestinationComponent.class, + org.fusesource.camel.component.sap.SapTransactionalRfcDestinationComponent.class, + org.fusesource.camel.component.sap.SapQueuedRfcDestinationComponent.class, + org.fusesource.camel.component.sap.SapSynchronousRfcServerComponent.class, + org.fusesource.camel.component.sap.SapTransactionalRfcServerComponent.class, + org.fusesource.camel.component.sap.SapTransactionalIDocDestinationComponent.class, + org.fusesource.camel.component.sap.SapTransactionalIDocListDestinationComponent.class, + org.fusesource.camel.component.sap.SapQueuedIDocDestinationComponent.class, + org.fusesource.camel.component.sap.SapQueuedIDocListDestinationComponent.class, + org.fusesource.camel.component.sap.SapTransactionalIDocListServerComponent.class + }) +@EnableConfigurationProperties({ComponentConfigurationProperties.class, + SapConnectionConfiguration.class}) +public class SapConnectionAutoConfiguration { + @Autowired + private CamelContext camelContext; + @Autowired + private SapConnectionConfiguration configuration; + + static class GroupConditions extends GroupCondition { + public GroupConditions() { + super("camel.component", "camel.component.sap"); + } + } + + @Bean(name = "sap-connection-configuration") + @ConditionalOnMissingBean(org.fusesource.camel.component.sap.SapConnectionConfiguration.class) + public org.fusesource.camel.component.sap.SapConnectionConfiguration configureSapConnectionConfiguration() throws Exception { + org.fusesource.camel.component.sap.SapConnectionConfiguration configuration = new org.fusesource.camel.component.sap.SapConnectionConfiguration(); + + if (this.configuration.getConfiguration() != null) { + Map<String, DestinationData> destinationsData = this.configuration.getConfiguration() + .getDestinationDataStore(); + if (destinationsData != null) { + for (Entry<String, DestinationData> entry : destinationsData.entrySet()) { + DestinationDataImpl destinationData = new DestinationDataImpl(); + + Map<String, Object> parameters = new HashMap<String, Object>(); + + BeanIntrospection bi = PluginHelper.getBeanIntrospection(camelContext); + CamelPropertiesHelper.setCamelProperties(camelContext, destinationsData, parameters, false); + + configuration.getDestinationDataStore().put(entry.getKey(), destinationData); + } + } + + Map<String, ServerData> serversData = this.configuration.getConfiguration().getServerDataStore(); + if (serversData != null) { + for (Entry<String, ServerData> entry : serversData.entrySet()) { + ServerDataImpl serverData = new ServerDataImpl(); + + Map<String, Object> parameters = new HashMap<String, Object>(); + BeanIntrospection bi = PluginHelper.getBeanIntrospection(camelContext); + CamelPropertiesHelper.setCamelProperties(camelContext, serverData, parameters, false); + configuration.getServerDataStore().put(entry.getKey(), serverData); + } + } + + Map<String, RepositoryData> repositoriesData = this.configuration.getConfiguration().getRepositoryDataStore(); + if (repositoriesData != null) { + for (Entry<String, RepositoryData> entry : repositoriesData.entrySet()) { + RepositoryDataImpl respositoryData = new RepositoryDataImpl(); + + Map<String, FunctionTemplate> functionTemplates = entry.getValue().getFunctionTemplates(); + for (Entry<String,FunctionTemplate> functionTemplateEntry : functionTemplates.entrySet() ) { + FunctionTemplateImpl functionTemplate = new FunctionTemplateImpl(); + + if (functionTemplateEntry.getValue().getImportParameterList() != null) { + for (ListFieldMetaData importParameterEntry : functionTemplateEntry.getValue() + .getImportParameterList()) { + + ListFieldMetaDataImpl importParameter = configureListFieldMetaData( + importParameterEntry); + + functionTemplate.getImportParameterList().add(importParameter); + } + } + + if (functionTemplateEntry.getValue().getExportParameterList() != null) { + for (ListFieldMetaData exportParameterEntry : functionTemplateEntry.getValue() + .getExportParameterList()) { + + ListFieldMetaDataImpl exportParameter = configureListFieldMetaData( + exportParameterEntry); + + functionTemplate.getExportParameterList().add(exportParameter); + } + } + + if (functionTemplateEntry.getValue().getChangingParameterList() != null) { + for (ListFieldMetaData changingParameterEntry : functionTemplateEntry.getValue() + .getChangingParameterList()) { + + ListFieldMetaDataImpl changingParameter = configureListFieldMetaData( + changingParameterEntry); + + functionTemplate.getChangingParameterList().add(changingParameter); + } + } + + if (functionTemplateEntry.getValue().getTableParameterList() != null) { + for (ListFieldMetaData tableParameterEntry : functionTemplateEntry.getValue() + .getTableParameterList()) { + + ListFieldMetaDataImpl tableParameter = configureListFieldMetaData( + tableParameterEntry); + + functionTemplate.getTableParameterList().add(tableParameter); + } + } + + + if (functionTemplateEntry.getValue().getExceptionList() != null) { + for (AbapException abapExceptionEntry : functionTemplateEntry.getValue() + .getExceptionList()) { + + AbapExceptionImpl abapException = new AbapExceptionImpl(); + abapException.setKey(abapExceptionEntry.getKey()); + abapException.setMessage(abapExceptionEntry.getMessage()); + + functionTemplate.getExceptionList().add(abapException); + } + } + + + respositoryData.getFunctionTemplates().put(functionTemplateEntry.getKey(), functionTemplate); + } + + configuration.getRepositoryDataStore().put(entry.getKey(), respositoryData); + } + } + } + return configuration; + } + + private ListFieldMetaDataImpl configureListFieldMetaData(ListFieldMetaData listFieldMetaData) { + + ListFieldMetaDataImpl configuration = new ListFieldMetaDataImpl(); + + configuration.setName(listFieldMetaData.getName()); + configuration.setDescription(listFieldMetaData.getDescription()); + configuration.setType(DataType.getByName(listFieldMetaData.getType())); + configuration.setOptional(listFieldMetaData.isOptional()); + configuration.setImport(listFieldMetaData.isImport()); + configuration.setExport(listFieldMetaData.isExport()); + configuration.setChanging(listFieldMetaData.isChanging()); + configuration.setException(listFieldMetaData.isException()); + configuration.setDefaults(listFieldMetaData.getDefaults()); + configuration.setDecimals(listFieldMetaData.getDecimals()); + configuration.setByteLength(listFieldMetaData.getByteLength()); + configuration.setUnicodeByteLength(listFieldMetaData.getUnicodeByteLength()); + + if (listFieldMetaData.getRecordMetaData() != null) { + RecordMetaDataImpl recordMetaData = configureRecordMetaData(listFieldMetaData.getRecordMetaData()); + configuration.setRecordMetaData(recordMetaData); + } + + return configuration; + } + + private RecordMetaDataImpl configureRecordMetaData(RecordMetaData recordMetaData) { + RecordMetaDataImpl configuration = new RecordMetaDataImpl(); + + configuration.setName(recordMetaData.getName()); + + if (recordMetaData.getRecordFieldMetaData() != null) { + for (FieldMetaData fieldMetaData : recordMetaData.getRecordFieldMetaData()) { + FieldMetaDataImpl recordFieldMetaData = configureFieldMetaData(fieldMetaData); + configuration.getFieldMetaData().add(recordFieldMetaData); + } + } + + return configuration; + } + + private FieldMetaDataImpl configureFieldMetaData(FieldMetaData fieldMetaData) { + FieldMetaDataImpl configuration = new FieldMetaDataImpl(); + + configuration.setName(fieldMetaData.getName()); + configuration.setDescription(fieldMetaData.getDescription()); + configuration.setType(DataType.getByName(fieldMetaData.getType())); + configuration.setDecimals(fieldMetaData.getDecimals()); + configuration.setByteLength(fieldMetaData.getByteLength()); + configuration.setByteOffset(fieldMetaData.getByteOffset()); + configuration.setUnicodeByteLength(fieldMetaData.getUnicodeByteLength()); + configuration.setUnicodeByteOffset(fieldMetaData.getUnicodeByteOffset()); + + if (fieldMetaData.getRecordMetaData() != null) { + RecordMetaDataImpl recordMetaData = configureRecordMetaData(fieldMetaData.getRecordMetaData()); + configuration.setRecordMetaData(recordMetaData); + } + + return configuration; + } + +} diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionConfiguration.java new file mode 100644 index 00000000000..085371160f7 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapConnectionConfiguration.java @@ -0,0 +1,959 @@ +package org.fusesource.camel.component.sap.springboot; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@ConfigurationProperties(prefix = "camel.component.sap") +public class SapConnectionConfiguration extends ComponentConfigurationPropertiesCommon { + + /** + * To use the shared configuration + */ + private SapConnectionConfigurationNestedConfiguration configuration; + + /** + * Whether the component should resolve property placeholders on itself when + * starting. Only properties which are of String type can use property + * placeholders. + */ + private Boolean resolvePropertyPlaceholders = true; + + public SapConnectionConfigurationNestedConfiguration getConfiguration() { + return configuration; + } + + public void setConfiguration(SapConnectionConfigurationNestedConfiguration configuration) { + this.configuration = configuration; + } + + public Boolean getResolvePropertyPlaceholders() { + return resolvePropertyPlaceholders; + } + + public void setResolvePropertyPlaceholders(Boolean resolvePropertyPlaceholders) { + this.resolvePropertyPlaceholders = resolvePropertyPlaceholders; + } + + @Configuration + public static class SapConnectionConfigurationNestedConfiguration { + private Map<String, DestinationData> destinationDataStore = new HashMap<String, DestinationData>(); + private Map<String, ServerData> serverDataStore = new HashMap<String, ServerData>(); + private Map<String, RepositoryData> repositoryDataStore = new HashMap<String, RepositoryData>(); + + public Map<String, DestinationData> getDestinationDataStore() { + return destinationDataStore; + } + + public void setDestinationDataStore(Map<String, DestinationData> destinationDataStore) { + this.destinationDataStore = destinationDataStore; + } + + public Map<String, ServerData> getServerDataStore() { + return serverDataStore; + } + + public void setServerDataStore(Map<String, ServerData> serverDataStore) { + this.serverDataStore = serverDataStore; + } + + public Map<String, RepositoryData> getRepositoryDataStore() { + return repositoryDataStore; + } + + public void setRepositoryDataStore(Map<String, RepositoryData> repositoryDataStore) { + this.repositoryDataStore = repositoryDataStore; + } + + public static class DestinationData { + private String aliasUser; + private String ashost; + private String authType; + private String client; + private String codepage; + private String cpicTrace; + private String denyInitialPassword; + private String expirationPeriod; + private String expirationTime; + private String getsso2; + private String group; + private String gwhost; + private String gwserv; + private String lang; + private String lcheck; + private String maxGetTime; + private String mshost; + private String msserv; + private String mysapsso2; + private String passwd; + private String password; + private String pcs; + private String peakLimit; + private String pingOnCreate; + private String poolCapacity; + private String r3name; + private String repositoryDest; + private String repositoryPasswd; + private String repositoryRoundtripOptimization; + private String repositorySnc; + private String repositoryUser; + private String saprouter; + private String sncLibrary; + private String sncMode; + private String sncMyname; + private String sncPartnername; + private String sncQop; + private String sysnr; + private String tphost; + private String tpname; + private String trace; + private String type; + private String userName; + private String user; + private String userId; + private String useSapgui; + private String x509cert; + + public String getAliasUser() { + return aliasUser; + } + + public void setAliasUser(String aliasUser) { + this.aliasUser = aliasUser; + } + + public String getAshost() { + return ashost; + } + + public void setAshost(String ashost) { + this.ashost = ashost; + } + + public String getAuthType() { + return authType; + } + + public void setAuthType(String authType) { + this.authType = authType; + } + + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + public String getCodepage() { + return codepage; + } + + public void setCodepage(String codepage) { + this.codepage = codepage; + } + + public String getCpicTrace() { + return cpicTrace; + } + + public void setCpicTrace(String cpicTrace) { + this.cpicTrace = cpicTrace; + } + + public String getDenyInitialPassword() { + return denyInitialPassword; + } + + public void setDenyInitialPassword(String denyInitialPassword) { + this.denyInitialPassword = denyInitialPassword; + } + + public String getExpirationPeriod() { + return expirationPeriod; + } + + public void setExpirationPeriod(String expirationPeriod) { + this.expirationPeriod = expirationPeriod; + } + + public String getExpirationTime() { + return expirationTime; + } + + public void setExpirationTime(String expirationTime) { + this.expirationTime = expirationTime; + } + + public String getGetsso2() { + return getsso2; + } + + public void setGetsso2(String getsso2) { + this.getsso2 = getsso2; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getGwhost() { + return gwhost; + } + + public void setGwhost(String gwhost) { + this.gwhost = gwhost; + } + + public String getGwserv() { + return gwserv; + } + + public void setGwserv(String gwserv) { + this.gwserv = gwserv; + } + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public String getLcheck() { + return lcheck; + } + + public void setLcheck(String lcheck) { + this.lcheck = lcheck; + } + + public String getMaxGetTime() { + return maxGetTime; + } + + public void setMaxGetTime(String maxGetTime) { + this.maxGetTime = maxGetTime; + } + + public String getMshost() { + return mshost; + } + + public void setMshost(String mshost) { + this.mshost = mshost; + } + + public String getMsserv() { + return msserv; + } + + public void setMsserv(String msserv) { + this.msserv = msserv; + } + + public String getMysapsso2() { + return mysapsso2; + } + + public void setMysapsso2(String mysapsso2) { + this.mysapsso2 = mysapsso2; + } + + public String getPasswd() { + return passwd; + } + + public void setPasswd(String passwd) { + this.passwd = passwd; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getPcs() { + return pcs; + } + + public void setPcs(String pcs) { + this.pcs = pcs; + } + + public String getPeakLimit() { + return peakLimit; + } + + public void setPeakLimit(String peakLimit) { + this.peakLimit = peakLimit; + } + + public String getPingOnCreate() { + return pingOnCreate; + } + + public void setPingOnCreate(String pingOnCreate) { + this.pingOnCreate = pingOnCreate; + } + + public String getPoolCapacity() { + return poolCapacity; + } + + public void setPoolCapacity(String poolCapacity) { + this.poolCapacity = poolCapacity; + } + + public String getR3name() { + return r3name; + } + + public void setR3name(String r3name) { + this.r3name = r3name; + } + + public String getRepositoryDest() { + return repositoryDest; + } + + public void setRepositoryDest(String repositoryDest) { + this.repositoryDest = repositoryDest; + } + + public String getRepositoryPasswd() { + return repositoryPasswd; + } + + public void setRepositoryPasswd(String repositoryPasswd) { + this.repositoryPasswd = repositoryPasswd; + } + + public String getRepositoryRoundtripOptimization() { + return repositoryRoundtripOptimization; + } + + public void setRepositoryRoundtripOptimization(String repositoryRoundtripOptimization) { + this.repositoryRoundtripOptimization = repositoryRoundtripOptimization; + } + + public String getRepositorySnc() { + return repositorySnc; + } + + public void setRepositorySnc(String repositorySnc) { + this.repositorySnc = repositorySnc; + } + + public String getRepositoryUser() { + return repositoryUser; + } + + public void setRepositoryUser(String repositoryUser) { + this.repositoryUser = repositoryUser; + } + + public String getSaprouter() { + return saprouter; + } + + public void setSaprouter(String saprouter) { + this.saprouter = saprouter; + } + + public String getSncLibrary() { + return sncLibrary; + } + + public void setSncLibrary(String sncLibrary) { + this.sncLibrary = sncLibrary; + } + + public String getSncMode() { + return sncMode; + } + + public void setSncMode(String sncMode) { + this.sncMode = sncMode; + } + + public String getSncMyname() { + return sncMyname; + } + + public void setSncMyname(String sncMyname) { + this.sncMyname = sncMyname; + } + + public String getSncPartnername() { + return sncPartnername; + } + + public void setSncPartnername(String sncPartnername) { + this.sncPartnername = sncPartnername; + } + + public String getSncQop() { + return sncQop; + } + + public void setSncQop(String sncQop) { + this.sncQop = sncQop; + } + + public String getSysnr() { + return sysnr; + } + + public void setSysnr(String sysnr) { + this.sysnr = sysnr; + } + + public String getTphost() { + return tphost; + } + + public void setTphost(String tphost) { + this.tphost = tphost; + } + + public String getTpname() { + return tpname; + } + + public void setTpname(String tpname) { + this.tpname = tpname; + } + + public String getTrace() { + return trace; + } + + public void setTrace(String trace) { + this.trace = trace; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUseSapgui() { + return useSapgui; + } + + public void setUseSapgui(String useSapgui) { + this.useSapgui = useSapgui; + } + + public String getX509cert() { + return x509cert; + } + + public void setX509cert(String x509cert) { + this.x509cert = x509cert; + } + + } + + public static class ServerData { + private String gwhost; + private String gwserv; + private String progid; + private String connectionCount; + private String saprouter; + private String maxStartUpDelay; + private String repositoryDestination; + private String repositoryMap; + private String trace; + private String workerThreadCount; + private String workerThreadMinCount; + private String sncMode; + private String sncQop; + private String sncMyname; + private String sncLib; + + public String getGwhost() { + return gwhost; + } + + public void setGwhost(String gwhost) { + this.gwhost = gwhost; + } + + public String getGwserv() { + return gwserv; + } + + public void setGwserv(String gwserv) { + this.gwserv = gwserv; + } + + public String getProgid() { + return progid; + } + + public void setProgid(String progid) { + this.progid = progid; + } + + public String getConnectionCount() { + return connectionCount; + } + + public void setConnectionCount(String connectionCount) { + this.connectionCount = connectionCount; + } + + public String getSaprouter() { + return saprouter; + } + + public void setSaprouter(String saprouter) { + this.saprouter = saprouter; + } + + public String getMaxStartUpDelay() { + return maxStartUpDelay; + } + + public void setMaxStartUpDelay(String maxStartUpDelay) { + this.maxStartUpDelay = maxStartUpDelay; + } + + public String getRepositoryDestination() { + return repositoryDestination; + } + + public void setRepositoryDestination(String repositoryDestination) { + this.repositoryDestination = repositoryDestination; + } + + public String getRepositoryMap() { + return repositoryMap; + } + + public void setRepositoryMap(String repositoryMap) { + this.repositoryMap = repositoryMap; + } + + public String getTrace() { + return trace; + } + + public void setTrace(String trace) { + this.trace = trace; + } + + public String getWorkerThreadCount() { + return workerThreadCount; + } + + public void setWorkerThreadCount(String workerThreadCount) { + this.workerThreadCount = workerThreadCount; + } + + public String getWorkerThreadMinCount() { + return workerThreadMinCount; + } + + public void setWorkerThreadMinCount(String workerThreadMinCount) { + this.workerThreadMinCount = workerThreadMinCount; + } + + public String getSncMode() { + return sncMode; + } + + public void setSncMode(String sncMode) { + this.sncMode = sncMode; + } + + public String getSncQop() { + return sncQop; + } + + public void setSncQop(String sncQop) { + this.sncQop = sncQop; + } + + public String getSncMyname() { + return sncMyname; + } + + public void setSncMyname(String sncMyname) { + this.sncMyname = sncMyname; + } + + public String getSncLib() { + return sncLib; + } + + public void setSncLib(String sncLib) { + this.sncLib = sncLib; + } + } + + public static class RepositoryData { + + private Map<String, FunctionTemplate> functionTemplates; + + public Map<String, FunctionTemplate> getFunctionTemplates() { + return functionTemplates; + } + + public void setFunctionTemplates(Map<String, FunctionTemplate> functionTemplates) { + this.functionTemplates = functionTemplates; + } + + } + + public static class FunctionTemplate { + + private List<ListFieldMetaData> importParameterList; + private List<ListFieldMetaData> exportParameterList; + private List<ListFieldMetaData> changingParameterList; + private List<ListFieldMetaData> tableParameterList; + private List<AbapException> exceptionList; + + public List<ListFieldMetaData> getImportParameterList() { + return importParameterList; + } + + public void setImportParameterList(List<ListFieldMetaData> importParameterList) { + this.importParameterList = importParameterList; + } + + public List<ListFieldMetaData> getExportParameterList() { + return exportParameterList; + } + + public void setExportParameterList(List<ListFieldMetaData> exportParameterList) { + this.exportParameterList = exportParameterList; + } + + public List<ListFieldMetaData> getChangingParameterList() { + return changingParameterList; + } + + public void setChangingParameterList(List<ListFieldMetaData> changingParameterList) { + this.changingParameterList = changingParameterList; + } + + public List<ListFieldMetaData> getTableParameterList() { + return tableParameterList; + } + + public void setTableParameterList(List<ListFieldMetaData> tableParameterList) { + this.tableParameterList = tableParameterList; + } + + public List<AbapException> getExceptionList() { + return exceptionList; + } + + public void setExceptionList(List<AbapException> exceptionList) { + this.exceptionList = exceptionList; + } + + } + + public static class AbapException { + + private String key; + private String message; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + } + + public static class ListFieldMetaData { + + private String name; + private String description; + private String type; + private boolean export; + private boolean import_; + private boolean changing; + private boolean exception; + private boolean optional; + private String defaults; + private int decimals; + private int byteLength; + private int unicodeByteLength; + + private RecordMetaData recordMetaData; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public boolean isExport() { + return export; + } + + public void setExport(boolean export) { + this.export = export; + } + + public boolean isImport() { + return import_; + } + + public void setImport(boolean import_) { + this.import_ = import_; + } + + public boolean isChanging() { + return changing; + } + + public void setChanging(boolean changing) { + this.changing = changing; + } + + public boolean isException() { + return exception; + } + + public void setException(boolean exception) { + this.exception = exception; + } + + public boolean isOptional() { + return optional; + } + + public void setOptional(boolean optional) { + this.optional = optional; + } + + public String getDefaults() { + return defaults; + } + + public void setDefaults(String defaults) { + this.defaults = defaults; + } + + public int getDecimals() { + return decimals; + } + + public void setDecimals(int decimals) { + this.decimals = decimals; + } + + public int getByteLength() { + return byteLength; + } + + public void setByteLength(int byteLength) { + this.byteLength = byteLength; + } + + public int getUnicodeByteLength() { + return unicodeByteLength; + } + + public void setUnicodeByteLength(int unicodeByteLength) { + this.unicodeByteLength = unicodeByteLength; + } + + public RecordMetaData getRecordMetaData() { + return recordMetaData; + } + + public void setRecordMetaData(RecordMetaData recordMetaData) { + this.recordMetaData = recordMetaData; + } + + } + + public static class FieldMetaData { + + private String name; + private String description; + private String type; + private int decimals; + private int byteLength; + private int byteOffset; + private int unicodeByteLength; + private int unicodeByteOffset; + + private RecordMetaData recordMetaData; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getDecimals() { + return decimals; + } + + public void setDecimals(int decimals) { + this.decimals = decimals; + } + + public int getByteLength() { + return byteLength; + } + + public void setByteLength(int byteLength) { + this.byteLength = byteLength; + } + + public int getByteOffset() { + return byteOffset; + } + + public void setByteOffset(int byteOffset) { + this.byteOffset = byteOffset; + } + + public int getUnicodeByteLength() { + return unicodeByteLength; + } + + public void setUnicodeByteLength(int unicodeByteLength) { + this.unicodeByteLength = unicodeByteLength; + } + + public int getUnicodeByteOffset() { + return unicodeByteOffset; + } + + public void setUnicodeByteOffset(int unicodeByteOffset) { + this.unicodeByteOffset = unicodeByteOffset; + } + + public RecordMetaData getRecordMetaData() { + return recordMetaData; + } + + public void setRecordMetaData(RecordMetaData recordMetaData) { + this.recordMetaData = recordMetaData; + } + + } + + public static class RecordMetaData { + + private String name; + private List<FieldMetaData> recordFieldMetaData; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List<FieldMetaData> getRecordFieldMetaData() { + return recordFieldMetaData; + } + + public void setRecordFieldMetaData(List<FieldMetaData> recordFieldMetaData) { + this.recordFieldMetaData = recordFieldMetaData; + } + + } + + } + +} diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..dedd535e3b1 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapQueuedIDocDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapQueuedIDocDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-qidoc-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapQueuedIDocDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapQueuedIDocDestinationComponentConfiguration configuration; + + public SapQueuedIDocDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapQueuedIDocDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-qidoc-destination.customizer") + && target instanceof SapQueuedIDocDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentConfiguration.java new file mode 100644 index 00000000000..14e781f0b2e --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Represents an SAP endpoint sending a IDoc (Intermediary Document) to an SAP + * system using the queued remote function call. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-qidoc-destination") +public class SapQueuedIDocDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-qidoc-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..e9225e2e1c4 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapQueuedIDocListDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapQueuedIDocListDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-qidoclist-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapQueuedIDocListDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapQueuedIDocListDestinationComponentConfiguration configuration; + + public SapQueuedIDocListDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapQueuedIDocListDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-qidoclist-destination.customizer") + && target instanceof SapQueuedIDocListDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentConfiguration.java new file mode 100644 index 00000000000..7e03a154b60 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedIDocListDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Represents an SAP endpoint sending a IDoc (Intermediary Document) to an SAP + * system using the queued remote function call. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-qidoclist-destination") +public class SapQueuedIDocListDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-qidoclist-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..962b1aa70f1 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapQueuedRfcDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapQueuedRfcDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-qrfc-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapQueuedRfcDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapQueuedRfcDestinationComponentConfiguration configuration; + + public SapQueuedRfcDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapQueuedRfcDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-qrfc-destination.customizer") + && target instanceof SapQueuedRfcDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentConfiguration.java new file mode 100644 index 00000000000..da6edec6612 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapQueuedRfcDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing outbound tRFC (Transactional Remote Function Call) + * communication to SAP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-qrfc-destination") +public class SapQueuedRfcDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-qrfc-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..2774b973d86 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapSynchronousRfcDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapSynchronousRfcDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-srfc-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapSynchronousRfcDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapSynchronousRfcDestinationComponentConfiguration configuration; + + public SapSynchronousRfcDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapSynchronousRfcDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-srfc-destination.customizer") + && target instanceof SapSynchronousRfcDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentConfiguration.java new file mode 100644 index 00000000000..d1b80c537cc --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing outbound sRFC (Synchronous Remote Function Call) + * communication to SAP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-srfc-destination") +public class SapSynchronousRfcDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-srfc-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentAutoConfiguration.java new file mode 100644 index 00000000000..0ec29e6911d --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapSynchronousRfcServerComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapSynchronousRfcServerComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-srfc-server"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapSynchronousRfcServerComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapSynchronousRfcServerComponentConfiguration configuration; + + public SapSynchronousRfcServerComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapSynchronousRfcServerComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-srfc-server.customizer") + && target instanceof SapSynchronousRfcServerComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentConfiguration.java new file mode 100644 index 00000000000..f67b9844e9e --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapSynchronousRfcServerComponentConfiguration.java @@ -0,0 +1,56 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing inbound sRFC (Synchronous Remote Function Call) + * communication from SAP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-srfc-server") +public class SapSynchronousRfcServerComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-srfc-server component. + * This is enabled by default. + */ + private Boolean enabled; + /** + * Allows for bridging the consumer to the Camel routing Error Handler, + * which mean any exceptions occurred while the consumer is trying to pickup + * incoming messages, or the likes, will now be processed as a message and + * handled by the routing Error Handler. By default the consumer will use + * the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that + * will be logged at WARN or ERROR level and ignored. + */ + private Boolean bridgeErrorHandler = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getBridgeErrorHandler() { + return bridgeErrorHandler; + } + + public void setBridgeErrorHandler(Boolean bridgeErrorHandler) { + this.bridgeErrorHandler = bridgeErrorHandler; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..7b118d2b9fa --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapTransactionalIDocDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapTransactionalIDocDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-idoc-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapTransactionalIDocDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapTransactionalIDocDestinationComponentConfiguration configuration; + + public SapTransactionalIDocDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapTransactionalIDocDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-idoc-destination.customizer") + && target instanceof SapTransactionalIDocDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentConfiguration.java new file mode 100644 index 00000000000..e9a568f2ecd --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint sending a IDoc (Intermediary Document) to an SAP system using + * transactional remote function calls (tRFC). + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-idoc-destination") +public class SapTransactionalIDocDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-idoc-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..65246db1f66 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapTransactionalIDocListDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapTransactionalIDocListDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-idoclist-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapTransactionalIDocListDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapTransactionalIDocListDestinationComponentConfiguration configuration; + + public SapTransactionalIDocListDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapTransactionalIDocListDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-idoclist-destination.customizer") + && target instanceof SapTransactionalIDocListDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentConfiguration.java new file mode 100644 index 00000000000..3fc2e6f4bac --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint sending a IDoc (Intermediary Document) to an SAP system using + * transactional remote function calls (tRFC). + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-idoclist-destination") +public class SapTransactionalIDocListDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-idoclist-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentAutoConfiguration.java new file mode 100644 index 00000000000..e6ac6a769dd --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapTransactionalIDocListServerComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapTransactionalIDocListServerComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-idoclist-server"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapTransactionalIDocListServerComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapTransactionalIDocListServerComponentConfiguration configuration; + + public SapTransactionalIDocListServerComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapTransactionalIDocListServerComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-idoclist-server.customizer") + && target instanceof SapTransactionalIDocListServerComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentConfiguration.java new file mode 100644 index 00000000000..9f6b6bcad85 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalIDocListServerComponentConfiguration.java @@ -0,0 +1,56 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint receiving an IDoc (Intermediate Document) list from an SAP + * system using transactional remote function calls (tRFC). + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-idoclist-server") +public class SapTransactionalIDocListServerComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-idoclist-server + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * Allows for bridging the consumer to the Camel routing Error Handler, + * which mean any exceptions occurred while the consumer is trying to pickup + * incoming messages, or the likes, will now be processed as a message and + * handled by the routing Error Handler. By default the consumer will use + * the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that + * will be logged at WARN or ERROR level and ignored. + */ + private Boolean bridgeErrorHandler = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getBridgeErrorHandler() { + return bridgeErrorHandler; + } + + public void setBridgeErrorHandler(Boolean bridgeErrorHandler) { + this.bridgeErrorHandler = bridgeErrorHandler; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentAutoConfiguration.java new file mode 100644 index 00000000000..ccd8003bd3e --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapTransactionalRfcDestinationComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapTransactionalRfcDestinationComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-trfc-destination"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapTransactionalRfcDestinationComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapTransactionalRfcDestinationComponentConfiguration configuration; + + public SapTransactionalRfcDestinationComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapTransactionalRfcDestinationComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-trfc-destination.customizer") + && target instanceof SapTransactionalRfcDestinationComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentConfiguration.java new file mode 100644 index 00000000000..95b6a1355d4 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcDestinationComponentConfiguration.java @@ -0,0 +1,58 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing outbound tRFC (Transactional Remote Function Call) + * communication to SAP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-trfc-destination") +public class SapTransactionalRfcDestinationComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-trfc-destination + * component. This is enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean lazyStartProducer = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getLazyStartProducer() { + return lazyStartProducer; + } + + public void setLazyStartProducer(Boolean lazyStartProducer) { + this.lazyStartProducer = lazyStartProducer; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentAutoConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentAutoConfiguration.java new file mode 100644 index 00000000000..b3006d97b04 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentAutoConfiguration.java @@ -0,0 +1,61 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.spi.ComponentCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.fusesource.camel.component.sap.SapTransactionalRfcServerComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({ComponentConfigurationProperties.class,SapTransactionalRfcServerComponentConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.sap-trfc-server"}) +@AutoConfigureAfter(CamelAutoConfiguration.class) +public class SapTransactionalRfcServerComponentAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SapTransactionalRfcServerComponentConfiguration configuration; + + public SapTransactionalRfcServerComponentAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public ComponentCustomizer configureSapTransactionalRfcServerComponent() { + return new ComponentCustomizer() { + @Override + public void configure(String name, Component target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, Component target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.component.customizer", + "camel.component.sap-trfc-server.customizer") + && target instanceof SapTransactionalRfcServerComponent; + } + }; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentConfiguration.java b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentConfiguration.java new file mode 100644 index 00000000000..3a20bd20060 --- /dev/null +++ b/sap/camel-sap-starter/src/main/java/org/fusesource/camel/component/sap/springboot/SapTransactionalRfcServerComponentConfiguration.java @@ -0,0 +1,56 @@ +package org.fusesource.camel.component.sap.springboot; + +import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An SAP endpoint providing inbound tRFC (Transactional Remote Function Call) + * communication from SAP. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.sap-trfc-server") +public class SapTransactionalRfcServerComponentConfiguration + extends + ComponentConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the sap-trfc-server component. + * This is enabled by default. + */ + private Boolean enabled; + /** + * Allows for bridging the consumer to the Camel routing Error Handler, + * which mean any exceptions occurred while the consumer is trying to pickup + * incoming messages, or the likes, will now be processed as a message and + * handled by the routing Error Handler. By default the consumer will use + * the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that + * will be logged at WARN or ERROR level and ignored. + */ + private Boolean bridgeErrorHandler = false; + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, which + * then gets configured on the component. This can be used for automatic + * configuring JDBC data sources, JMS connection factories, AWS Clients, + * etc. + */ + private Boolean autowiredEnabled = true; + + public Boolean getBridgeErrorHandler() { + return bridgeErrorHandler; + } + + public void setBridgeErrorHandler(Boolean bridgeErrorHandler) { + this.bridgeErrorHandler = bridgeErrorHandler; + } + + public Boolean getAutowiredEnabled() { + return autowiredEnabled; + } + + public void setAutowiredEnabled(Boolean autowiredEnabled) { + this.autowiredEnabled = autowiredEnabled; + } +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sap/camel-sap-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..74d0c5f66b0 --- /dev/null +++ b/sap/camel-sap-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,10 @@ +{ + "properties": [ + { + "defaultValue": true, + "name": "camel.component.sap.enabled", + "description": "Enable SAP component", + "type": "java.lang.Boolean" + } + ] +} \ No newline at end of file diff --git a/sap/camel-sap-starter/src/main/resources/META-INF/spring.factories b/sap/camel-sap-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..87833dd7451 --- /dev/null +++ b/sap/camel-sap-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,40 @@ +## --------------------------------------------------------------------------- +## JBoss, Home of Professional Open Source +## Copyright 2017, Red Hat, Inc. and/or its affiliates, and individual +## contributors by the @authors tag. See the copyright.txt in the +## distribution for a full listing of individual contributors. +## +## Licensed 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.fusesource.camel.component.sap.springboot.SapConnectionAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapTransactionalRfcDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapSynchronousRfcDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapQueuedIDocListDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapQueuedIDocDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapTransactionalIDocListServerComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapQueuedRfcDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapSynchronousRfcServerComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapClearCacheComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapTransactionalIDocDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapTransactionalIDocListDestinationComponentAutoConfiguration,\ +org.fusesource.camel.component.sap.springboot.SapTransactionalRfcServerComponentAutoConfiguration + + + + + + + + + + + diff --git a/sap/camel-sap-starter/src/main/resources/META-INF/spring.provides b/sap/camel-sap-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 00000000000..7cbf6e77866 --- /dev/null +++ b/sap/camel-sap-starter/src/main/resources/META-INF/spring.provides @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## JBoss, Home of Professional Open Source +## Copyright 2017, Red Hat, Inc. and/or its affiliates, and individual +## contributors by the @authors tag. See the copyright.txt in the +## distribution for a full listing of individual contributors. +## +## Licensed 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. +## --------------------------------------------------------------------------- +provides: camel-sap diff --git a/sap/pom.xml b/sap/pom.xml new file mode 100644 index 00000000000..5db10b850ec --- /dev/null +++ b/sap/pom.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.springboot</groupId> + <artifactId>camel-starter-parent</artifactId> + <version>4.0.0-RC2-SNAPSHOT</version> + <relativePath>../tooling/camel-starter-parent</relativePath> + </parent> + <artifactId>camel-sap-starter-parent</artifactId> + <packaging>pom</packaging> + <name>Camel SB SAP Starters</name> + <description>Camel SAP Components Starter</description> + <dependencies> + </dependencies> + <build> + </build> + + <modules> + <module>camel-sap-starter</module> + </modules> +</project>
