Repository: camel Updated Branches: refs/heads/master 0548f87de -> a3b9b0f38
http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/TypeConverter ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/TypeConverter b/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/TypeConverter new file mode 100644 index 0000000..ded98e1 --- /dev/null +++ b/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/TypeConverter @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/component/azure-blob ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/component/azure-blob b/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/component/azure-blob new file mode 100644 index 0000000..285f97d --- /dev/null +++ b/components/camel-azure/src/main/resources/META-INF/services/org/apache/camel/component/azure-blob @@ -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. +## --------------------------------------------------------------------------- + +class=org.apache.camel.component.azure.blob.BlobServiceComponent http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceAppendConsumerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceAppendConsumerTest.java b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceAppendConsumerTest.java new file mode 100644 index 0000000..34fef1c --- /dev/null +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceAppendConsumerTest.java @@ -0,0 +1,93 @@ +/** + * 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.azure.blob; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; + +import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; +import org.apache.camel.EndpointInject; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.impl.JndiRegistry; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.apache.camel.util.IOHelper; +import org.junit.Ignore; +import org.junit.Test; + + +public class BlobServiceAppendConsumerTest extends CamelTestSupport { + @EndpointInject(uri = "direct:start") + ProducerTemplate templateStart; + + @Test + @Ignore + public void testGetAppendBlob() throws Exception { + templateStart.send("direct:start", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody("Append Blob"); + } + }); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMessageCount(1); + + assertMockEndpointsSatisfied(); + File f = mock.getExchanges().get(0).getIn().getBody(File.class); + assertNotNull("File must be set", f); + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + IOHelper.copy(new FileInputStream(f), bos); + String data = bos.toString("UTF-8"); + assertEquals("Append Blob", data); + } finally { + if (f != null) { + f.delete(); + } + } + } + @Override + protected JndiRegistry createRegistry() throws Exception { + JndiRegistry registry = super.createRegistry(); + + registry.bind("creds", + new StorageCredentialsAccountAndKey("camelazure", + "base64EncodedValue")); + + return registry; + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:start") + .to("azure-blob://camelazure/container1/blobAppend?credentials=#creds&operation=updateAppendBlob"); + + from("azure-blob://camelazure/container1/blobAppend?credentials=#creds&blobType=appendblob" + + "&fileDir=" + System.getProperty("java.io.tmpdir")) + .to("mock:result"); + } + }; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceBlockConsumerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceBlockConsumerTest.java b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceBlockConsumerTest.java new file mode 100644 index 0000000..19b9920 --- /dev/null +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceBlockConsumerTest.java @@ -0,0 +1,91 @@ +/** + * 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.azure.blob; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; + +import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; +import org.apache.camel.EndpointInject; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.impl.JndiRegistry; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.apache.camel.util.IOHelper; +import org.junit.Ignore; +import org.junit.Test; + + +public class BlobServiceBlockConsumerTest extends CamelTestSupport { + @EndpointInject(uri = "direct:start") + ProducerTemplate templateStart; + + @Test + @Ignore + public void testGetBlockBlob() throws Exception { + templateStart.send("direct:start", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody("Block Blob"); + } + }); + + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMessageCount(1); + + assertMockEndpointsSatisfied(); + File f = mock.getExchanges().get(0).getIn().getBody(File.class); + assertNotNull("File must be set", f); + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + IOHelper.copy(new FileInputStream(f), bos); + assertEquals("Block Blob", bos.toString("UTF-8")); + } finally { + if (f != null) { + f.delete(); + } + } + } + @Override + protected JndiRegistry createRegistry() throws Exception { + JndiRegistry registry = super.createRegistry(); + + registry.bind("creds", + new StorageCredentialsAccountAndKey("camelazure", + "base64EncodedValue")); + + return registry; + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:start") + .to("azure-blob://camelazure/container1/blobBlock?credentials=#creds&operation=updateBlockBlob"); + + from("azure-blob://camelazure/container1/blobBlock?credentials=#creds&fileDir=" + + System.getProperty("java.io.tmpdir")).to("mock:result"); + } + }; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/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 new file mode 100644 index 0000000..ab23553 --- /dev/null +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceComponentConfigurationTest.java @@ -0,0 +1,203 @@ +/** + * 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.azure.blob; + +import java.net.URI; +import java.util.Collections; + +import com.microsoft.azure.storage.StorageCredentials; +import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; +import com.microsoft.azure.storage.blob.CloudBlockBlob; +import com.microsoft.azure.storage.core.Base64; +import org.apache.camel.Endpoint; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.impl.JndiRegistry; +import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.junit.Test; + +public class BlobServiceComponentConfigurationTest extends CamelTestSupport { + + @Test + public void testCreateEndpointWithMinConfigForClientOnly() throws Exception { + CloudBlockBlob client = + new CloudBlockBlob(URI.create("https://camelazure.blob.core.windows.net/container/blob")); + + JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry(); + registry.bind("azureBlobClient", client); + + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint("azure-blob://camelazure/container/blob?azureBlobClient=#azureBlobClient"); + + doTestCreateEndpointWithMinConfig(endpoint, true); + } + + @Test + public void testCreateEndpointWithMinConfigForCredsOnly() throws Exception { + registerCredentials(); + + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint("azure-blob://camelazure/container/blob?credentials=#creds"); + + doTestCreateEndpointWithMinConfig(endpoint, false); + } + + private void doTestCreateEndpointWithMinConfig(BlobServiceEndpoint endpoint, boolean clientExpected) + throws Exception { + assertEquals("camelazure", endpoint.getConfiguration().getAccountName()); + assertEquals("container", endpoint.getConfiguration().getContainerName()); + assertEquals("blob", endpoint.getConfiguration().getBlobName()); + if (clientExpected) { + assertNotNull(endpoint.getConfiguration().getAzureBlobClient()); + assertNull(endpoint.getConfiguration().getCredentials()); + } else { + assertNull(endpoint.getConfiguration().getAzureBlobClient()); + assertNotNull(endpoint.getConfiguration().getCredentials()); + } + + assertEquals(BlobType.blockblob, endpoint.getConfiguration().getBlobType()); + assertNull(endpoint.getConfiguration().getBlobPrefix()); + assertNull(endpoint.getConfiguration().getFileDir()); + assertEquals(Long.valueOf(0L), endpoint.getConfiguration().getBlobOffset()); + assertNull(endpoint.getConfiguration().getBlobMetadata()); + assertNull(endpoint.getConfiguration().getDataLength()); + assertEquals(BlobServiceOperations.listBlobs, endpoint.getConfiguration().getOperation()); + assertEquals(0, endpoint.getConfiguration().getStreamWriteSize()); + assertEquals(0, endpoint.getConfiguration().getStreamReadSize()); + assertTrue(endpoint.getConfiguration().isCloseStreamAfterRead()); + assertTrue(endpoint.getConfiguration().isCloseStreamAfterWrite()); + assertFalse(endpoint.getConfiguration().isPublicForRead()); + assertTrue(endpoint.getConfiguration().isUseFlatListing()); + + createConsumer(endpoint); + } + + @Test + public void testCreateEndpointWithMaxConfig() throws Exception { + registerCredentials(); + ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()) + .bind("metadata", Collections.emptyMap()); + + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint( + "azure-blob://camelazure/container/blob?credentials=#creds&blobType=pageblob" + + "&blobPrefix=blob1&fileDir=/tmp&blobOffset=512&operation=clearPageBlob&dataLength=1024" + + "&streamWriteSize=512&streamReadSize=1024&closeStreamAfterRead=false&closeStreamAfterWrite=false" + + "&publicForRead=true&useFlatListing=false&blobMetadata=#metadata"); + + assertEquals("camelazure", endpoint.getConfiguration().getAccountName()); + assertEquals("container", endpoint.getConfiguration().getContainerName()); + assertEquals("blob", endpoint.getConfiguration().getBlobName()); + assertNull(endpoint.getConfiguration().getAzureBlobClient()); + assertNotNull(endpoint.getConfiguration().getCredentials()); + + assertEquals(BlobType.pageblob, endpoint.getConfiguration().getBlobType()); + assertEquals("blob1", endpoint.getConfiguration().getBlobPrefix()); + assertEquals("/tmp", endpoint.getConfiguration().getFileDir()); + assertEquals(Long.valueOf(512L), endpoint.getConfiguration().getBlobOffset()); + assertNotNull(endpoint.getConfiguration().getBlobMetadata()); + assertEquals(Long.valueOf(1024L), endpoint.getConfiguration().getDataLength()); + assertEquals(BlobServiceOperations.clearPageBlob, endpoint.getConfiguration().getOperation()); + assertEquals(512, endpoint.getConfiguration().getStreamWriteSize()); + assertEquals(1024, endpoint.getConfiguration().getStreamReadSize()); + assertFalse(endpoint.getConfiguration().isCloseStreamAfterRead()); + assertFalse(endpoint.getConfiguration().isCloseStreamAfterWrite()); + assertTrue(endpoint.getConfiguration().isPublicForRead()); + assertFalse(endpoint.getConfiguration().isUseFlatListing()); + } + + @Test + public void testNoClientAndCredentials() throws Exception { + BlobServiceComponent component = new BlobServiceComponent(context); + try { + component.createEndpoint("azure-blob://camelazure/container/blob"); + fail(); + } catch (IllegalArgumentException ex) { + assertEquals("Credentials must be specified.", ex.getMessage()); + } + } + @Test + public void testNoClientAndCredentialsPublicForRead() throws Exception { + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint("azure-blob://camelazure/container/blob?publicForRead=true"); + assertTrue(endpoint.getConfiguration().isPublicForRead()); + } + + + @Test + public void testNoBlobNameProducerWithOp() throws Exception { + registerCredentials(); + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpointWithOp = + (BlobServiceEndpoint) component.createEndpoint( + "azure-blob://camelazure/container?operation=deleteBlob&credentials=#creds"); + try { + endpointWithOp.createProducer(); + fail(); + } catch (IllegalArgumentException ex) { + assertEquals("Blob name must be specified.", ex.getMessage()); + } + } + @Test + public void testNoBlobNameProducerDefaultOp() throws Exception { + registerCredentials(); + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint( + "azure-blob://camelazure/container?credentials=#creds"); + endpoint.createProducer(); + assertEquals(BlobServiceOperations.listBlobs, endpoint.getConfiguration().getOperation()); + } + + @Test + public void testNoBlobNameConsumer() throws Exception { + registerCredentials(); + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint( + "azure-blob://camelazure/container?credentials=#creds"); + try { + createConsumer(endpoint); + fail(); + } catch (IllegalArgumentException ex) { + assertEquals("Blob name must be specified.", ex.getMessage()); + } + } + + private static void createConsumer(Endpoint endpoint) throws Exception { + endpoint.createConsumer(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + // TODO Auto-generated method stub + + } + }); + } + + private void registerCredentials() { + StorageCredentials creds = new StorageCredentialsAccountAndKey("camelazure", + Base64.encode("key".getBytes())); + JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry(); + registry.bind("creds", creds); + } +} http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest.java b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest.java new file mode 100644 index 0000000..05265a4 --- /dev/null +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest.java @@ -0,0 +1,136 @@ +/** + * 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.azure.blob; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.util.Arrays; + +import org.apache.camel.EndpointInject; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.spring.CamelSpringTestSupport; +import org.junit.Ignore; +import org.junit.Test; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class BlobServiceProducerSpringTest extends CamelSpringTestSupport { + + @EndpointInject(uri = "direct:start") + private ProducerTemplate template; + + @EndpointInject(uri = "mock:result") + private MockEndpoint result; + + @Test + @Ignore + public void testUpdateBlockBlob() throws Exception { + result.expectedMessageCount(1); + + template.send("direct:updateBlockBlob", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody("Block Blob"); + } + }); + + assertMockEndpointsSatisfied(); + + assertResultExchange(result.getExchanges().get(0)); + + } + + @Test + @Ignore + public void testUploadBlobBlocks() throws Exception { + result.expectedMessageCount(1); + final BlobBlock st = new BlobBlock(new ByteArrayInputStream("Block Blob List".getBytes())); + template.send("direct:uploadBlobBlocks", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody(st); + } + }); + + assertMockEndpointsSatisfied(); + + assertResultExchange(result.getExchanges().get(0)); + + } + @Test + @Ignore + public void testGetBlockBlob() throws Exception { + result.expectedMessageCount(1); + OutputStream os = new ByteArrayOutputStream(); + template.send("direct:getBlockBlob", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody(os); + } + }); + + assertMockEndpointsSatisfied(); + + assertResultExchange(result.getExchanges().get(0)); + + } + + @Test + @Ignore + public void testUpdateAppendBlob() throws Exception { + result.expectedMessageCount(1); + + template.send("direct:updateAppendBlob", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody("Append Blob"); + } + }); + + assertMockEndpointsSatisfied(); + + assertResultExchange(result.getExchanges().get(0)); + + } + + @Test + @Ignore + public void testUpdatePageBlob() throws Exception { + result.expectedMessageCount(1); + final byte[] data = new byte[512]; + Arrays.fill(data, (byte)1); + template.send("direct:updatePageBlob", ExchangePattern.InOnly, new Processor() { + public void process(Exchange exchange) throws Exception { + exchange.getIn().setBody(new ByteArrayInputStream(data)); + } + }); + + assertMockEndpointsSatisfied(); + + assertResultExchange(result.getExchanges().get(0)); + + } + + private void assertResultExchange(Exchange resultExchange) { + } + + @Override + protected ClassPathXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest-context.xml"); + } + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceUtilTest.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceUtilTest.java b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceUtilTest.java new file mode 100644 index 0000000..404daff --- /dev/null +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/blob/BlobServiceUtilTest.java @@ -0,0 +1,48 @@ +/** + * 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.azure.blob; + +import java.net.URI; + +import com.microsoft.azure.storage.StorageCredentials; +import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; +import com.microsoft.azure.storage.core.Base64; +import org.apache.camel.impl.JndiRegistry; +import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.junit.Test; + + +public class BlobServiceUtilTest extends CamelTestSupport { + @Test + public void testPrepareUri() throws Exception { + registerCredentials(); + + BlobServiceComponent component = new BlobServiceComponent(context); + BlobServiceEndpoint endpoint = + (BlobServiceEndpoint) component.createEndpoint("azure-blob://camelazure/container/blob?credentials=#creds"); + URI uri = + BlobServiceUtil.prepareStorageBlobUri(endpoint.getConfiguration()); + assertEquals("https://camelazure.blob.core.windows.net/container/blob", uri.toString()); + } + private void registerCredentials() { + StorageCredentials creds = new StorageCredentialsAccountAndKey("camelazure", + Base64.encode("key".getBytes())); + JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry(); + registry.bind("creds", creds); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/resources/log4j2.properties ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/resources/log4j2.properties b/components/camel-azure/src/test/resources/log4j2.properties new file mode 100644 index 0000000..07111be --- /dev/null +++ b/components/camel-azure/src/test/resources/log4j2.properties @@ -0,0 +1,28 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-aws-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/camel-azure/src/test/resources/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest-context.xml ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/resources/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest-context.xml b/components/camel-azure/src/test/resources/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest-context.xml new file mode 100644 index 0000000..fe31fda --- /dev/null +++ b/components/camel-azure/src/test/resources/org/apache/camel/component/azure/blob/BlobServiceProducerSpringTest-context.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version + 2.0 (the "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 Unless required by + applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and + limitations under the License. +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> + + <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:updateBlockBlob"/> + <to uri="azure-blob://camelazure/container1/blob1?credentials=#credentials&operation=updateBlockBlob"/> + <to uri="mock:result"/> + </route> + <route> + <from uri="direct:getBlockBlob"/> + <to uri="azure-blob://camelazure/container1/blob1?credentials=#credentials&operation=getBlockBlob"/> + <to uri="mock:result"/> + </route> + <route> + <from uri="direct:uploadBlobBlocks"/> + <to uri="azure-blob://camelazure/container1/blob1?credentials=#credentials&operation=uploadBlobBlocks"/> + <to uri="mock:result"/> + </route> + <route> + <from uri="direct:updateAppendBlob"/> + <to uri="azure-blob://camelazure/container1/blob1?credentials=#credentials&operation=updateAppendBlob"/> + <to uri="mock:result"/> + </route> + <route> + <from uri="direct:updatePageBlob"/> + <to uri="azure-blob://camelazure/container1/blob1?credentials=#credentials&operation=updatePageBlob"/> + <to uri="mock:result"/> + </route> + + </camelContext> + + <bean id="credentials" class="com.microsoft.azure.storage.StorageCredentialsAccountAndKey"> + <constructor-arg value="camelazure"/> + <constructor-arg value="base64EncodedValue"/> + </bean> +</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/components/pom.xml ---------------------------------------------------------------------- diff --git a/components/pom.xml b/components/pom.xml index def344c..b265d79 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -72,6 +72,7 @@ <module>camel-atom</module> <module>camel-avro</module> <module>camel-aws</module> + <module>camel-azure</module> <module>camel-base64</module> <module>camel-beanio</module> <module>camel-beanstalk</module> http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/platforms/spring-boot/components-starter/camel-azure-starter/pom.xml ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/pom.xml b/platforms/spring-boot/components-starter/camel-azure-starter/pom.xml new file mode 100644 index 0000000..ed2c702 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-starter/pom.xml @@ -0,0 +1,51 @@ +<?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-azure-starter</artifactId> + <packaging>jar</packaging> + <name>Spring-Boot Starter :: Camel :: Azure</name> + <description>Spring-Boot Starter for Camel Microsoft Azure 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-azure</artifactId> + <version>${project.version}</version> + </dependency> + <!--START OF GENERATED CODE--> + <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> + <!--END OF GENERATED CODE--> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java new file mode 100644 index 0000000..fdb4dfc --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java @@ -0,0 +1,80 @@ +/** + * 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.azure.blob.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.component.azure.blob.BlobServiceComponent; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionMessage; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.SpringBootCondition; +import org.springframework.boot.bind.RelaxedPropertyResolver; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.core.type.AnnotatedTypeMetadata; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") +@Conditional(BlobServiceComponentAutoConfiguration.Condition.class) +@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") +public class BlobServiceComponentAutoConfiguration { + + @Lazy + @Bean(name = "azure-blob-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(BlobServiceComponent.class) + public BlobServiceComponent configureBlobServiceComponent( + CamelContext camelContext) throws Exception { + BlobServiceComponent component = new BlobServiceComponent(); + component.setCamelContext(camelContext); + return component; + } + + public static class Condition extends SpringBootCondition { + @Override + public ConditionOutcome getMatchOutcome( + ConditionContext conditionContext, + AnnotatedTypeMetadata annotatedTypeMetadata) { + boolean groupEnabled = isEnabled(conditionContext, + "camel.component.", true); + ConditionMessage.Builder message = ConditionMessage + .forCondition("camel.component.azure-blob"); + if (isEnabled(conditionContext, "camel.component.azure-blob.", + groupEnabled)) { + return ConditionOutcome.match(message.because("enabled")); + } + return ConditionOutcome.noMatch(message.because("not enabled")); + } + + private boolean isEnabled( + org.springframework.context.annotation.ConditionContext context, + java.lang.String prefix, boolean defaultValue) { + RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( + context.getEnvironment(), prefix); + return resolver.getProperty("enabled", Boolean.class, defaultValue); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-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/a3b9b0f3/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/NOTICE.txt new file mode 100644 index 0000000..2e215bf --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-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/a3b9b0f3/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 new file mode 100644 index 0000000..b9abe08 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,10 @@ +{ + "properties": [ + { + "defaultValue": true, + "name": "camel.component.azure-blob.enabled", + "description": "Enable azure-blob component", + "type": "java.lang.Boolean" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/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 new file mode 100644 index 0000000..7ecd61b --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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.azure.blob.springboot.BlobServiceComponentAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.provides ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000..f69c8d2 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-azure-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-azure \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/a3b9b0f3/platforms/spring-boot/components-starter/pom.xml ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml index 052e3d8..d2ca7fa 100644 --- a/platforms/spring-boot/components-starter/pom.xml +++ b/platforms/spring-boot/components-starter/pom.xml @@ -83,6 +83,7 @@ <module>camel-atom-starter</module> <module>camel-avro-starter</module> <module>camel-aws-starter</module> + <module>camel-azure-starter</module> <module>camel-bam-starter</module> <module>camel-barcode-starter</module> <module>camel-base64-starter</module>