Repository: camel Updated Branches: refs/heads/master cf77381a4 -> d25e9bcbc
CAMEL-11825: remove old clunky example that dont fit/work well in OSGi Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d25e9bcb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d25e9bcb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d25e9bcb Branch: refs/heads/master Commit: d25e9bcbc672a5d7f3730a83fda4f7b0dccf3479 Parents: cf77381 Author: Claus Ibsen <davscl...@apache.org> Authored: Tue Sep 26 16:55:19 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue Sep 26 16:55:19 2017 +0200 ---------------------------------------------------------------------- examples/camel-example-etl/README.md | 63 ------ examples/camel-example-etl/pom.xml | 193 ------------------ examples/camel-example-etl/src/data/row1.xml | 24 --- examples/camel-example-etl/src/data/row2.xml | 24 --- .../camel/example/etl/CustomerEntity.java | 118 ----------- .../camel/example/etl/CustomerTransformer.java | 94 --------- .../org/apache/camel/example/etl/EtlRoutes.java | 41 ---- .../java/org/apache/camel/example/etl/Main.java | 29 --- .../camel/example/etl/PersonDocument.java | 76 ------- .../src/main/resources/META-INF/LICENSE.txt | 203 ------------------- .../src/main/resources/META-INF/NOTICE.txt | 11 - .../src/main/resources/META-INF/persistence.xml | 33 --- .../services/org/apache/camel/TypeConverter | 18 -- .../resources/META-INF/spring/camel-context.xml | 52 ----- .../src/main/resources/features.xml | 34 ---- .../src/main/resources/log4j2.properties | 23 --- .../camel/example/etl/IntegrationTest.java | 31 --- examples/pom.xml | 1 - 18 files changed, 1068 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/README.md ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/README.md b/examples/camel-example-etl/README.md deleted file mode 100644 index bfc75cf..0000000 --- a/examples/camel-example-etl/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Extract Transform Load (ETL) Example - -### Introduction - -This example shows how to use Camel as an ETL tool. - -The ETL (Extract, Transform, Load) example shows how to load data into a database using Camel. -In this example we will poll for files, transform them and then store them in the database via the JPA component. - -### Build - -You will need to compile this example first: - - mvn compile - -### Run - -To run the example type - - mvn camel:run - -You can see the routing rules by looking at the java code in the src/main/java -directory and the Spring XML configuration lives in - `src/main/resources/META-INF/spring` - -To stop the example hit <kbd>ctrl</kbd>+<kbd>c</kbd> - -### Build and Run inside OSGi container - - -#### Build - -You will need to compile and install this example first: - - mvn install - -#### Install - -If using Apache Karaf / Apache ServiceMix you can install this example -from the shell using this example's "features.xml" for easy provisioning. - - feature:repo-add camel ${version} - feature:install camel - feature:repo-add mvn:org.apache.camel.example/camel-example-etl/${version}/xml/features - feature:install camel-example-etl - -The example outputs logs into the console. When you're done just hit <kbd>ctrl</kbd>+<kbd>d</kbd> -to exit the container. Next time you start the container again use the 'clean' option so that -this example's bundle gets removed and you don't see the logs anymore written into the console, -e.g. in case of Karaf start it again using: - - karaf clean - -### Forum, Help, etc - -If you hit an problems please let us know on the Camel Forums - <http://camel.apache.org/discussion-forums.html> - -Please help us make Apache Camel better - we appreciate any feedback you may -have. Enjoy! - - -The Camel riders! http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/pom.xml b/examples/camel-example-etl/pom.xml deleted file mode 100644 index 4e6d4eb..0000000 --- a/examples/camel-example-etl/pom.xml +++ /dev/null @@ -1,193 +0,0 @@ -<?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.example</groupId> - <artifactId>examples</artifactId> - <version>2.20.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-example-etl</artifactId> - <packaging>jar</packaging> - <name>Camel :: Example :: ETL</name> - <description>An example showing how to use Camel as an Extract Transform and Load (ETL) tool</description> - - <properties> - <category>EIP</category> - <title>ETL</title> - - <camel.osgi.export.pkg>org.apache.camel.example.etl.*</camel.osgi.export.pkg> - <!-- to avoid us import bunch other package --> - <camel.osgi.dynamic>*</camel.osgi.dynamic> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jpa</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jaxb</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-juel</artifactId> - </dependency> - <dependency> - <groupId>org.apache.openjpa</groupId> - <artifactId>openjpa</artifactId> - <version>${openjpa-version}</version> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - </dependency> - - <!-- logging --> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <scope>runtime</scope> - </dependency> - - <!-- testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <pluginManagement> - <plugins> - <!-- Eclipse m2e Lifecycle Management --> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>${lifecycle-mapping-version}</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.apache.openjpa</groupId> - <artifactId>openjpa-maven-plugin</artifactId> - <versionRange>${openjpa-version}</versionRange> - <goals> - <goal>enhance</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore/> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>attach-artifacts</id> - <phase>package</phase> - <goals> - <goal>attach-artifact</goal> - </goals> - <configuration> - <artifacts> - <artifact> - <file>target/classes/features.xml</file> - <type>xml</type> - <classifier>features</classifier> - </artifact> - </artifacts> - </configuration> - </execution> - </executions> - </plugin> - - <!-- Will enhance classes as we run in a non JEE env --> - <plugin> - <groupId>org.apache.openjpa</groupId> - <artifactId>openjpa-maven-plugin</artifactId> - <version>${openjpa-version}</version> - <configuration> - <persistenceXmlFile>${project.basedir}/src/main/resources/META-INF/persistence.xml</persistenceXmlFile> - <includes>org/apache/camel/example/etl/*Entity.class</includes> - <addDefaultConstructor>true</addDefaultConstructor> - <enforcePropertyRestrictions>true</enforcePropertyRestrictions> - </configuration> - <executions> - <execution> - <id>enhancer</id> - <phase>process-classes</phase> - <goals> - <goal>enhance</goal> - </goals> - </execution> - </executions> - </plugin> - - <!-- Allows the example to be run via 'mvn camel:run' --> - <plugin> - <groupId>org.apache.camel</groupId> - <artifactId>camel-maven-plugin</artifactId> - <version>${project.version}</version> - </plugin> - - <!-- Allows the example to be run via 'mvn compile exec:java' --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <mainClass>org.apache.camel.example.etl.Main</mainClass> - <includePluginDependencies>false</includePluginDependencies> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/data/row1.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/data/row1.xml b/examples/camel-example-etl/src/data/row1.xml deleted file mode 100644 index 1a85d06..0000000 --- a/examples/camel-example-etl/src/data/row1.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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. - ---> -<person user="james"> - <firstName>James</firstName> - <lastName>Strachan</lastName> - <city>London</city> -</person> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/data/row2.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/data/row2.xml b/examples/camel-example-etl/src/data/row2.xml deleted file mode 100644 index 73c88bf..0000000 --- a/examples/camel-example-etl/src/data/row2.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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. - ---> -<person user="hiram"> - <firstName>Hiram</firstName> - <lastName>Chirino</lastName> - <city>Tampa</city> -</person> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerEntity.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerEntity.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerEntity.java deleted file mode 100644 index c566fd9..0000000 --- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerEntity.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * An example entity bean which can be marshalled to/from XML - * - * @version - */ -@Entity(name = "customer") -@XmlRootElement(name = "customer") -@XmlAccessorType(XmlAccessType.FIELD) -@NamedQuery(name = "findCustomerByUsername", query = "SELECT c FROM customer c WHERE c.userName = :userName") -public class CustomerEntity { - @XmlAttribute - private Long id; - private String userName; - private String firstName; - private String surname; - private String street; - private String city; - private String zip; - private String phone; - - @Id - @GeneratedValue - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getSurname() { - return surname; - } - - public void setSurname(String surname) { - this.surname = surname; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - - public String toString() { - return "Customer[userName: " + getUserName() + " firstName: " + getFirstName() + " surname: " + getSurname() + "]"; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java deleted file mode 100644 index 505c783..0000000 --- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -import java.util.List; - -import javax.persistence.EntityManager; - -import org.apache.camel.Converter; -import org.apache.camel.Exchange; -import org.apache.camel.component.jpa.JpaConstants; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.transaction.TransactionStatus; -import org.springframework.transaction.support.TransactionCallback; -import org.springframework.transaction.support.TransactionTemplate; - -/** - * A Message Transformer of an XML document to a Customer entity bean - * - * @version - */ -// START SNIPPET: example -@Converter -public final class CustomerTransformer { - - private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class); - - private CustomerTransformer() { - } - - /** - * A transformation method to convert a person document into a customer - * entity - */ - @Converter - public static CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception { - EntityManager entityManager = exchange.getProperty(JpaConstants.ENTITY_MANAGER, EntityManager.class); - TransactionTemplate transactionTemplate = exchange.getContext().getRegistry().lookupByNameAndType("transactionTemplate", TransactionTemplate.class); - - String user = doc.getUser(); - CustomerEntity customer = findCustomerByName(transactionTemplate, entityManager, user); - - // let's convert information from the document into the entity bean - customer.setUserName(user); - customer.setFirstName(doc.getFirstName()); - customer.setSurname(doc.getLastName()); - customer.setCity(doc.getCity()); - - LOG.info("Created object customer: {}", customer); - return customer; - } - - /** - * Finds a customer for the given username - */ - private static CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, final String userName) throws Exception { - return transactionTemplate.execute(new TransactionCallback<CustomerEntity>() { - public CustomerEntity doInTransaction(TransactionStatus status) { - entityManager.joinTransaction(); - List<CustomerEntity> list = entityManager.createNamedQuery("findCustomerByUsername", CustomerEntity.class).setParameter("userName", userName).getResultList(); - CustomerEntity answer; - if (list.isEmpty()) { - answer = new CustomerEntity(); - answer.setUserName(userName); - LOG.info("Created a new CustomerEntity {} as no matching persisted entity found.", answer); - } else { - answer = list.get(0); - LOG.info("Found a matching CustomerEntity {} having the userName {}.", answer, userName); - } - - return answer; - } - }); - } - -} -// END SNIPPET: example http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java deleted file mode 100644 index b65953a..0000000 --- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -import org.apache.camel.Exchange; -import org.apache.camel.spring.SpringRouteBuilder; - -import static org.apache.camel.language.juel.JuelExpression.el; - -/** - * @version - */ -// START SNIPPET: example -public class EtlRoutes extends SpringRouteBuilder { - public void configure() throws Exception { - - from("file:src/data?noop=true") - .convertBodyTo(PersonDocument.class) - .to("jpa:org.apache.camel.example.etl.CustomerEntity"); - - // the following will dump the database to files - from("jpa:org.apache.camel.example.etl.CustomerEntity?consumer.initialDelay=3000&delay=3000&consumeDelete=false&consumeLockEntity=false") - .setHeader(Exchange.FILE_NAME, el("${in.body.userName}.xml")) - .to("file:target/customers"); - } -} -// END SNIPPET: example http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/Main.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/Main.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/Main.java deleted file mode 100644 index 5a537be..0000000 --- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/Main.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -/** - * A command line tool to run this example - * - * @version - */ -public class Main extends org.apache.camel.spring.Main { - - public static void main(String... args) throws Exception { - new Main().run(args); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/PersonDocument.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/PersonDocument.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/PersonDocument.java deleted file mode 100644 index 226eeb5..0000000 --- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/PersonDocument.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * @version - */ -@XmlRootElement(name = "person") -@XmlAccessorType(XmlAccessType.FIELD) -public class PersonDocument { - @XmlAttribute - private String user; - @XmlElement - private String firstName; - @XmlElement - private String lastName; - @XmlElement - private String city; - - @Override - public String toString() { - return "Person[user: " + user + "]"; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getUser() { - return user; - } - - public void setUser(String user) { - this.user = user; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-etl/src/main/resources/META-INF/LICENSE.txt deleted file mode 100755 index 6b0b127..0000000 --- a/examples/camel-example-etl/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-etl/src/main/resources/META-INF/NOTICE.txt deleted file mode 100644 index 2e215bf..0000000 --- a/examples/camel-example-etl/src/main/resources/META-INF/NOTICE.txt +++ /dev/null @@ -1,11 +0,0 @@ - ========================================================================= - == NOTICE file corresponding to the section 4 d of == - == the Apache License, Version 2.0, == - == in this case for the Apache Camel distribution. == - ========================================================================= - - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - - Please read the different LICENSE files present in the licenses directory of - this distribution. http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/META-INF/persistence.xml b/examples/camel-example-etl/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index b854fec..0000000 --- a/examples/camel-example-etl/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?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. - ---> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> - - <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL"> - <class>org.apache.camel.example.etl.CustomerEntity</class> - <properties> - <property name="openjpa.ConnectionURL" value="jdbc:derby:target/derby;create=true" /> - <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver" /> - <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" /> - <property name="openjpa.Log" value="DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=TRACE" /> - <property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72" /> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/META-INF/services/org/apache/camel/TypeConverter ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/META-INF/services/org/apache/camel/TypeConverter b/examples/camel-example-etl/src/main/resources/META-INF/services/org/apache/camel/TypeConverter deleted file mode 100644 index ee9c0fa..0000000 --- a/examples/camel-example-etl/src/main/resources/META-INF/services/org/apache/camel/TypeConverter +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -org.apache.camel.example.etl.CustomerTransformer \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml b/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml deleted file mode 100644 index 8aaa6c0..0000000 --- a/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?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. - ---> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camelContext id="camel" trace="true" xmlns="http://camel.apache.org/schema/spring"> - <package>org.apache.camel.example.etl</package> - </camelContext> - - <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"> - <property name="entityManagerFactory" ref="entityManagerFactory" /> - <property name="transactionManager" ref="transactionManager" /> - </bean> - - <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> - <property name="persistenceUnitName" value="camel" /> - <property name="jpaVendorAdapter" ref="jpaAdapter" /> - </bean> - - <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"> - <property name="databasePlatform" value="org.apache.openjpa.jdbc.sql.DerbyDictionary" /> - <property name="database" value="DERBY" /> - </bean> - - <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> - <property name="entityManagerFactory" ref="entityManagerFactory" /> - </bean> - - <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"> - <property name="transactionManager" ref="transactionManager" /> - </bean> - -</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/features.xml b/examples/camel-example-etl/src/main/resources/features.xml deleted file mode 100644 index 389b504..0000000 --- a/examples/camel-example-etl/src/main/resources/features.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?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. - ---> -<features> - - <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository> - - <feature name='camel-example-etl' version='${project.version}'> - <feature version="${project.version}">camel-jaxb</feature> - <feature version="${project.version}">camel-jpa</feature> - <feature version="${project.version}">camel-juel</feature> - <feature version="${project.version}">camel-spring</feature> - <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle> - <bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle> - <bundle>mvn:org.apache.camel.example/camel-example-etl/${project.version}</bundle> - </feature> - -</features> http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/main/resources/log4j2.properties ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/main/resources/log4j2.properties b/examples/camel-example-etl/src/main/resources/log4j2.properties deleted file mode 100644 index 9deb51c..0000000 --- a/examples/camel-example-etl/src/main/resources/log4j2.properties +++ /dev/null @@ -1,23 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -appender.console.type = Console -appender.console.name = console -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -rootLogger.level = INFO -rootLogger.appenderRef.console.ref = console http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/camel-example-etl/src/test/java/org/apache/camel/example/etl/IntegrationTest.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-etl/src/test/java/org/apache/camel/example/etl/IntegrationTest.java b/examples/camel-example-etl/src/test/java/org/apache/camel/example/etl/IntegrationTest.java deleted file mode 100644 index 9dfb772..0000000 --- a/examples/camel-example-etl/src/test/java/org/apache/camel/example/etl/IntegrationTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.example.etl; - -import junit.framework.TestCase; -import org.apache.camel.spring.Main; - -/** - * @version - */ -public class IntegrationTest extends TestCase { - - public void testEtlRoutes() throws Exception { - // let's boot up the Spring application context for 5 seconds to check that it works OK - Main.main("-duration", "5s", "-o", "target/site/cameldoc"); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/d25e9bcb/examples/pom.xml ---------------------------------------------------------------------- diff --git a/examples/pom.xml b/examples/pom.xml index b673f54..18cedb0 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -55,7 +55,6 @@ <module>camel-example-cxf-proxy</module> <module>camel-example-cxf-tomcat</module> <module>camel-example-console</module> - <module>camel-example-etl</module> <module>camel-example-ftp</module> <module>camel-example-google-pubsub</module> <module>camel-example-guice-jms</module>