camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [03/17] camel git commit: CAMEL-9748: camel-openstack nova
Date Sat, 17 Dec 2016 11:53:42 GMT
CAMEL-9748: camel-openstack nova


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e725ee77
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e725ee77
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e725ee77

Branch: refs/heads/master
Commit: e725ee77c8b6c6dd05399c4d0ce9cc2e07746108
Parents: be5895d
Author: Jan Bouska <jbouska@redhat.com>
Authored: Fri Nov 18 19:08:30 2016 +0100
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Sat Dec 17 12:25:12 2016 +0100

----------------------------------------------------------------------
 .../src/main/descriptors/common-bin.xml         |   2 +
 .../camel-openstack-starter/pom.xml             |  55 +++++
 .../CinderComponentAutoConfiguration.java       |  45 ++++
 .../GlanceComponentAutoConfiguration.java       |  45 ++++
 .../KeystoneComponentAutoConfiguration.java     |  45 ++++
 .../NeutronComponentAutoConfiguration.java      |  45 ++++
 .../NovaComponentAutoConfiguration.java         |  45 ++++
 .../camel/component/springboot/openstack.java   |  45 ++++
 .../src/main/resources/META-INF/LICENSE.txt     | 203 +++++++++++++++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 .../main/resources/META-INF/spring.factories    |  27 +++
 .../src/main/resources/META-INF/spring.provides |  18 ++
 components-starter/pom.xml                      |   1 +
 components/camel-openstack/pom.xml              |  59 ++++++
 .../common/AbstractOpenstackEndpoint.java       |  68 +++++++
 .../common/AbstractOpenstackProducer.java       |  86 ++++++++
 .../openstack/common/OpenstackConstants.java    |  36 ++++
 .../component/openstack/nova/NovaComponent.java |  33 +++
 .../component/openstack/nova/NovaConstants.java |  52 +++++
 .../component/openstack/nova/NovaEndpoint.java  | 158 +++++++++++++++
 .../nova/producer/FlavorsProducer.java          | 117 +++++++++++
 .../nova/producer/KeypairProducer.java          |  89 ++++++++
 .../openstack/nova/producer/ServerProducer.java | 153 ++++++++++++++
 .../org/apache/camel/component/openstack-nova   |   1 +
 .../openstack/AbstractProducerTestSupport.java  |  53 +++++
 .../openstack/nova/FlavorProducerTest.java      | 193 ++++++++++++++++++
 .../openstack/nova/KeypairProducerTest.java     | 121 +++++++++++
 .../openstack/nova/NovaProducerTestSupport.java |  55 +++++
 .../openstack/nova/ServerProducerTest.java      | 155 ++++++++++++++
 components/pom.xml                              |   1 +
 parent/pom.xml                                  |   6 +
 31 files changed, 2023 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/apache-camel/src/main/descriptors/common-bin.xml
----------------------------------------------------------------------
diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml
index 544f45b..7b0fd4e 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -175,6 +175,7 @@
         <include>org.apache.camel:camel-olingo2-api</include>
         <include>org.apache.camel:camel-olingo2</include>
         <include>org.apache.camel:camel-openshift</include>
+        <include>org.apache.camel:camel-openstack</include>
         <include>org.apache.camel:camel-optaplanner</include>
         <include>org.apache.camel:camel-paho</include>
         <include>org.apache.camel:camel-paxlogging</include>
@@ -437,6 +438,7 @@
         <include>org.apache.camel:camel-ognl-starter</include>
         <include>org.apache.camel:camel-olingo2-starter</include>
         <include>org.apache.camel:camel-openshift-starter</include>
+        <include>org.apache.camel:camel-openstack-starter</include>
         <include>org.apache.camel:camel-optaplanner-starter</include>
         <include>org.apache.camel:camel-paho-starter</include>
         <include>org.apache.camel:camel-pdf-starter</include>

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/pom.xml
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/pom.xml b/components-starter/camel-openstack-starter/pom.xml
new file mode 100644
index 0000000..d62b54b
--- /dev/null
+++ b/components-starter/camel-openstack-starter/pom.xml
@@ -0,0 +1,55 @@
+<?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</groupId>
+    <artifactId>components-starter</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>camel-openstack-starter</artifactId>
+  <packaging>jar</packaging>
+  <name>Spring-Boot Starter :: Camel :: OpenStack</name>
+  <description>Spring-Boot Starter for Camel Components</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <version>${spring-boot-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-openstack</artifactId>
+      <version>${project.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring-boot-starter</artifactId>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java
new file mode 100644
index 0000000..8b7ac65
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.cinder.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack.cinder.CinderComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class CinderComponentAutoConfiguration {
+
+    @Bean(name = "openstack-cinder-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(CinderComponent.class)
+    public CinderComponent configureCinderComponent(CamelContext camelContext)
+            throws Exception {
+        CinderComponent component = new CinderComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java
new file mode 100644
index 0000000..9bae60b
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.glance.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack.glance.GlanceComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class GlanceComponentAutoConfiguration {
+
+    @Bean(name = "openstack-glance-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(GlanceComponent.class)
+    public GlanceComponent configureGlanceComponent(CamelContext camelContext)
+            throws Exception {
+        GlanceComponent component = new GlanceComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java
new file mode 100644
index 0000000..a3f9b12
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.keystone.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack.keystone.KeystoneComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class KeystoneComponentAutoConfiguration {
+
+    @Bean(name = "openstack-keystone-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(KeystoneComponent.class)
+    public KeystoneComponent configureKeystoneComponent(
+            CamelContext camelContext) throws Exception {
+        KeystoneComponent component = new KeystoneComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java
new file mode 100644
index 0000000..2acd6a3
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.neutron.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack.neutron.NeutronComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class NeutronComponentAutoConfiguration {
+
+    @Bean(name = "openstack-neutron-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(NeutronComponent.class)
+    public NeutronComponent configureNeutronComponent(CamelContext camelContext)
+            throws Exception {
+        NeutronComponent component = new NeutronComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java
new file mode 100644
index 0000000..6a3e8e0
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack.nova.NovaComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class NovaComponentAutoConfiguration {
+
+    @Bean(name = "openstack-nova-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(NovaComponent.class)
+    public NovaComponent configureNovaComponent(CamelContext camelContext)
+            throws Exception {
+        NovaComponent component = new NovaComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/springboot/openstack.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/springboot/openstack.java b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/springboot/openstack.java
new file mode 100644
index 0000000..d870224
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/springboot/openstack.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.openstack;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class openstack {
+
+    @Bean(name = "openstack-swift-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(openstack.class)
+    public openstack configureopenstack(CamelContext camelContext)
+            throws Exception {
+        openstack component = new openstack();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-openstack-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 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/e725ee77/components-starter/camel-openstack-starter/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-openstack-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  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/e725ee77/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.factories b/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..12490bd
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,27 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.camel.component.openstack.glance.springboot.GlanceComponentAutoConfiguration,\
+org.apache.camel.component.openstack.neutron.springboot.NeutronComponentAutoConfiguration,\
+org.apache.camel.component.openstack.nova.springboot.NovaComponentAutoConfiguration,\
+org.apache.camel.component.openstack.cinder.springboot.CinderComponentAutoConfiguration,\
+org.apache.camel.component.openstack.keystone.springboot.KeystoneComponentAutoConfiguration
+
+
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.provides
----------------------------------------------------------------------
diff --git a/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.provides b/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 0000000..7e28245
--- /dev/null
+++ b/components-starter/camel-openstack-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+provides: camel-openstack
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components-starter/pom.xml
----------------------------------------------------------------------
diff --git a/components-starter/pom.xml b/components-starter/pom.xml
index 5dc6005..2b60ca0 100644
--- a/components-starter/pom.xml
+++ b/components-starter/pom.xml
@@ -220,6 +220,7 @@
     <module>camel-ognl-starter</module>
     <module>camel-olingo2-starter</module>
     <module>camel-openshift-starter</module>
+    <module>camel-openstack-starter</module>
     <module>camel-optaplanner-starter</module>
     <module>camel-paho-starter</module>
     <module>camel-pdf-starter</module>

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-openstack/pom.xml b/components/camel-openstack/pom.xml
new file mode 100644
index 0000000..06167fa
--- /dev/null
+++ b/components/camel-openstack/pom.xml
@@ -0,0 +1,59 @@
+<?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/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.camel</groupId>
+		<artifactId>components</artifactId>
+		<version>2.19.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>camel-openstack</artifactId>
+	<packaging>jar</packaging>
+	<name>Camel :: OpenStack</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-core</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.pacesys</groupId>
+			<artifactId>openstack4j-core</artifactId>
+			<version>${openstack4j-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.pacesys.openstack4j.connectors</groupId>
+			<artifactId>openstack4j-jersey2</artifactId>
+			<version>${openstack4j-version}</version>
+		</dependency>
+
+		<!-- testing -->
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mockito</groupId>
+			<artifactId>mockito-core</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackEndpoint.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackEndpoint.java
new file mode 100644
index 0000000..26c4c62
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackEndpoint.java
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.common;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultEndpoint;
+
+import org.openstack4j.api.OSClient;
+import org.openstack4j.api.client.IOSClientBuilder;
+import org.openstack4j.model.common.Identifier;
+import org.openstack4j.openstack.OSFactory;
+
+public abstract class AbstractOpenstackEndpoint extends DefaultEndpoint {
+
+	protected abstract String getHost();
+
+	protected abstract String getUsername();
+
+	protected abstract String getDomain();
+
+	protected abstract String getPassword();
+
+	protected abstract String getProject();
+
+	protected abstract String getOperation();
+
+	public AbstractOpenstackEndpoint(String endpointUri, Component component) {
+		super(endpointUri, component);
+	}
+
+	protected OSClient.OSClientV3 createClient() {
+
+		//client sholud reAuthenticate itself when token expires
+		IOSClientBuilder.V3 builder = OSFactory.builderV3()
+				.endpoint(getHost());
+
+		builder.credentials(getUsername(), getPassword(), Identifier.byId(getDomain()));
+
+		builder.scopeToProject(Identifier.byId(getProject()));
+		return builder.authenticate();
+	}
+
+	@Override
+	public Consumer createConsumer(Processor processor) throws Exception {
+		throw new IllegalStateException("There is no consumer available for OpenStack");
+	}
+
+	@Override
+	public boolean isSingleton() {
+		return false;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackProducer.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackProducer.java
new file mode 100644
index 0000000..4e1ae56
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/AbstractOpenstackProducer.java
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.common;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
+
+import org.openstack4j.api.OSClient;
+import org.openstack4j.model.common.ActionResponse;
+import org.openstack4j.model.common.Payload;
+import org.openstack4j.model.common.Payloads;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
+public abstract class AbstractOpenstackProducer extends DefaultProducer {
+
+	protected OSClient os;
+
+	private AbstractOpenstackEndpoint endpoint;
+
+	public AbstractOpenstackProducer(AbstractOpenstackEndpoint endpoint, OSClient client) {
+		super(endpoint);
+		this.os = client;
+		this.endpoint = endpoint;
+	}
+
+	protected Payload createPayload(Message msg) {
+		//if payload object is send directly
+		Payload payload = msg.getBody(Payload.class);
+		if(ObjectHelper.isNotEmpty(payload))
+		{
+			return payload;
+		}
+
+		Object messageBody = msg.getBody();
+		if (messageBody instanceof URL) {
+			payload = Payloads.create((URL) messageBody);
+		}
+		if (messageBody instanceof File) {
+			payload = Payloads.create((File) messageBody);
+		}
+		if (messageBody instanceof InputStream) {
+			payload = Payloads.create((InputStream) messageBody);
+		}
+
+		if (payload == null) {
+			throw new IllegalArgumentException("You have to set payload. It can be InputStream, File or URL class");
+		}
+
+		return payload;
+	}
+
+	protected String getOperation(Exchange exchange) {
+		final String operation = exchange.getIn().getHeader(NovaConstants.OPERATION, endpoint.getOperation(), String.class);
+		ObjectHelper.notEmpty(operation, "Operation");
+		return operation;
+	}
+
+	protected void checkFailure(ActionResponse response, Message msg, String operation)
+	{
+		msg.setFault(!response.isSuccess());
+		if(!response.isSuccess())
+		{
+			msg.setBody(String.format(" %s was not successful: %s", operation, response.getFault()));
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackConstants.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackConstants.java
new file mode 100644
index 0000000..83a4925
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackConstants.java
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.common;
+
+/**
+ * General camel-openstack component constants.
+ * The main purpose for this class is to avoid duplication general constants in each submodule.
+ */
+public class OpenstackConstants {
+
+	public static final String OPERATION = "operation";
+	public static final String ID = "ID";
+	public static final String NAME = "name";
+	public static final String DESCRIPTION = "description";
+	public static final String PROPERTIES = "properties";
+
+	public static final String CREATE = "create";
+	public static final String UPDATE = "update";
+	public static final String GET_ALL = "getAll";
+	public static final String GET = "get";
+	public static final String DELETE = "delete";
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaComponent.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaComponent.java
new file mode 100644
index 0000000..5313992
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaComponent.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+
+import java.util.Map;
+
+public class NovaComponent extends DefaultComponent {
+
+	@Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+		NovaEndpoint endpoint = new NovaEndpoint(uri, this);
+		setProperties(endpoint, parameters);
+		endpoint.setHost(remaining);
+		return endpoint;
+	}
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaConstants.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaConstants.java
new file mode 100644
index 0000000..00d621e
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaConstants.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+
+public final class  NovaConstants extends OpenstackConstants{
+
+	/*****************************************
+	 * 		constants for options			 *
+	 *****************************************/
+	public static final String NOVA_SUBSYSTEM_FLAVORS = "flavors";
+	public static final String NOVA_SUBSYSTEM_SERVERS = "servers";
+	public static final String NOVA_SUBSYSTEM_KEYPAIRS = "keypairs";
+
+
+	public static final String FLAVOR_ID = "FlavorId";
+
+	//flavor
+	public static final String RAM = "RAM";
+	public static final String VCPU = "VCPU";
+	public static final String DISK = "disk";
+	public static final String SWAP = "swap";
+	public static final String RXTXFACTOR = "rxtxFactor";
+
+	//server
+	public static final String ADMIN_PASSWORD = "AdminPassword";
+	public static final String IMAGE_ID = "ImageId";
+	public static final String KEYPAIR_NAME = "KeypairName";
+	public static final String NETWORK = "NetworkId";
+
+	/*****************************************
+	 * constants for operations				 *
+	 *****************************************/
+	//server
+	public static final String CREATE_SNAPSHOT = "createSnapshot";
+	public static final String ACTION= "action";
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaEndpoint.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaEndpoint.java
new file mode 100644
index 0000000..25be953
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/NovaEndpoint.java
@@ -0,0 +1,158 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova;
+
+import org.apache.camel.Producer;
+import org.apache.camel.component.openstack.common.AbstractOpenstackEndpoint;
+import org.apache.camel.component.openstack.nova.producer.FlavorsProducer;
+import org.apache.camel.component.openstack.nova.producer.KeypairProducer;
+import org.apache.camel.component.openstack.nova.producer.ServerProducer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+
+@UriEndpoint(scheme = "openstack-nova", title = "OpenStack-Nova", syntax = "openstack-nova:host", label = "cloud, virtualization")
+public class NovaEndpoint extends AbstractOpenstackEndpoint {
+
+	@UriPath
+	@Metadata(required = "true")
+	private String host;
+
+	@UriParam (enums = "flavors, servers, keypairs")
+	@Metadata(required = "true")
+	String subsystem;
+
+	@UriParam(defaultValue = "default")
+	private String domain = "default";
+
+	@UriParam
+	@Metadata(required = "true")
+	private String project;
+
+	@UriParam
+	private String operation;
+
+	@UriParam
+	@Metadata(required = "true")
+	private String username;
+
+	@UriParam
+	@Metadata(required = "true")
+	private String password;
+
+	public NovaEndpoint(String uri, NovaComponent component) {
+		super(uri, component);
+	}
+
+	@Override
+	public Producer createProducer() throws Exception {
+		switch (getSubsystem()) {
+			case NovaConstants.NOVA_SUBSYSTEM_FLAVORS:
+				return new FlavorsProducer(this, createClient());
+			case NovaConstants.NOVA_SUBSYSTEM_SERVERS:
+				return new ServerProducer(this, createClient());
+			case NovaConstants.NOVA_SUBSYSTEM_KEYPAIRS:
+				return new KeypairProducer(this, createClient());
+			default:
+				throw new IllegalArgumentException("Can't create producer with subsystem " + subsystem);
+		}
+	}
+
+	public String getSubsystem() {
+		return subsystem;
+	}
+
+	/**
+	 * OpenStack Nova subsystem
+	 */
+	public void setSubsystem(String subsystem) {
+		this.subsystem = subsystem;
+	}
+
+	@Override
+	public String getDomain() {
+		return domain;
+	}
+
+	/**
+	 * Authentication domain
+	 */
+	public void setDomain(String domain) {
+		this.domain = domain;
+	}
+
+	@Override
+	public String getProject() {
+		return project;
+	}
+
+	/**
+	 * The project ID
+	 */
+	public void setProject(String project) {
+		this.project = project;
+	}
+
+	@Override
+	public String getOperation() {
+		return operation;
+	}
+
+	/**
+	 * The operation to do
+	 */
+	public void setOperation(String operation) {
+		this.operation = operation;
+	}
+
+	@Override
+	public String getUsername() {
+		return username;
+	}
+
+	/**
+	 * OpenStack username
+	 */
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	@Override
+	public String getPassword() {
+		return password;
+	}
+
+	/**
+	 * OpenStack password
+	 */
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	@Override
+	public String getHost() {
+		return host;
+	}
+
+	/**
+	 * OpenStack host url
+	 */
+	public void setHost(String host) {
+		this.host = host;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/FlavorsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/FlavorsProducer.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/FlavorsProducer.java
new file mode 100644
index 0000000..651ecfb
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/FlavorsProducer.java
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova.producer;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.openstack.common.AbstractOpenstackProducer;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.apache.camel.component.openstack.nova.NovaEndpoint;
+import org.apache.camel.util.ObjectHelper;
+
+import org.openstack4j.api.Builders;
+import org.openstack4j.api.OSClient;
+import org.openstack4j.model.common.ActionResponse;
+import org.openstack4j.model.compute.Flavor;
+import org.openstack4j.model.compute.builder.FlavorBuilder;
+
+import java.util.List;
+import java.util.Map;
+
+public class FlavorsProducer extends AbstractOpenstackProducer {
+
+	public FlavorsProducer(NovaEndpoint endpoint, OSClient client) {
+		super(endpoint, client);
+	}
+
+	@Override public void process(Exchange exchange) throws Exception {
+		final String operation = getOperation(exchange);
+		switch (operation) {
+			case NovaConstants.CREATE:
+				doCreate(exchange);
+				break;
+			case NovaConstants.GET:
+				doGet(exchange);
+				break;
+			case NovaConstants.GET_ALL:
+				doGetAll(exchange);
+				break;
+			case NovaConstants.DELETE:
+				doDelete(exchange);
+				break;
+			default:
+				throw new IllegalArgumentException("Unsupported operation " + operation);
+		}
+	}
+
+	private void doCreate(Exchange exchange) {
+		final Flavor in = messageToFlavor(exchange.getIn());
+		final Flavor out = os.compute().flavors().create(in);
+		exchange.getIn().setBody(out);
+	}
+
+	private void doGet(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String flavorId = msg.getHeader(NovaConstants.ID, msg.getHeader(NovaConstants.FLAVOR_ID, String.class), String.class);
+		ObjectHelper.notEmpty(flavorId, "FlavorID");
+		final Flavor out = os.compute().flavors().get(flavorId);
+		exchange.getIn().setBody(out);
+	}
+
+	private void doGetAll(Exchange exchange) {
+		final List<? extends Flavor> out = os.compute().flavors().list();
+		exchange.getIn().setBody(out);
+	}
+
+	private void doDelete(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String flavorId = msg.getHeader(NovaConstants.ID, msg.getHeader(NovaConstants.FLAVOR_ID, String.class), String.class);
+		ObjectHelper.notEmpty(flavorId, "FlavorID");
+		final ActionResponse response = os.compute().flavors().delete(flavorId);
+		checkFailure(response, msg, "Delete flavor");
+	}
+
+	private org.openstack4j.model.compute.Flavor messageToFlavor(Message message) {
+		Flavor flavor = message.getBody(Flavor.class);
+		if(flavor == null) {
+			Map headers = message.getHeaders();
+			FlavorBuilder flavorBuilder = Builders.flavor();
+
+			ObjectHelper.notEmpty(message.getHeader(NovaConstants.NAME, String.class), "Name");
+			flavorBuilder.name(message.getHeader(NovaConstants.NAME, String.class));
+
+			if(headers.containsKey(NovaConstants.VCPU))
+			flavorBuilder.vcpus(message.getHeader(NovaConstants.VCPU, Integer.class));
+
+			if(headers.containsKey(NovaConstants.RAM))
+			flavorBuilder.ram(message.getHeader(NovaConstants.RAM, Integer.class));
+
+			if(headers.containsKey(NovaConstants.DISK))
+			flavorBuilder.disk(message.getHeader(NovaConstants.DISK, Integer.class));
+
+			if(headers.containsKey(NovaConstants.SWAP))
+			flavorBuilder.swap(message.getHeader(NovaConstants.SWAP, Integer.class));
+
+			if(headers.containsKey(NovaConstants.RXTXFACTOR))
+			flavorBuilder.rxtxFactor(message.getHeader(NovaConstants.RXTXFACTOR, Integer.class));
+
+			flavor = flavorBuilder.build();
+		}
+
+		return flavor;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/KeypairProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/KeypairProducer.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/KeypairProducer.java
new file mode 100644
index 0000000..7712121
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/KeypairProducer.java
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova.producer;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.openstack.common.AbstractOpenstackProducer;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.apache.camel.component.openstack.nova.NovaEndpoint;
+import org.apache.camel.util.ObjectHelper;
+
+import org.openstack4j.api.OSClient;
+import org.openstack4j.model.common.ActionResponse;
+import org.openstack4j.model.compute.Keypair;
+
+import java.util.List;
+
+public class KeypairProducer extends AbstractOpenstackProducer {
+
+	public KeypairProducer(NovaEndpoint endpoint, OSClient client) {
+		super(endpoint, client);
+	}
+
+	@Override public void process(Exchange exchange) throws Exception {
+		String operation = getOperation(exchange);
+		switch (operation) {
+			case NovaConstants.CREATE:
+				doCreate(exchange);
+				break;
+			case NovaConstants.GET:
+				doGet(exchange);
+				break;
+			case NovaConstants.GET_ALL:
+				doGetAll(exchange);
+				break;
+			case NovaConstants.DELETE:
+				doDelete(exchange);
+				break;
+			default:
+				throw new IllegalArgumentException("Unsupported operation " + operation);
+		}
+	}
+	private void doCreate(Exchange exchange){
+		final Message msg = exchange.getIn();
+		final String name = msg.getHeader(NovaConstants.NAME, String.class);
+		ObjectHelper.notEmpty(name, "Keypair name");
+
+		final String body  = msg.getBody(String.class);
+		final Keypair kp = os.compute().keypairs().create(name, body);
+		msg.setBody(kp);
+	}
+
+	private void doGet(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String keypairName = msg.getHeader(NovaConstants.NAME, String.class);
+		ObjectHelper.notEmpty(keypairName, "Keypair name");
+		final Keypair kp = os.compute().keypairs().get(keypairName);
+		msg.setBody(kp);
+	}
+
+	private void doGetAll(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final List<? extends Keypair> keypairs = os.compute().keypairs().list();
+		msg.setBody(keypairs);
+	}
+
+	private void doDelete(Exchange exchange){
+		final Message msg = exchange.getIn();
+		final String keypairName = msg.getHeader(NovaConstants.NAME, String.class);
+		ObjectHelper.notEmpty(keypairName, "Keypair name");
+		final ActionResponse response = os.compute().keypairs().delete(keypairName);
+		checkFailure(response, msg, "Delete keypair " + keypairName);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/ServerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/ServerProducer.java b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/ServerProducer.java
new file mode 100644
index 0000000..53469a1
--- /dev/null
+++ b/components/camel-openstack/src/main/java/org/apache/camel/component/openstack/nova/producer/ServerProducer.java
@@ -0,0 +1,153 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova.producer;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.openstack.common.AbstractOpenstackProducer;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.apache.camel.component.openstack.nova.NovaEndpoint;
+import org.apache.camel.util.ObjectHelper;
+
+import org.openstack4j.api.Builders;
+import org.openstack4j.api.OSClient;
+import org.openstack4j.model.common.ActionResponse;
+import org.openstack4j.model.compute.Action;
+import org.openstack4j.model.compute.Server;
+import org.openstack4j.model.compute.ServerCreate;
+import org.openstack4j.model.compute.builder.ServerCreateBuilder;
+
+import java.util.List;
+import java.util.Map;
+
+public class ServerProducer extends AbstractOpenstackProducer {
+
+	public ServerProducer(NovaEndpoint endpoint, OSClient client) {
+		super(endpoint, client);
+	}
+
+	@Override
+	public void process(Exchange exchange) throws Exception {
+		final String operation = getOperation(exchange);
+		switch (operation) {
+			case NovaConstants.CREATE:
+				doCreate(exchange);
+				break;
+			case NovaConstants.CREATE_SNAPSHOT:
+				doCreateSnapshot(exchange);
+				break;
+			case NovaConstants.GET:
+				doGet(exchange);
+				break;
+			case NovaConstants.GET_ALL:
+				doGetAll(exchange);
+			case NovaConstants.DELETE:
+				doDelete(exchange);
+				break;
+			case NovaConstants.ACTION:
+				doAction(exchange);
+				break;
+			default:
+				//execute action when Operation:Action header is not set but
+				// Action is properly specified
+				if (exchange.getIn().getHeaders().containsKey(NovaConstants.ACTION)) {
+					doAction(exchange);
+				}
+				else {
+					throw new IllegalArgumentException("Unsupported operation " + operation);
+				}
+		}
+	}
+
+	private void doCreate(Exchange exchange) {
+		final ServerCreate in = messageToServer(exchange.getIn());
+		final Server out = os.compute().servers().boot(in);
+		exchange.getIn().setBody(out);
+	}
+
+	private void doCreateSnapshot(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String serverId = msg.getHeader(NovaConstants.ID, String.class);
+		final String name = msg.getHeader(NovaConstants.NAME, String.class);
+		ObjectHelper.notEmpty(serverId, "Server ID");
+		ObjectHelper.notEmpty(name, "VolumeSnapshot name");
+
+		final String snapshotId = os.compute().servers().createSnapshot(serverId, name);
+		msg.setBody(snapshotId);
+	}
+
+	private void doGet(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String serverId = msg.getHeader(NovaConstants.ID, String.class);
+		ObjectHelper.notEmpty(serverId, "Server ID");
+		final Server result = os.compute().servers().get(serverId);
+		msg.setBody(result);
+	}
+
+	private void doGetAll(Exchange exchange) {
+		final List<? extends Server> out = os.compute().servers().list();
+		exchange.getIn().setBody(out);
+	}
+
+	private void doAction(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final Action action = msg.getHeader(NovaConstants.ACTION, Action.class);
+		final String serverId = msg.getHeader(NovaConstants.ID, String.class);
+		ObjectHelper.notNull(action, "Server action");
+		ObjectHelper.notEmpty(serverId, "Server ID");
+		final ActionResponse response = os.compute().servers().action(serverId, action);
+		checkFailure(response, msg, "Performing action " + action.name());
+	}
+
+	private void doDelete(Exchange exchange) {
+		final Message msg = exchange.getIn();
+		final String serverId = msg.getHeader(NovaConstants.ID, String.class);
+		ObjectHelper.notEmpty(serverId, "Server ID");
+		final ActionResponse response = os.compute().servers().delete(serverId);
+		checkFailure(response, msg, "Delete server with ID " + serverId);
+	}
+
+	private ServerCreate messageToServer(Message message) {
+		ServerCreate serverCreate = message.getBody(ServerCreate.class);
+
+		if (serverCreate == null) {
+			Map headers = message.getHeaders();
+			ServerCreateBuilder builder = Builders.server();
+
+			ObjectHelper.notEmpty(message.getHeader(NovaConstants.NAME, String.class), "Name");
+			builder.name(message.getHeader(NovaConstants.NAME, String.class));
+
+			if (headers.containsKey(NovaConstants.IMAGE_ID))
+				builder.image(message.getHeader(NovaConstants.IMAGE_ID, String.class));
+
+			if(headers.containsKey(NovaConstants.NETWORK))
+				builder.networks(message.getHeader(NovaConstants.NETWORK, List.class));
+
+			if (headers.containsKey(NovaConstants.FLAVOR_ID))
+				builder.flavor(message.getHeader(NovaConstants.FLAVOR_ID, String.class));
+
+			if (headers.containsKey(NovaConstants.KEYPAIR_NAME))
+				builder.keypairName(message.getHeader(NovaConstants.KEYPAIR_NAME, String.class));
+
+			if (headers.containsKey(NovaConstants.ADMIN_PASSWORD))
+				builder.addAdminPass(message.getHeader(NovaConstants.ADMIN_PASSWORD, String.class));
+
+			serverCreate = builder.build();
+		}
+		return serverCreate;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/main/resources/META-INF/services/org/apache/camel/component/openstack-nova
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/main/resources/META-INF/services/org/apache/camel/component/openstack-nova b/components/camel-openstack/src/main/resources/META-INF/services/org/apache/camel/component/openstack-nova
new file mode 100644
index 0000000..cbd9dae
--- /dev/null
+++ b/components/camel-openstack/src/main/resources/META-INF/services/org/apache/camel/component/openstack-nova
@@ -0,0 +1 @@
+class=org.apache.camel.component.openstack.nova.NovaComponent

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/AbstractProducerTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/AbstractProducerTestSupport.java b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/AbstractProducerTestSupport.java
new file mode 100644
index 0000000..9a8a3d3
--- /dev/null
+++ b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/AbstractProducerTestSupport.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack;
+
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultMessage;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.openstack4j.api.OSClient;
+
+import java.io.IOException;
+
+@RunWith(MockitoJUnitRunner.class)
+public abstract class AbstractProducerTestSupport {
+
+	@Mock
+	protected OSClient client;
+
+	@Mock
+	protected Exchange exchange;
+
+	protected Message msg;
+
+	protected Producer producer;
+
+	@Before
+	public void before() throws IOException {
+		msg  = new DefaultMessage();
+		when(exchange.getIn()).thenReturn(msg);
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/e725ee77/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/nova/FlavorProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/nova/FlavorProducerTest.java b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/nova/FlavorProducerTest.java
new file mode 100644
index 0000000..c09f3a6
--- /dev/null
+++ b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/nova/FlavorProducerTest.java
@@ -0,0 +1,193 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openstack.nova;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.apache.camel.component.openstack.nova.producer.FlavorsProducer;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.mockito.ArgumentCaptor;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.common.ActionResponse;
+import org.openstack4j.model.compute.Flavor;
+import org.openstack4j.model.compute.builder.FlavorBuilder;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+public class FlavorProducerTest extends NovaProducerTestSupport {
+
+	@Mock
+	private Flavor testOSFlavor;
+
+	private Flavor dummyFlavor;
+
+	@Before
+	public void setUp() {
+		producer = new FlavorsProducer(endpoint, client);
+
+		when(flavorService.create(Matchers.any(org.openstack4j.model.compute.Flavor.class))).thenReturn(testOSFlavor);
+		when(flavorService.get(Matchers.anyString())).thenReturn(testOSFlavor);
+
+		List<org.openstack4j.model.compute.Flavor> getAllList = new ArrayList<>();
+		getAllList.add(testOSFlavor);
+		getAllList.add(testOSFlavor);
+		doReturn(getAllList).when(flavorService).list();
+
+		dummyFlavor = createTestFlavor();
+
+		when(testOSFlavor.getId()).thenReturn(UUID.randomUUID().toString());
+		when(testOSFlavor.getName()).thenReturn(dummyFlavor.getName());
+		when(testOSFlavor.getRam()).thenReturn(dummyFlavor.getRam());
+		when(testOSFlavor.getVcpus()).thenReturn(dummyFlavor.getVcpus());
+		when(testOSFlavor.getDisk()).thenReturn(dummyFlavor.getDisk());
+		when(testOSFlavor.getSwap()).thenReturn(dummyFlavor.getSwap());
+	}
+
+	@Test
+	public void createFlavor() throws Exception {
+		when(endpoint.getOperation()).thenReturn(NovaConstants.CREATE);
+		final String expectedFlavorID = UUID.randomUUID().toString();
+		when(testOSFlavor.getId()).thenReturn(expectedFlavorID);
+
+		//send dummyFlavor to create
+		msg.setBody(dummyFlavor);
+		producer.process(exchange);
+
+		ArgumentCaptor<Flavor> flavorCaptor = ArgumentCaptor.forClass(Flavor.class);
+		verify(flavorService).create(flavorCaptor.capture());
+		assertEquals(dummyFlavor, flavorCaptor.getValue());
+
+		final Flavor createdFlavor = msg.getBody(Flavor.class);
+		assertEqualsFlavors(dummyFlavor, createdFlavor);
+		assertNotNull(createdFlavor.getId());
+	}
+
+	@Test
+	public void createFlavorWithHeaders() throws Exception {
+		Map<String, Object> headers = new HashMap<>();
+		headers.put(NovaConstants.OPERATION, NovaConstants.CREATE);
+		headers.put(NovaConstants.NAME, dummyFlavor.getName());
+		headers.put(NovaConstants.VCPU, dummyFlavor.getVcpus());
+		headers.put(NovaConstants.DISK, dummyFlavor.getDisk());
+		headers.put(NovaConstants.SWAP, dummyFlavor.getSwap());
+		headers.put(NovaConstants.RAM, dummyFlavor.getRam());
+		msg.setHeaders(headers);
+		producer.process(exchange);
+
+		ArgumentCaptor<Flavor> flavorCaptor = ArgumentCaptor.forClass(Flavor.class);
+		verify(flavorService).create(flavorCaptor.capture());
+		assertEqualsFlavors(dummyFlavor, flavorCaptor.getValue());
+
+		final Flavor created = msg.getBody(Flavor.class);
+		assertNotNull(created.getId());
+		assertEqualsFlavors(dummyFlavor, created);
+	}
+
+	@Test
+	public void getTest() throws Exception {
+		msg.setHeader(NovaConstants.OPERATION, NovaConstants.GET);
+		msg.setHeader(NovaConstants.ID, "anything - client is mocked");
+
+		//should return dummyFlavor
+		producer.process(exchange);
+
+		final Flavor result = msg.getBody(Flavor.class);
+		assertEqualsFlavors(dummyFlavor, result);
+		assertNotNull(result.getId());
+	}
+
+	@Test
+	public void getAllTest() throws Exception {
+		when(endpoint.getOperation()).thenReturn(NovaConstants.GET_ALL);
+
+		producer.process(exchange);
+		List<Flavor> result = msg.getBody(List.class);
+
+		assertTrue(result.size() == 2);
+		for (Flavor f : result) {
+			assertEqualsFlavors(dummyFlavor, f);
+			assertNotNull(f.getId());
+		}
+	}
+
+	@Test
+	public void deleteSuccess() throws Exception {
+		when(flavorService.delete(Matchers.anyString())).thenReturn(ActionResponse.actionSuccess());
+		when(endpoint.getOperation()).thenReturn(NovaConstants.DELETE);
+		String id = "myID";
+		msg.setHeader(NovaConstants.ID, id);
+		producer.process(exchange);
+
+		ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
+		verify(flavorService).delete(argumentCaptor.capture());
+		assertEquals(id, argumentCaptor.getValue());
+
+		assertFalse(msg.isFault());
+		assertNull(msg.getBody());
+	}
+
+	@Test
+	public void deleteFailure() throws Exception {
+		final String failReason = "unknown";
+		when(flavorService.delete(Matchers.anyString())).thenReturn(ActionResponse.actionFailed(failReason, 401));
+		when(endpoint.getOperation()).thenReturn(NovaConstants.DELETE);
+		String id = "myID";
+		msg.setHeader(NovaConstants.ID, id);
+		producer.process(exchange);
+
+		ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
+		verify(flavorService).delete(argumentCaptor.capture());
+		assertEquals(id, argumentCaptor.getValue());
+
+		assertTrue(msg.isFault());
+		assertTrue(msg.getBody(String.class).contains(failReason));
+	}
+
+	private Flavor createTestFlavor() {
+		FlavorBuilder builder = Builders.flavor()
+				.name("dummy flavor")
+				.ram(3)
+				.vcpus(2)
+				.disk(5)
+				.swap(2);
+		return builder.build();
+	}
+
+	private void assertEqualsFlavors(Flavor old, Flavor createdFlavor) {
+		assertEquals(old.getName(), createdFlavor.getName());
+		assertEquals(old.getRam(), createdFlavor.getRam());
+		assertEquals(old.getVcpus(), createdFlavor.getVcpus());
+		assertEquals(old.getDisk(), createdFlavor.getDisk());
+	}
+}


Mime
View raw message