camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [5/9] camel git commit: CAMEL-8920 Camel-JClouds: Add new operations to Blobstore component, add containerExists operation
Date Tue, 30 Jun 2015 15:29:07 GMT
CAMEL-8920 Camel-JClouds: Add new operations to Blobstore component, add containerExists operation


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

Branch: refs/heads/master
Commit: c9fee04b2588e635b210a23cc505d01ca97ba8a2
Parents: f604ede
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Tue Jun 30 17:27:26 2015 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Tue Jun 30 17:27:26 2015 +0200

----------------------------------------------------------------------
 .../camel/component/jclouds/JcloudsBlobStoreHelper.java      | 8 ++++++++
 .../camel/component/jclouds/JcloudsBlobStoreProducer.java    | 2 ++
 .../org/apache/camel/component/jclouds/JcloudsConstants.java | 1 +
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c9fee04b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
index dbd2a68..3ce1d57 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
@@ -128,4 +128,12 @@ public final class JcloudsBlobStoreHelper {
     public static void deleteContainer(BlobStore blobStore, String container) throws IOException
{
         blobStore.deleteContainer(container);
     }
+    
+    /**
+     * Check if a {@link BlobStore} specific container exists or not
+     */
+    public static boolean containerExists(BlobStore blobStore, String container) throws IOException
{
+        boolean result = blobStore.containerExists(container);
+        return result;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/c9fee04b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
index ea6ed0d..ddf1ed9 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
@@ -63,6 +63,8 @@ public class JcloudsBlobStoreProducer extends JcloudsProducer {
             JcloudsBlobStoreHelper.clearContainer(blobStore, container);
         } else if (JcloudsConstants.DELETE_CONTAINER.equals(operation)) {
             JcloudsBlobStoreHelper.deleteContainer(blobStore, container);
+        } else if (JcloudsConstants.CONTAINER_EXISTS.equals(operation)) {
+            JcloudsBlobStoreHelper.containerExists(blobStore, container);
         } else {
             Payload body = exchange.getIn().getBody(Payload.class);
             JcloudsBlobStoreHelper.writeBlob(blobStore, container, blobName, body);

http://git-wip-us.apache.org/repos/asf/camel/blob/c9fee04b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
index 7a994bb..8819e54 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
@@ -32,6 +32,7 @@ public final class JcloudsConstants {
     public static final String REMOVE_BLOB = "CamelJcloudsRemoveBlob";
     public static final String CLEAR_CONTAINER = "CamelJcloudsClearContainer";
     public static final String DELETE_CONTAINER = "CamelJcloudsDeleteContainer";
+    public static final String CONTAINER_EXISTS = "CamelJcloudsExistsContainer";
     public static final String LIST_IMAGES = "CamelJcloudsListImages";
     public static final String LIST_HARDWARE = "CamelJcloudsListHardware";
     public static final String LIST_NODES = "CamelJcloudsListNodes";


Mime
View raw message