Repository: camel
Updated Branches:
  refs/heads/master dbeb42c42 -> 507e8b5f8


[CAMEL-10786] Adding initial Azure Queue component code


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

Branch: refs/heads/master
Commit: 1b40de614c99824efcaf2e438acc3df2a5b9b8c0
Parents: dbeb42c
Author: Sergey Beryozkin <sberyoz...@gmail.com>
Authored: Tue Feb 21 12:39:40 2017 +0000
Committer: Sergey Beryozkin <sberyoz...@gmail.com>
Committed: Tue Feb 21 12:39:40 2017 +0000

----------------------------------------------------------------------
 .../src/main/docs/azure-blob-component.adoc     |  6 ++--
 .../azure/blob/BlobServiceComponent.java        |  2 +-
 .../azure/blob/BlobServiceConfiguration.java    | 32 ++++++++++----------
 .../azure/common/AbstractConfiguration.java     |  1 -
 .../BlobServiceComponentConfigurationTest.java  | 11 +++++++
 ...dditional-spring-configuration-metadata.json |  6 ++++
 .../main/resources/META-INF/spring.factories    |  4 ++-
 7 files changed, 40 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/components/camel-azure/src/main/docs/azure-blob-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-azure/src/main/docs/azure-blob-component.adoc 
b/components/camel-azure/src/main/docs/azure-blob-component.adoc
index de323e7..69e7629 100644
--- a/components/camel-azure/src/main/docs/azure-blob-component.adoc
+++ b/components/camel-azure/src/main/docs/azure-blob-component.adoc
@@ -62,7 +62,7 @@ The Azure Storage Blob Service component supports 20 endpoint 
options which are
 | credentials | common |  | StorageCredentials | Set the storage credentials 
required in most cases
 | dataLength | common |  | Long | Set the data length for the download or page 
blob upload operations
 | fileDir | common |  | String | Set the file directory where the downloaded 
blobs will be saved to
-| publicForRead | common | false | boolean | Blobs can be public for reading 
their content if this property is enabled then the credentials do not have to 
be set
+| publicForRead | common | false | boolean | Storage resources can be public 
for reading their content if this property is enabled then the credentials do 
not have to be set
 | streamReadSize | common |  | int | Set the minimum read size in bytes when 
reading the blob content
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the 
consumer to the Camel routing Error Handler which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages or the likes will now 
be processed as a message and handled by the routing Error Handler. By default 
the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions that will be logged at WARN or ERROR level and ignored.
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the 
consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler 
is enabled then this options is not in use. By default the consumer will deal 
with exceptions that will be logged at WARN or ERROR level and ignored.
@@ -70,7 +70,7 @@ The Azure Storage Blob Service component supports 20 endpoint 
options which are
 | blobMetadata | producer |  | Map | Set the blob meta-data
 | blobPrefix | producer |  | String | Set a prefix which can be used for 
listing the blobs
 | closeStreamAfterWrite | producer | true | boolean | Close the stream after 
write or keep it open default is true
-| operation | producer | listBlobs | BlobServiceOperations | Required blob 
service operation hint to the producer
+| operation | producer | listBlobs | BlobServiceOperations | Blob service 
operation hint to the producer
 | streamWriteSize | producer |  | int | Set the size of the buffer for writing 
block and page blocks
 | useFlatListing | producer | true | boolean | Specify if the flat or 
hierarchical blob listing should be used
 | synchronous | advanced | false | boolean | Sets whether synchronous 
processing should be strictly used or Camel is allowed to use asynchronous 
processing (if supported).
@@ -162,4 +162,4 @@ where `${camel-version`} must be replaced by the actual 
version of Camel
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
 
-* link:azure.html[Azure Component]
\ No newline at end of file
+* link:azure.html[Azure Component]

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceComponent.java
 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceComponent.java
index 68925aa..6c83384 100644
--- 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceComponent.java
+++ 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceComponent.java
@@ -44,7 +44,7 @@ public class BlobServiceComponent extends 
UriEndpointComponent {
             parts = remaining.split("/"); 
         }
         if (parts == null || parts.length < 2) {
-            throw new IllegalArgumentException("At least account and container 
names must be specified.");
+            throw new IllegalArgumentException("At least the account and 
container names must be specified.");
         }
         
         configuration.setAccountName(parts[0]);

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceConfiguration.java
 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceConfiguration.java
index c6f47a5..a94dbfd 100644
--- 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceConfiguration.java
+++ 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/blob/BlobServiceConfiguration.java
@@ -63,12 +63,12 @@ public class BlobServiceConfiguration extends 
AbstractConfiguration {
     @UriParam
     private Long dataLength;
     
-    @UriParam
-    private boolean publicForRead;
-    
     @UriParam(label = "producer")
     private String blobPrefix;
     
+    @UriParam
+    private boolean publicForRead;
+    
     @UriParam(label = "producer", defaultValue = "true")
     private boolean useFlatListing = true;
     
@@ -77,7 +77,7 @@ public class BlobServiceConfiguration extends 
AbstractConfiguration {
     }
 
     /**
-     * Required blob service operation hint to the producer 
+     * Blob service operation hint to the producer 
      */
     public void setOperation(BlobServiceOperations operation) {
         this.operation = operation;
@@ -215,18 +215,6 @@ public class BlobServiceConfiguration extends 
AbstractConfiguration {
         this.dataLength = dataLength;
     }
 
-    public boolean isPublicForRead() {
-        return publicForRead;
-    }
-
-    /**
-     * Blobs can be public for reading their content, if this property is 
enabled
-     * then the credentials do not have to be set
-     */
-    public void setPublicForRead(boolean publicForRead) {
-        this.publicForRead = publicForRead;
-    }
-
     public String getBlobPrefix() {
         return blobPrefix;
     }
@@ -237,6 +225,18 @@ public class BlobServiceConfiguration extends 
AbstractConfiguration {
     public void setBlobPrefix(String blobPrefix) {
         this.blobPrefix = blobPrefix;
     }
+    
+    public boolean isPublicForRead() {
+        return publicForRead;
+    }
+
+    /**
+     * Storage resources can be public for reading their content, if this 
property is enabled
+     * then the credentials do not have to be set
+     */
+    public void setPublicForRead(boolean publicForRead) {
+        this.publicForRead = publicForRead;
+    }
 
     public boolean isUseFlatListing() {
         return useFlatListing;

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/components/camel-azure/src/main/java/org/apache/camel/component/azure/common/AbstractConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/common/AbstractConfiguration.java
 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/common/AbstractConfiguration.java
index c230044..6f69d5b 100644
--- 
a/components/camel-azure/src/main/java/org/apache/camel/component/azure/common/AbstractConfiguration.java
+++ 
b/components/camel-azure/src/main/java/org/apache/camel/component/azure/common/AbstractConfiguration.java
@@ -48,5 +48,4 @@ public abstract class AbstractConfiguration implements 
Cloneable {
     public void setCredentials(StorageCredentials credentials) {
         this.credentials = credentials;
     }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java
 
b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java
index 326a4e8..b9195e3 100644
--- 
a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java
+++ 
b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java
@@ -226,6 +226,17 @@ public class BlobServiceComponentConfigurationTest extends 
CamelTestSupport {
         }
     }
     
+    @Test
+    public void testTooFewPathSegments() throws Exception {
+        BlobServiceComponent component = new BlobServiceComponent(context);
+        try {
+            component.createEndpoint("azure-blob://camelazure");
+            fail();
+        } catch (IllegalArgumentException ex) {
+            assertEquals("At least the account and container names must be 
specified.", ex.getMessage());
+        }
+    }
+    
     private static void createConsumer(Endpoint endpoint) throws Exception {
         endpoint.createConsumer(new Processor() {
             @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
----------------------------------------------------------------------
diff --git 
a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 
b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index b9abe08..4b5841a 100644
--- 
a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ 
b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -5,6 +5,12 @@
       "name": "camel.component.azure-blob.enabled",
       "description": "Enable azure-blob component",
       "type": "java.lang.Boolean"
+    },
+    {
+      "defaultValue": true,
+      "name": "camel.component.azure-queue.enabled",
+      "description": "Enable azure-queue component",
+      "type": "java.lang.Boolean"
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1b40de61/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git 
a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories
 
b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories
index 7ecd61b..5b8a773 100644
--- 
a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories
+++ 
b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories
@@ -16,4 +16,6 @@
 #
 
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-org.apache.camel.component.azure.blob.springboot.BlobServiceComponentAutoConfiguration
+org.apache.camel.component.azure.blob.springboot.BlobServiceComponentAutoConfiguration,\
+org.apache.camel.component.azure.blob.springboot.QueueServiceComponentAutoConfiguration
+

Reply via email to