This is an automated email from the ASF dual-hosted git repository. oalsafi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 3deb2cd CAMEL-15198: Add more configurations from headers configurations into component/endpoint configurations (#4042) 3deb2cd is described below commit 3deb2cd5aaf14b39faa178cafec931dad4d0b694 Author: Omar Al-Safi <omars...@gmail.com> AuthorDate: Fri Jul 24 15:27:51 2020 +0200 CAMEL-15198: Add more configurations from headers configurations into component/endpoint configurations (#4042) * CAMEL-15198: Start refactor the configurations * CAMEL-15198: Finish up the refactor configuration --- .../storage/blob/BlobComponentConfigurer.java | 46 +++ .../azure/storage/blob/BlobEndpointConfigurer.java | 46 +++ .../azure/storage/blob/azure-storage-blob.json | 20 + .../main/docs/azure-storage-blob-component.adoc | 24 +- .../azure/storage/blob/BlobConfiguration.java | 133 +++++++ .../blob/BlobConfigurationOptionsProxy.java | 201 ++++++++++ .../component/azure/storage/blob/BlobProducer.java | 17 +- .../component/azure/storage/blob/BlobUtils.java | 11 - .../blob/operations/BlobContainerOperations.java | 41 +-- .../storage/blob/operations/BlobOperations.java | 124 +++---- .../blob/operations/BlobServiceOperations.java | 11 +- .../blob/BlobConfigurationOptionsProxyTest.java | 52 +++ .../azure/storage/blob/BlobProducerIT.java | 13 + .../blob/operations/BlobContainerOperationsIT.java | 2 +- .../operations/BlobContainerOperationsTest.java | 6 +- .../AzureStorageBlobComponentBuilderFactory.java | 147 ++++++++ .../builder/endpoint/StaticEndpointBuilders.java | 4 +- .../endpoint/dsl/BlobEndpointBuilderFactory.java | 403 +++++++++++++++++++++ 18 files changed, 1179 insertions(+), 122 deletions(-) diff --git a/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobComponentConfigurer.java b/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobComponentConfigurer.java index d12376e..4206e08 100644 --- a/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobComponentConfigurer.java +++ b/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobComponentConfigurer.java @@ -34,27 +34,45 @@ public class BlobComponentConfigurer extends PropertyConfigurerSupport implement case "blobName": getOrCreateConfiguration(target).setBlobName(property(camelContext, java.lang.String.class, value)); return true; case "bloboffset": case "blobOffset": getOrCreateConfiguration(target).setBlobOffset(property(camelContext, long.class, value)); return true; + case "blobsequencenumber": + case "blobSequenceNumber": getOrCreateConfiguration(target).setBlobSequenceNumber(property(camelContext, java.lang.Long.class, value)); return true; case "blobtype": case "blobType": getOrCreateConfiguration(target).setBlobType(property(camelContext, org.apache.camel.component.azure.storage.blob.BlobType.class, value)); return true; + case "blocklisttype": + case "blockListType": getOrCreateConfiguration(target).setBlockListType(property(camelContext, com.azure.storage.blob.models.BlockListType.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; case "closestreamafterread": case "closeStreamAfterRead": getOrCreateConfiguration(target).setCloseStreamAfterRead(property(camelContext, boolean.class, value)); return true; case "closestreamafterwrite": case "closeStreamAfterWrite": getOrCreateConfiguration(target).setCloseStreamAfterWrite(property(camelContext, boolean.class, value)); return true; + case "commitblocklistlater": + case "commitBlockListLater": getOrCreateConfiguration(target).setCommitBlockListLater(property(camelContext, boolean.class, value)); return true; case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.azure.storage.blob.BlobConfiguration.class, value)); return true; + case "createappendblob": + case "createAppendBlob": getOrCreateConfiguration(target).setCreateAppendBlob(property(camelContext, boolean.class, value)); return true; + case "createpageblob": + case "createPageBlob": getOrCreateConfiguration(target).setCreatePageBlob(property(camelContext, boolean.class, value)); return true; case "credentials": getOrCreateConfiguration(target).setCredentials(property(camelContext, com.azure.storage.common.StorageSharedKeyCredential.class, value)); return true; case "datacount": case "dataCount": getOrCreateConfiguration(target).setDataCount(property(camelContext, java.lang.Long.class, value)); return true; + case "downloadlinkexpiration": + case "downloadLinkExpiration": getOrCreateConfiguration(target).setDownloadLinkExpiration(property(camelContext, java.lang.Long.class, value)); return true; case "filedir": case "fileDir": getOrCreateConfiguration(target).setFileDir(property(camelContext, java.lang.String.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + case "maxresultsperpage": + case "maxResultsPerPage": getOrCreateConfiguration(target).setMaxResultsPerPage(property(camelContext, java.lang.Integer.class, value)); return true; case "maxretryrequests": case "maxRetryRequests": getOrCreateConfiguration(target).setMaxRetryRequests(property(camelContext, int.class, value)); return true; case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition.class, value)); return true; + case "pageblobsize": + case "pageBlobSize": getOrCreateConfiguration(target).setPageBlobSize(property(camelContext, java.lang.Long.class, value)); return true; + case "prefix": getOrCreateConfiguration(target).setPrefix(property(camelContext, java.lang.String.class, value)); return true; case "serviceclient": case "serviceClient": getOrCreateConfiguration(target).setServiceClient(property(camelContext, com.azure.storage.blob.BlobServiceClient.class, value)); return true; + case "timeout": getOrCreateConfiguration(target).setTimeout(property(camelContext, java.time.Duration.class, value)); return true; default: return false; } } @@ -66,18 +84,28 @@ public class BlobComponentConfigurer extends PropertyConfigurerSupport implement answer.put("basicPropertyBinding", boolean.class); answer.put("blobName", java.lang.String.class); answer.put("blobOffset", long.class); + answer.put("blobSequenceNumber", java.lang.Long.class); answer.put("blobType", org.apache.camel.component.azure.storage.blob.BlobType.class); + answer.put("blockListType", com.azure.storage.blob.models.BlockListType.class); answer.put("bridgeErrorHandler", boolean.class); answer.put("closeStreamAfterRead", boolean.class); answer.put("closeStreamAfterWrite", boolean.class); + answer.put("commitBlockListLater", boolean.class); answer.put("configuration", org.apache.camel.component.azure.storage.blob.BlobConfiguration.class); + answer.put("createAppendBlob", boolean.class); + answer.put("createPageBlob", boolean.class); answer.put("credentials", com.azure.storage.common.StorageSharedKeyCredential.class); answer.put("dataCount", java.lang.Long.class); + answer.put("downloadLinkExpiration", java.lang.Long.class); answer.put("fileDir", java.lang.String.class); answer.put("lazyStartProducer", boolean.class); + answer.put("maxResultsPerPage", java.lang.Integer.class); answer.put("maxRetryRequests", int.class); answer.put("operation", org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition.class); + answer.put("pageBlobSize", java.lang.Long.class); + answer.put("prefix", java.lang.String.class); answer.put("serviceClient", com.azure.storage.blob.BlobServiceClient.class); + answer.put("timeout", java.time.Duration.class); return answer; } @@ -93,27 +121,45 @@ public class BlobComponentConfigurer extends PropertyConfigurerSupport implement case "blobName": return getOrCreateConfiguration(target).getBlobName(); case "bloboffset": case "blobOffset": return getOrCreateConfiguration(target).getBlobOffset(); + case "blobsequencenumber": + case "blobSequenceNumber": return getOrCreateConfiguration(target).getBlobSequenceNumber(); case "blobtype": case "blobType": return getOrCreateConfiguration(target).getBlobType(); + case "blocklisttype": + case "blockListType": return getOrCreateConfiguration(target).getBlockListType(); case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); case "closestreamafterread": case "closeStreamAfterRead": return getOrCreateConfiguration(target).isCloseStreamAfterRead(); case "closestreamafterwrite": case "closeStreamAfterWrite": return getOrCreateConfiguration(target).isCloseStreamAfterWrite(); + case "commitblocklistlater": + case "commitBlockListLater": return getOrCreateConfiguration(target).isCommitBlockListLater(); case "configuration": return target.getConfiguration(); + case "createappendblob": + case "createAppendBlob": return getOrCreateConfiguration(target).isCreateAppendBlob(); + case "createpageblob": + case "createPageBlob": return getOrCreateConfiguration(target).isCreatePageBlob(); case "credentials": return getOrCreateConfiguration(target).getCredentials(); case "datacount": case "dataCount": return getOrCreateConfiguration(target).getDataCount(); + case "downloadlinkexpiration": + case "downloadLinkExpiration": return getOrCreateConfiguration(target).getDownloadLinkExpiration(); case "filedir": case "fileDir": return getOrCreateConfiguration(target).getFileDir(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); + case "maxresultsperpage": + case "maxResultsPerPage": return getOrCreateConfiguration(target).getMaxResultsPerPage(); case "maxretryrequests": case "maxRetryRequests": return getOrCreateConfiguration(target).getMaxRetryRequests(); case "operation": return getOrCreateConfiguration(target).getOperation(); + case "pageblobsize": + case "pageBlobSize": return getOrCreateConfiguration(target).getPageBlobSize(); + case "prefix": return getOrCreateConfiguration(target).getPrefix(); case "serviceclient": case "serviceClient": return getOrCreateConfiguration(target).getServiceClient(); + case "timeout": return getOrCreateConfiguration(target).getTimeout(); default: return null; } } diff --git a/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobEndpointConfigurer.java b/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobEndpointConfigurer.java index dcb2a89..3e0bc8e 100644 --- a/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobEndpointConfigurer.java +++ b/components/camel-azure-storage-blob/src/generated/java/org/apache/camel/component/azure/storage/blob/BlobEndpointConfigurer.java @@ -27,19 +27,31 @@ public class BlobEndpointConfigurer extends PropertyConfigurerSupport implements case "blobName": target.getConfiguration().setBlobName(property(camelContext, java.lang.String.class, value)); return true; case "bloboffset": case "blobOffset": target.getConfiguration().setBlobOffset(property(camelContext, long.class, value)); return true; + case "blobsequencenumber": + case "blobSequenceNumber": target.getConfiguration().setBlobSequenceNumber(property(camelContext, java.lang.Long.class, value)); return true; case "blobserviceclient": case "blobServiceClient": target.setBlobServiceClient(property(camelContext, com.azure.storage.blob.BlobServiceClient.class, value)); return true; case "blobtype": case "blobType": target.getConfiguration().setBlobType(property(camelContext, org.apache.camel.component.azure.storage.blob.BlobType.class, value)); return true; + case "blocklisttype": + case "blockListType": target.getConfiguration().setBlockListType(property(camelContext, com.azure.storage.blob.models.BlockListType.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; case "closestreamafterread": case "closeStreamAfterRead": target.getConfiguration().setCloseStreamAfterRead(property(camelContext, boolean.class, value)); return true; case "closestreamafterwrite": case "closeStreamAfterWrite": target.getConfiguration().setCloseStreamAfterWrite(property(camelContext, boolean.class, value)); return true; + case "commitblocklistlater": + case "commitBlockListLater": target.getConfiguration().setCommitBlockListLater(property(camelContext, boolean.class, value)); return true; + case "createappendblob": + case "createAppendBlob": target.getConfiguration().setCreateAppendBlob(property(camelContext, boolean.class, value)); return true; + case "createpageblob": + case "createPageBlob": target.getConfiguration().setCreatePageBlob(property(camelContext, boolean.class, value)); return true; case "credentials": target.getConfiguration().setCredentials(property(camelContext, com.azure.storage.common.StorageSharedKeyCredential.class, value)); return true; case "datacount": case "dataCount": target.getConfiguration().setDataCount(property(camelContext, java.lang.Long.class, value)); return true; + case "downloadlinkexpiration": + case "downloadLinkExpiration": target.getConfiguration().setDownloadLinkExpiration(property(camelContext, java.lang.Long.class, value)); return true; case "exceptionhandler": case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true; case "exchangepattern": @@ -48,12 +60,18 @@ public class BlobEndpointConfigurer extends PropertyConfigurerSupport implements case "fileDir": target.getConfiguration().setFileDir(property(camelContext, java.lang.String.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; + case "maxresultsperpage": + case "maxResultsPerPage": target.getConfiguration().setMaxResultsPerPage(property(camelContext, java.lang.Integer.class, value)); return true; case "maxretryrequests": case "maxRetryRequests": target.getConfiguration().setMaxRetryRequests(property(camelContext, int.class, value)); return true; case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition.class, value)); return true; + case "pageblobsize": + case "pageBlobSize": target.getConfiguration().setPageBlobSize(property(camelContext, java.lang.Long.class, value)); return true; + case "prefix": target.getConfiguration().setPrefix(property(camelContext, java.lang.String.class, value)); return true; case "serviceclient": case "serviceClient": target.getConfiguration().setServiceClient(property(camelContext, com.azure.storage.blob.BlobServiceClient.class, value)); return true; case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true; + case "timeout": target.getConfiguration().setTimeout(property(camelContext, java.time.Duration.class, value)); return true; default: return false; } } @@ -65,21 +83,31 @@ public class BlobEndpointConfigurer extends PropertyConfigurerSupport implements answer.put("basicPropertyBinding", boolean.class); answer.put("blobName", java.lang.String.class); answer.put("blobOffset", long.class); + answer.put("blobSequenceNumber", java.lang.Long.class); answer.put("blobServiceClient", com.azure.storage.blob.BlobServiceClient.class); answer.put("blobType", org.apache.camel.component.azure.storage.blob.BlobType.class); + answer.put("blockListType", com.azure.storage.blob.models.BlockListType.class); answer.put("bridgeErrorHandler", boolean.class); answer.put("closeStreamAfterRead", boolean.class); answer.put("closeStreamAfterWrite", boolean.class); + answer.put("commitBlockListLater", boolean.class); + answer.put("createAppendBlob", boolean.class); + answer.put("createPageBlob", boolean.class); answer.put("credentials", com.azure.storage.common.StorageSharedKeyCredential.class); answer.put("dataCount", java.lang.Long.class); + answer.put("downloadLinkExpiration", java.lang.Long.class); answer.put("exceptionHandler", org.apache.camel.spi.ExceptionHandler.class); answer.put("exchangePattern", org.apache.camel.ExchangePattern.class); answer.put("fileDir", java.lang.String.class); answer.put("lazyStartProducer", boolean.class); + answer.put("maxResultsPerPage", java.lang.Integer.class); answer.put("maxRetryRequests", int.class); answer.put("operation", org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition.class); + answer.put("pageBlobSize", java.lang.Long.class); + answer.put("prefix", java.lang.String.class); answer.put("serviceClient", com.azure.storage.blob.BlobServiceClient.class); answer.put("synchronous", boolean.class); + answer.put("timeout", java.time.Duration.class); return answer; } @@ -95,19 +123,31 @@ public class BlobEndpointConfigurer extends PropertyConfigurerSupport implements case "blobName": return target.getConfiguration().getBlobName(); case "bloboffset": case "blobOffset": return target.getConfiguration().getBlobOffset(); + case "blobsequencenumber": + case "blobSequenceNumber": return target.getConfiguration().getBlobSequenceNumber(); case "blobserviceclient": case "blobServiceClient": return target.getBlobServiceClient(); case "blobtype": case "blobType": return target.getConfiguration().getBlobType(); + case "blocklisttype": + case "blockListType": return target.getConfiguration().getBlockListType(); case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); case "closestreamafterread": case "closeStreamAfterRead": return target.getConfiguration().isCloseStreamAfterRead(); case "closestreamafterwrite": case "closeStreamAfterWrite": return target.getConfiguration().isCloseStreamAfterWrite(); + case "commitblocklistlater": + case "commitBlockListLater": return target.getConfiguration().isCommitBlockListLater(); + case "createappendblob": + case "createAppendBlob": return target.getConfiguration().isCreateAppendBlob(); + case "createpageblob": + case "createPageBlob": return target.getConfiguration().isCreatePageBlob(); case "credentials": return target.getConfiguration().getCredentials(); case "datacount": case "dataCount": return target.getConfiguration().getDataCount(); + case "downloadlinkexpiration": + case "downloadLinkExpiration": return target.getConfiguration().getDownloadLinkExpiration(); case "exceptionhandler": case "exceptionHandler": return target.getExceptionHandler(); case "exchangepattern": @@ -116,12 +156,18 @@ public class BlobEndpointConfigurer extends PropertyConfigurerSupport implements case "fileDir": return target.getConfiguration().getFileDir(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); + case "maxresultsperpage": + case "maxResultsPerPage": return target.getConfiguration().getMaxResultsPerPage(); case "maxretryrequests": case "maxRetryRequests": return target.getConfiguration().getMaxRetryRequests(); case "operation": return target.getConfiguration().getOperation(); + case "pageblobsize": + case "pageBlobSize": return target.getConfiguration().getPageBlobSize(); + case "prefix": return target.getConfiguration().getPrefix(); case "serviceclient": case "serviceClient": return target.getConfiguration().getServiceClient(); case "synchronous": return target.isSynchronous(); + case "timeout": return target.getConfiguration().getTimeout(); default: return null; } } diff --git a/components/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json b/components/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json index d5dfa55..4feb63c 100644 --- a/components/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json +++ b/components/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json @@ -29,12 +29,22 @@ "credentials": { "kind": "property", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client, this holds the important authent [...] "dataCount": { "kind": "property", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." }, "fileDir": { "kind": "property", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer" }, + "maxResultsPerPage": { "kind": "property", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify [...] "maxRetryRequests": { "kind": "property", "displayName": "Max Retry Requests", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "0", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a re [...] + "prefix": { "kind": "property", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs." }, "serviceClient": { "kind": "property", "displayName": "Service Client", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.blob.BlobServiceClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Client to a storage account. This client does not hold any state about a particular storage account but is in [...] + "timeout": { "kind": "property", "displayName": "Timeout", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "java.time.Duration", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "An optional timeout value beyond which a RuntimeException will be raised." }, "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "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 [...] + "blobSequenceNumber": { "kind": "property", "displayName": "Blob Sequence Number", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "defaultValue": "0", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "A user-controlled value that you can use to track requests. The value of the sequence number [...] + "blockListType": { "kind": "property", "displayName": "Block List Type", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.azure.storage.blob.models.BlockListType", "enum": [ "committed", "uncommitted", "all" ], "deprecated": false, "secret": false, "defaultValue": "committed", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies which typ [...] "closeStreamAfterWrite": { "kind": "property", "displayName": "Close Stream After Write", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after write or keep it open, default is true" }, + "commitBlockListLater": { "kind": "property", "displayName": "Commit Block List Later", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the staged blocks will not be committed directly." }, + "createAppendBlob": { "kind": "property", "displayName": "Create Append Blob", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the append blocks will be created when committing append blocks." }, + "createPageBlob": { "kind": "property", "displayName": "Create Page Blob", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the page blob will be created when uploading page blob." }, + "downloadLinkExpiration": { "kind": "property", "displayName": "Download Link Expiration", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Override the default expiration (millis) of URL download link." }, "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the r [...] "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition", "enum": [ "listBlobContainers", "createBlobContainer", "deleteBlobContainer", "listBlobs", "getBlob", "deleteBlob", "downloadBlobToFile", "downloadLink", "uploadBlockBlob", "stageBlockBlobList", "commitBlobBlockList", "getBlobBlockList", "createAppendBlob", "c [...] + "pageBlobSize": { "kind": "property", "displayName": "Page Blob Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "defaultValue": "512", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512- [...] "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Access key for the associated azure account name to be used for authentication with azure blob services" } }, @@ -49,14 +59,24 @@ "credentials": { "kind": "parameter", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client, this holds the important authen [...] "dataCount": { "kind": "parameter", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." }, "fileDir": { "kind": "parameter", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer" }, + "maxResultsPerPage": { "kind": "parameter", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specif [...] "maxRetryRequests": { "kind": "parameter", "displayName": "Max Retry Requests", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "0", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a r [...] + "prefix": { "kind": "parameter", "displayName": "Prefix", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs." }, "serviceClient": { "kind": "parameter", "displayName": "Service Client", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.blob.BlobServiceClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Client to a storage account. This client does not hold any state about a particular storage account but is i [...] + "timeout": { "kind": "parameter", "displayName": "Timeout", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "java.time.Duration", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "An optional timeout value beyond which a RuntimeException will be raised." }, "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "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 b [...] "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with [...] "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "blobSequenceNumber": { "kind": "parameter", "displayName": "Blob Sequence Number", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "defaultValue": "0", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "A user-controlled value that you can use to track requests. The value of the sequence numbe [...] + "blockListType": { "kind": "parameter", "displayName": "Block List Type", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.azure.storage.blob.models.BlockListType", "enum": [ "committed", "uncommitted", "all" ], "deprecated": false, "secret": false, "defaultValue": "committed", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies which ty [...] "closeStreamAfterWrite": { "kind": "parameter", "displayName": "Close Stream After Write", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after write or keep it open, default is true" }, + "commitBlockListLater": { "kind": "parameter", "displayName": "Commit Block List Later", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the staged blocks will not be committed directly." }, + "createAppendBlob": { "kind": "parameter", "displayName": "Create Append Blob", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the append blocks will be created when committing append blocks." }, + "createPageBlob": { "kind": "parameter", "displayName": "Create Page Blob", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "When is set to true, the page blob will be created when uploading page blob." }, + "downloadLinkExpiration": { "kind": "parameter", "displayName": "Download Link Expiration", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Override the default expiration (millis) of URL download link." }, "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the [...] "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition", "enum": [ "listBlobContainers", "createBlobContainer", "deleteBlobContainer", "listBlobs", "getBlob", "deleteBlob", "downloadBlobToFile", "downloadLink", "uploadBlockBlob", "stageBlockBlobList", "commitBlobBlockList", "getBlobBlockList", "createAppendBlob", " [...] + "pageBlobSize": { "kind": "parameter", "displayName": "Page Blob Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "defaultValue": "512", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512 [...] "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." }, "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Access key for the associated azure account name to be used for authentication with azure blob services" } diff --git a/components/camel-azure-storage-blob/src/main/docs/azure-storage-blob-component.adoc b/components/camel-azure-storage-blob/src/main/docs/azure-storage-blob-component.adoc index fd5e2ea..417054d 100644 --- a/components/camel-azure-storage-blob/src/main/docs/azure-storage-blob-component.adoc +++ b/components/camel-azure-storage-blob/src/main/docs/azure-storage-blob-component.adoc @@ -64,7 +64,7 @@ to("file://blobdirectory"); // component options: START -The Azure Storage Blob Service component supports 16 options, which are listed below. +The Azure Storage Blob Service component supports 26 options, which are listed below. @@ -79,12 +79,22 @@ The Azure Storage Blob Service component supports 16 options, which are listed b | *credentials* (common) | StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information | | StorageSharedKeyCredential | *dataCount* (common) | How many bytes to include in the range. Must be greater than or equal to 0 if specified. | | Long | *fileDir* (common) | The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer | | String +| *maxResultsPerPage* (common) | Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxResultsPerPage or specifies a value greater than 5,000, the server will return up to 5,000 items. | | Integer | *maxRetryRequests* (common) | Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a response body. | 0 | int +| *prefix* (common) | Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs. | | String | *serviceClient* (common) | Client to a storage account. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct URLs to blobs and containers. This client contains operations on a service account. Operations on a container are available on BlobContainerClient through getBlobContainerClient(String), and operations on a blob are available on B [...] +| *timeout* (common) | An optional timeout value beyond which a RuntimeException will be raised. | | Duration | *bridgeErrorHandler* (consumer) | 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. | false | boolean +| *blobSequenceNumber* (producer) | A user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 263 - 1.The default value is 0. | 0 | Long +| *blockListType* (producer) | Specifies which type of blocks to return. The value can be one of: committed, uncommitted, all | committed | BlockListType | *closeStreamAfterWrite* (producer) | Close the stream after write or keep it open, default is true | true | boolean +| *commitBlockListLater* (producer) | When is set to true, the staged blocks will not be committed directly. | true | boolean +| *createAppendBlob* (producer) | When is set to true, the append blocks will be created when committing append blocks. | true | boolean +| *createPageBlob* (producer) | When is set to true, the page blob will be created when uploading page blob. | true | boolean +| *downloadLinkExpiration* (producer) | Override the default expiration (millis) of URL download link. | | Long | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *operation* (producer) | The blob operation that can be used with this component on the producer. The value can be one of: listBlobContainers, createBlobContainer, deleteBlobContainer, listBlobs, getBlob, deleteBlob, downloadBlobToFile, downloadLink, uploadBlockBlob, stageBlockBlobList, commitBlobBlockList, getBlobBlockList, createAppendBlob, commitAppendBlob, createPageBlob, uploadPageBlob, resizePageBlob, clearPageBlob, getPageBlobRanges | listBlobContainers | BlobOperationsDefinition +| *pageBlobSize* (producer) | Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary. | 512 | Long | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *accessKey* (security) | Access key for the associated azure account name to be used for authentication with azure blob services | | String |=== @@ -110,7 +120,7 @@ with the following path and query parameters: |=== -=== Query Parameters (19 parameters): +=== Query Parameters (29 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -124,14 +134,24 @@ with the following path and query parameters: | *credentials* (common) | StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information | | StorageSharedKeyCredential | *dataCount* (common) | How many bytes to include in the range. Must be greater than or equal to 0 if specified. | | Long | *fileDir* (common) | The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer | | String +| *maxResultsPerPage* (common) | Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxResultsPerPage or specifies a value greater than 5,000, the server will return up to 5,000 items. | | Integer | *maxRetryRequests* (common) | Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a response body. | 0 | int +| *prefix* (common) | Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs. | | String | *serviceClient* (common) | Client to a storage account. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct URLs to blobs and containers. This client contains operations on a service account. Operations on a container are available on BlobContainerClient through getBlobContainerClient(String), and operations on a blob are available on B [...] +| *timeout* (common) | An optional timeout value beyond which a RuntimeException will be raised. | | Duration | *bridgeErrorHandler* (consumer) | 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. | false | boolean | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. The value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern +| *blobSequenceNumber* (producer) | A user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 263 - 1.The default value is 0. | 0 | Long +| *blockListType* (producer) | Specifies which type of blocks to return. The value can be one of: committed, uncommitted, all | committed | BlockListType | *closeStreamAfterWrite* (producer) | Close the stream after write or keep it open, default is true | true | boolean +| *commitBlockListLater* (producer) | When is set to true, the staged blocks will not be committed directly. | true | boolean +| *createAppendBlob* (producer) | When is set to true, the append blocks will be created when committing append blocks. | true | boolean +| *createPageBlob* (producer) | When is set to true, the page blob will be created when uploading page blob. | true | boolean +| *downloadLinkExpiration* (producer) | Override the default expiration (millis) of URL download link. | | Long | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *operation* (producer) | The blob operation that can be used with this component on the producer. The value can be one of: listBlobContainers, createBlobContainer, deleteBlobContainer, listBlobs, getBlob, deleteBlob, downloadBlobToFile, downloadLink, uploadBlockBlob, stageBlockBlobList, commitBlobBlockList, getBlobBlockList, createAppendBlob, commitAppendBlob, createPageBlob, uploadPageBlob, resizePageBlob, clearPageBlob, getPageBlobRanges | listBlobContainers | BlobOperationsDefinition +| *pageBlobSize* (producer) | Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary. | 512 | Long | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean | *accessKey* (security) | Access key for the associated azure account name to be used for authentication with azure blob services | | String diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java index ca8e151..f4c9209 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java @@ -16,9 +16,12 @@ */ package org.apache.camel.component.azure.storage.blob; +import java.time.Duration; + import com.azure.storage.blob.BlobClient; import com.azure.storage.blob.BlobContainerClient; import com.azure.storage.blob.BlobServiceClient; +import com.azure.storage.blob.models.BlockListType; import com.azure.storage.common.StorageSharedKeyCredential; import org.apache.camel.RuntimeCamelException; import org.apache.camel.spi.UriParam; @@ -52,12 +55,32 @@ public class BlobConfiguration implements Cloneable { private long blobOffset; @UriParam(label = "common") private Long dataCount; + @UriParam(label = "common") + private Duration timeout; + @UriParam(label = "common") + private String prefix; + @UriParam(label = "common") + private Integer maxResultsPerPage; @UriParam(label = "common", defaultValue = "0") private int maxRetryRequests; @UriParam(defaultValue = "true") private boolean closeStreamAfterRead = true; @UriParam(label = "producer", defaultValue = "true") private boolean closeStreamAfterWrite = true; + @UriParam(label = "producer") + private Long downloadLinkExpiration; + @UriParam(label = "producer", defaultValue = "true") + private boolean commitBlockListLater = true; + @UriParam(label = "producer", defaultValue = "true") + private boolean createAppendBlob = true; + @UriParam(label = "producer", defaultValue = "true") + private boolean createPageBlob = true; + @UriParam(label = "producer", defaultValue = "0") + private Long blobSequenceNumber; + @UriParam(label = "producer", defaultValue = "512") + private Long pageBlobSize = BlobConstants.PAGE_BLOB_DEFAULT_SIZE; + @UriParam(label = "producer", enums = "committed,uncommitted,all", defaultValue = "committed") + private BlockListType blockListType = BlockListType.COMMITTED; /** @@ -199,6 +222,39 @@ public class BlobConfiguration implements Cloneable { } /** + * An optional timeout value beyond which a {@link RuntimeException} will be raised. + */ + public Duration getTimeout() { + return timeout; + } + + public void setTimeout(Duration timeout) { + this.timeout = timeout; + } + + /** + * Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs. + */ + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxResultsPerPage or specifies a value greater than 5,000, the server will return up to 5,000 items. + */ + public Integer getMaxResultsPerPage() { + return maxResultsPerPage; + } + + public void setMaxResultsPerPage(Integer maxResultsPerPage) { + this.maxResultsPerPage = maxResultsPerPage; + } + + /** * Close the stream after read or keep it open, default is true */ public boolean isCloseStreamAfterRead() { @@ -220,6 +276,83 @@ public class BlobConfiguration implements Cloneable { this.closeStreamAfterWrite = closeStreamAfterWrite; } + /** + * Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary. + */ + public Long getPageBlobSize() { + return pageBlobSize; + } + + public void setPageBlobSize(Long pageBlobSize) { + this.pageBlobSize = pageBlobSize; + } + + /** + * Override the default expiration (millis) of URL download link. + */ + public Long getDownloadLinkExpiration() { + return downloadLinkExpiration; + } + + public void setDownloadLinkExpiration(Long downloadLinkExpiration) { + this.downloadLinkExpiration = downloadLinkExpiration; + } + + /** + * When is set to `true`, the staged blocks will not be committed directly. + */ + public boolean isCommitBlockListLater() { + return commitBlockListLater; + } + + public void setCommitBlockListLater(boolean commitBlockListLater) { + this.commitBlockListLater = commitBlockListLater; + } + + /** + * When is set to `true`, the append blocks will be created when committing append blocks. + */ + public boolean isCreateAppendBlob() { + return createAppendBlob; + } + + public void setCreateAppendBlob(boolean createAppendBlob) { + this.createAppendBlob = createAppendBlob; + } + + /** + * When is set to `true`, the page blob will be created when uploading page blob. + */ + public boolean isCreatePageBlob() { + return createPageBlob; + } + + public void setCreatePageBlob(boolean createPageBlob) { + this.createPageBlob = createPageBlob; + } + + /** + * A user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1.The default value is 0. + */ + public Long getBlobSequenceNumber() { + return blobSequenceNumber; + } + + public void setBlobSequenceNumber(Long blobSequenceNumber) { + this.blobSequenceNumber = blobSequenceNumber; + } + + /** + * Specifies which type of blocks to return. + */ + public BlockListType getBlockListType() { + return blockListType; + } + + public void setBlockListType(BlockListType blockListType) { + this.blockListType = blockListType; + } + // ************************************************* // // ************************************************* diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxy.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxy.java new file mode 100644 index 0000000..4143f02 --- /dev/null +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxy.java @@ -0,0 +1,201 @@ +/* + * 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.storage.blob; + +import java.time.Duration; +import java.util.Map; +import java.util.function.Function; +import java.util.function.Supplier; + +import com.azure.storage.blob.models.AccessTier; +import com.azure.storage.blob.models.BlobHttpHeaders; +import com.azure.storage.blob.models.BlobListDetails; +import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; +import com.azure.storage.blob.models.BlockListType; +import com.azure.storage.blob.models.DeleteSnapshotsOptionType; +import com.azure.storage.blob.models.ListBlobContainersOptions; +import com.azure.storage.blob.models.ListBlobsOptions; +import com.azure.storage.blob.models.PageRange; +import com.azure.storage.blob.models.ParallelTransferOptions; +import com.azure.storage.blob.models.PublicAccessType; +import org.apache.camel.Exchange; +import org.apache.camel.util.ObjectHelper; + +/** + * A proxy class for {@link BlobConfigurationOptionsProxy} and {@link BlobExchangeHeaders}. Ideally this + * is responsible to obtain the correct configurations options either from configs or exchange headers + */ +public class BlobConfigurationOptionsProxy { + + private final BlobConfiguration configuration; + + public BlobConfigurationOptionsProxy(final BlobConfiguration configuration) { + this.configuration = configuration; + } + + public ListBlobContainersOptions getListBlobContainersOptions(final Exchange exchange) { + return BlobExchangeHeaders.getListBlobContainersOptionsFromHeaders(exchange); + } + + public Duration getTimeout(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getTimeoutFromHeaders, configuration::getTimeout, exchange); + } + + public ListBlobsOptions getListBlobsOptions(final Exchange exchange) { + return BlobExchangeHeaders.getListBlobsOptionsFromHeaders(exchange); + } + + public BlobListDetails getBlobListDetails(final Exchange exchange) { + return BlobExchangeHeaders.getBlobListDetailsFromHeaders(exchange); + } + + public String getPrefix(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getPrefixFromHeaders, configuration::getPrefix, exchange); + } + + public Integer getMaxResultsPerPage(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getMaxResultsPerPageFromHeaders, configuration::getMaxResultsPerPage, exchange); + } + + public ListBlobsOptions getListBlobOptions(final Exchange exchange) { + ListBlobsOptions blobsOptions = getListBlobsOptions(exchange); + + if (!ObjectHelper.isEmpty(blobsOptions)) { + return blobsOptions; + } else { + blobsOptions = new ListBlobsOptions(); + } + + final BlobListDetails blobListDetails = getBlobListDetails(exchange); + final String prefix = getPrefix(exchange); + final Integer maxResultsPerPage = getMaxResultsPerPage(exchange); + + blobsOptions.setDetails(blobListDetails); + blobsOptions.setMaxResultsPerPage(maxResultsPerPage); + blobsOptions.setPrefix(prefix); + + return blobsOptions; + } + + public Map<String, String> getMetadata(final Exchange exchange) { + return BlobExchangeHeaders.getMetadataFromHeaders(exchange); + } + + public PublicAccessType getPublicAccessType(final Exchange exchange) { + return BlobExchangeHeaders.getPublicAccessTypeFromHeaders(exchange); + } + + public BlobRequestConditions getBlobRequestConditions(final Exchange exchange) { + return BlobExchangeHeaders.getBlobRequestConditionsFromHeaders(exchange); + } + + public PageRange getPageRange(final Exchange exchange) { + return BlobExchangeHeaders.getPageRangeFromHeaders(exchange); + } + + public BlobRange getBlobRange(final Exchange exchange) { + if (configuration.getBlobType() == BlobType.pageblob) { + final PageRange pageRange = getPageRange(exchange); + if (pageRange != null) { + final long blobOffset = pageRange.getStart(); + final long dataCount = pageRange.getEnd() - pageRange.getStart(); + + return new BlobRange(blobOffset, dataCount); + } + } + return new BlobRange(configuration.getBlobOffset(), configuration.getDataCount()); + } + + public BlobHttpHeaders getBlobHttpHeaders(final Exchange exchange) { + return BlobExchangeHeaders.getBlobHttpHeadersFromHeaders(exchange); + } + + public AccessTier getAccessTier(final Exchange exchange) { + return BlobExchangeHeaders.getAccessTierFromHeaders(exchange); + } + + public byte[] getContentMd5(final Exchange exchange) { + return BlobExchangeHeaders.getContentMd5FromHeaders(exchange); + } + + public String getFileDir(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getFileDirFromHeaders, configuration::getFileDir, exchange); + } + + public ParallelTransferOptions getParallelTransferOptions(final Exchange exchange) { + return BlobExchangeHeaders.getParallelTransferOptionsFromHeaders(exchange); + } + + public DeleteSnapshotsOptionType getDeleteSnapshotsOptionType(final Exchange exchange) { + return BlobExchangeHeaders.getDeleteSnapshotsOptionTypeFromHeaders(exchange); + } + + public Long getDownloadLinkExpiration(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getDownloadLinkExpirationFromHeaders, configuration::getDownloadLinkExpiration, exchange); + } + + public boolean isCommitBlockListLater(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getCommitBlockListFlagFromHeaders, configuration::isCommitBlockListLater, exchange); + } + + public BlockListType getBlockListType(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getBlockListTypeFromHeaders, configuration::getBlockListType, exchange); + } + + public boolean isCreateAppendBlob(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getCreateAppendBlobFlagFromHeaders, configuration::isCreateAppendBlob, exchange); + } + + public Long getPageBlobSize(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getPageBlobSize, configuration::getPageBlobSize, exchange); + } + + public Long getBlobSequenceNumber(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getBlobSequenceNumberFromHeaders, configuration::getBlobSequenceNumber, exchange); + } + + public boolean isCreatePageBlob(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getCreatePageBlobFlagFromHeaders, configuration::isCreatePageBlob, exchange); + } + + public String getBlobName(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getBlobNameFromHeaders, configuration::getBlobName, exchange); + } + + public String getContainerName(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getBlobContainerNameFromHeaders, configuration::getContainerName, exchange); + } + + public BlobOperationsDefinition getOperation(final Exchange exchange) { + return getOption(BlobExchangeHeaders::getBlobOperationsDefinitionFromHeaders, configuration::getOperation, exchange); + } + + public int getMaxRetryRequests() { + return configuration.getMaxRetryRequests(); + } + + public BlobConfiguration getConfiguration() { + return configuration; + } + + private <R> R getOption(final Function<Exchange, R> exchangeFn, final Supplier<R> fallbackFn, final Exchange exchange) { + // we first try to look if our value in exchange otherwise fallback to fallbackFn which could be either a function or constant + return ObjectHelper.isEmpty(exchangeFn.apply(exchange)) ? fallbackFn.get() + : exchangeFn.apply(exchange); + } +} diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobProducer.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobProducer.java index 0c0c1cc..5069415 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobProducer.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobProducer.java @@ -33,6 +33,7 @@ import org.apache.camel.util.ObjectHelper; public class BlobProducer extends DefaultProducer { private final BlobConfiguration configuration; + private final BlobConfigurationOptionsProxy configurationProxy; private final BlobServiceOperations blobServiceOperations; private final BlobServiceClientWrapper blobServiceClientWrapper; @@ -40,7 +41,8 @@ public class BlobProducer extends DefaultProducer { super(endpoint); this.configuration = getEndpoint().getConfiguration(); this.blobServiceClientWrapper = new BlobServiceClientWrapper(getEndpoint().getBlobServiceClient()); - this.blobServiceOperations = new BlobServiceOperations(blobServiceClientWrapper); + this.blobServiceOperations = new BlobServiceOperations(configuration, blobServiceClientWrapper); + this.configurationProxy = new BlobConfigurationOptionsProxy(configuration); } @Override @@ -131,15 +133,11 @@ public class BlobProducer extends DefaultProducer { } private BlobOperationsDefinition determineOperation(final Exchange exchange) { - final BlobOperationsDefinition operation = BlobExchangeHeaders.getBlobOperationsDefinitionFromHeaders(exchange); - if (operation != null) { - return operation; - } - return configuration.getOperation(); + return configurationProxy.getOperation(exchange); } private BlobContainerOperations getContainerOperations(final Exchange exchange) { - return new BlobContainerOperations(blobServiceClientWrapper.getBlobContainerClientWrapper(determineContainerName(exchange))); + return new BlobContainerOperations(configuration, blobServiceClientWrapper.getBlobContainerClientWrapper(determineContainerName(exchange))); } private BlobOperations getBlobOperations(final Exchange exchange) { @@ -150,7 +148,8 @@ public class BlobProducer extends DefaultProducer { } private String determineContainerName(final Exchange exchange) { - final String containerName = BlobUtils.getContainerName(configuration, exchange); + final String containerName = configurationProxy.getContainerName(exchange); + if (ObjectHelper.isEmpty(containerName)) { throw new IllegalArgumentException("Container name must be specified"); } @@ -158,7 +157,7 @@ public class BlobProducer extends DefaultProducer { } public String determineBlobName(final Exchange exchange) { - final String blobName = BlobUtils.getBlobName(configuration, exchange); + final String blobName = configurationProxy.getBlobName(exchange); if (ObjectHelper.isEmpty(blobName)) { throw new IllegalArgumentException("Blob name must be specified"); diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobUtils.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobUtils.java index d5a3ae2..71321fc 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobUtils.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobUtils.java @@ -48,17 +48,6 @@ public final class BlobUtils { return length; } - public static BlobCommonRequestOptions getCommonRequestOptions(final Exchange exchange) { - final BlobHttpHeaders blobHttpHeaders = BlobExchangeHeaders.getBlobHttpHeadersFromHeaders(exchange); - final Map<String, String> metadata = BlobExchangeHeaders.getMetadataFromHeaders(exchange); - final AccessTier accessTier = BlobExchangeHeaders.getAccessTierFromHeaders(exchange); - final BlobRequestConditions blobRequestConditions = BlobExchangeHeaders.getBlobRequestConditionsFromHeaders(exchange); - final Duration timeout = BlobExchangeHeaders.getTimeoutFromHeaders(exchange); - final byte[] contentMD5 = BlobExchangeHeaders.getContentMd5FromHeaders(exchange); - - return new BlobCommonRequestOptions(blobHttpHeaders, metadata, accessTier, blobRequestConditions, contentMD5, timeout); - } - public static String getContainerName(final BlobConfiguration configuration, final Exchange exchange) { return ObjectHelper.isEmpty(BlobExchangeHeaders.getBlobContainerNameFromHeaders(exchange)) ? configuration.getContainerName() : BlobExchangeHeaders.getBlobContainerNameFromHeaders(exchange); diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperations.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperations.java index d165ffe..09b6fac 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperations.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperations.java @@ -19,11 +19,12 @@ package org.apache.camel.component.azure.storage.blob.operations; import java.time.Duration; import java.util.Map; -import com.azure.storage.blob.models.BlobListDetails; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.ListBlobsOptions; import com.azure.storage.blob.models.PublicAccessType; import org.apache.camel.Exchange; +import org.apache.camel.component.azure.storage.blob.BlobConfiguration; +import org.apache.camel.component.azure.storage.blob.BlobConfigurationOptionsProxy; import org.apache.camel.component.azure.storage.blob.BlobExchangeHeaders; import org.apache.camel.component.azure.storage.blob.client.BlobContainerClientWrapper; import org.apache.camel.util.ObjectHelper; @@ -34,11 +35,13 @@ import org.apache.camel.util.ObjectHelper; public class BlobContainerOperations { private final BlobContainerClientWrapper client; + private final BlobConfigurationOptionsProxy configurationProxy; - public BlobContainerOperations(final BlobContainerClientWrapper client) { + public BlobContainerOperations(final BlobConfiguration configuration, final BlobContainerClientWrapper client) { ObjectHelper.notNull(client, "client cannot be null"); this.client = client; + this.configurationProxy = new BlobConfigurationOptionsProxy(configuration); } public BlobOperationResponse listBlobs(final Exchange exchange) { @@ -46,8 +49,8 @@ public class BlobContainerOperations { return new BlobOperationResponse(client.listBlobs(new ListBlobsOptions(), null)); } - final ListBlobsOptions listBlobOptions = getListBlobOptions(exchange); - final Duration timeout = BlobExchangeHeaders.getTimeoutFromHeaders(exchange); + final ListBlobsOptions listBlobOptions = configurationProxy.getListBlobOptions(exchange); + final Duration timeout = configurationProxy.getTimeout(exchange); return new BlobOperationResponse(client.listBlobs(listBlobOptions, timeout)); } @@ -58,9 +61,9 @@ public class BlobContainerOperations { return new BlobOperationResponse(true, blobExchangeHeaders.toMap()); } - final Map<String, String> metadata = BlobExchangeHeaders.getMetadataFromHeaders(exchange); - final PublicAccessType publicAccessType = BlobExchangeHeaders.getPublicAccessTypeFromHeaders(exchange); - final Duration timeout = BlobExchangeHeaders.getTimeoutFromHeaders(exchange); + final Map<String, String> metadata = configurationProxy.getMetadata(exchange); + final PublicAccessType publicAccessType = configurationProxy.getPublicAccessType(exchange); + final Duration timeout = configurationProxy.getTimeout(exchange); final BlobExchangeHeaders blobExchangeHeaders = new BlobExchangeHeaders().httpHeaders(client.createContainer(metadata, publicAccessType, timeout)); @@ -73,31 +76,11 @@ public class BlobContainerOperations { return new BlobOperationResponse(true, blobExchangeHeaders.toMap()); } - final BlobRequestConditions blobRequestConditions = BlobExchangeHeaders.getBlobRequestConditionsFromHeaders(exchange); - final Duration timeout = BlobExchangeHeaders.getTimeoutFromHeaders(exchange); + final BlobRequestConditions blobRequestConditions = configurationProxy.getBlobRequestConditions(exchange); + final Duration timeout = configurationProxy.getTimeout(exchange); final BlobExchangeHeaders blobExchangeHeaders = new BlobExchangeHeaders().httpHeaders(client.deleteContainer(blobRequestConditions, timeout)); return new BlobOperationResponse(true, blobExchangeHeaders.toMap()); } - - private ListBlobsOptions getListBlobOptions(final Exchange exchange) { - ListBlobsOptions blobsOptions = BlobExchangeHeaders.getListBlobsOptionsFromHeaders(exchange); - - if (!ObjectHelper.isEmpty(blobsOptions)) { - return blobsOptions; - } else { - blobsOptions = new ListBlobsOptions(); - } - - final BlobListDetails blobListDetails = BlobExchangeHeaders.getBlobListDetailsFromHeaders(exchange); - final String prefix = BlobExchangeHeaders.getPrefixFromHeaders(exchange); - final Integer maxResultsPerPage = BlobExchangeHeaders.getMaxResultsPerPageFromHeaders(exchange); - - blobsOptions.setDetails(blobListDetails); - blobsOptions.setMaxResultsPerPage(maxResultsPerPage); - blobsOptions.setPrefix(prefix); - - return blobsOptions; - } } diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java index 3bc4ee8..e8ed5b9 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobOperations.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.time.Duration; import java.time.OffsetDateTime; import java.util.Collections; import java.util.LinkedList; @@ -30,10 +31,13 @@ import java.util.stream.Collectors; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.storage.blob.BlobClient; +import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.AppendBlobItem; import com.azure.storage.blob.models.BlobDownloadHeaders; +import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobProperties; import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.Block; import com.azure.storage.blob.models.BlockBlobItem; import com.azure.storage.blob.models.BlockList; @@ -50,10 +54,10 @@ import org.apache.camel.Exchange; import org.apache.camel.component.azure.storage.blob.BlobBlock; import org.apache.camel.component.azure.storage.blob.BlobCommonRequestOptions; import org.apache.camel.component.azure.storage.blob.BlobConfiguration; +import org.apache.camel.component.azure.storage.blob.BlobConfigurationOptionsProxy; import org.apache.camel.component.azure.storage.blob.BlobConstants; import org.apache.camel.component.azure.storage.blob.BlobExchangeHeaders; import org.apache.camel.component.azure.storage.blob.BlobStreamAndLength; -import org.apache.camel.component.azure.storage.blob.BlobType; import org.apache.camel.component.azure.storage.blob.BlobUtils; import org.apache.camel.component.azure.storage.blob.client.BlobClientWrapper; import org.apache.camel.util.ObjectHelper; @@ -67,14 +71,14 @@ public class BlobOperations { private static final Logger LOG = LoggerFactory.getLogger(BlobOperations.class); - private final BlobConfiguration configuration; private final BlobClientWrapper client; + private final BlobConfigurationOptionsProxy configurationProxy; public BlobOperations(final BlobConfiguration configuration, final BlobClientWrapper client) { ObjectHelper.notNull(client, "client can not be null."); - this.configuration = configuration; this.client = client; + this.configurationProxy = new BlobConfigurationOptionsProxy(configuration); } public BlobOperationResponse getBlob(final Exchange exchange) throws IOException { @@ -85,11 +89,11 @@ public class BlobOperations { return new BlobOperationResponse(blobInputStream.get("inputStream"), blobExchangeHeaders.toMap()); } - LOG.trace("Getting a blob [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Getting a blob [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); final OutputStream outputStream = BlobUtils.getInMessage(exchange).getBody(OutputStream.class); - final BlobRange blobRange = getBlobRangeFromHeadersOrConfig(exchange, configuration); - final BlobCommonRequestOptions blobCommonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobRange blobRange = configurationProxy.getBlobRange(exchange); + final BlobCommonRequestOptions blobCommonRequestOptions = getCommonRequestOptions(exchange); if (outputStream == null) { // Then we create an input stream @@ -99,7 +103,7 @@ public class BlobOperations { return new BlobOperationResponse(blobInputStream.get("inputStream"), blobExchangeHeaders.toMap()); } // we have an outputStream set, so we use it - final DownloadRetryOptions downloadRetryOptions = getDownloadRetryOptions(configuration); + final DownloadRetryOptions downloadRetryOptions = getDownloadRetryOptions(configurationProxy); try { final ResponseBase<BlobDownloadHeaders, Void> response = client.downloadWithResponse(outputStream, blobRange, downloadRetryOptions, blobCommonRequestOptions.getBlobRequestConditions(), @@ -110,7 +114,7 @@ public class BlobOperations { return new BlobOperationResponse(outputStream, blobExchangeHeaders.toMap()); } finally { - if (configuration.isCloseStreamAfterRead()) { + if (configurationProxy.getConfiguration().isCloseStreamAfterRead()) { outputStream.close(); } } @@ -118,7 +122,7 @@ public class BlobOperations { public BlobOperationResponse downloadBlobToFile(final Exchange exchange) { // check for fileDir - final String fileDir = ObjectHelper.isEmpty(BlobExchangeHeaders.getFileDirFromHeaders(exchange)) ? configuration.getFileDir() : BlobExchangeHeaders.getFileDirFromHeaders(exchange); + final String fileDir = configurationProxy.getFileDir(exchange); if (ObjectHelper.isEmpty(fileDir)) { throw new IllegalArgumentException("In order to download a blob, you will need to specify the fileDir in the URI"); } @@ -134,10 +138,10 @@ public class BlobOperations { return new BlobOperationResponse(fileToDownload, exchangeHeaders.toMap()); } - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); - final BlobRange blobRange = getBlobRangeFromHeadersOrConfig(exchange, configuration); - final ParallelTransferOptions parallelTransferOptions = BlobExchangeHeaders.getParallelTransferOptionsFromHeaders(exchange); - final DownloadRetryOptions downloadRetryOptions = getDownloadRetryOptions(configuration); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); + final BlobRange blobRange = configurationProxy.getBlobRange(exchange); + final ParallelTransferOptions parallelTransferOptions = configurationProxy.getParallelTransferOptions(exchange); + final DownloadRetryOptions downloadRetryOptions = getDownloadRetryOptions(configurationProxy); final Response<BlobProperties> response = client.downloadToFileWithResponse(fileToDownload.toString(), blobRange, parallelTransferOptions, downloadRetryOptions, commonRequestOptions.getBlobRequestConditions(), commonRequestOptions.getContentMD5() != null, commonRequestOptions.getTimeout()); @@ -154,8 +158,8 @@ public class BlobOperations { return buildResponse(client.delete(null, null, null), true); } - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); - final DeleteSnapshotsOptionType deleteSnapshotsOptionType = BlobExchangeHeaders.getDeleteSnapshotsOptionTypeFromHeaders(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); + final DeleteSnapshotsOptionType deleteSnapshotsOptionType = configurationProxy.getDeleteSnapshotsOptionType(exchange); return buildResponse(client.delete(deleteSnapshotsOptionType, commonRequestOptions.getBlobRequestConditions(), commonRequestOptions.getTimeout()), true); @@ -175,7 +179,7 @@ public class BlobOperations { return new BlobOperationResponse(true, headers.toMap()); } - final Long expirationMillis = BlobExchangeHeaders.getDownloadLinkExpirationFromHeaders(exchange); + final Long expirationMillis = configurationProxy.getDownloadLinkExpiration(exchange); OffsetDateTime offsetDateTimeToSet; if (expirationMillis != null) { offsetDateTimeToSet = offsetDateTime.plusSeconds(expirationMillis / 1000); @@ -195,9 +199,9 @@ public class BlobOperations { ObjectHelper.notNull(exchange, "exchange cannot be null"); final BlobStreamAndLength blobStreamAndLength = BlobStreamAndLength.createBlobStreamAndLengthFromExchangeBody(exchange); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); - LOG.trace("Putting a block blob [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Putting a block blob [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); try { final Response<BlockBlobItem> response = client.uploadBlockBlob(blobStreamAndLength.getInputStream(), blobStreamAndLength.getStreamLength(), commonRequestOptions.getBlobHttpHeaders(), @@ -226,9 +230,9 @@ public class BlobOperations { throw new IllegalArgumentException("Illegal storageBlocks payload"); } - LOG.trace("Putting a blob [{}] from blocks from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Putting a blob [{}] from blocks from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); final List<Block> blockEntries = new LinkedList<>(); @@ -238,7 +242,7 @@ public class BlobOperations { commonRequestOptions.getContentMD5(), commonRequestOptions.leaseId(), commonRequestOptions.getTimeout()); }); - final boolean commitBlockListLater = BlobExchangeHeaders.getCommitBlockListFlagFromHeaders(exchange); + final boolean commitBlockListLater = configurationProxy.isCommitBlockListLater(exchange); if (!commitBlockListLater) { // let us commit now @@ -265,9 +269,9 @@ public class BlobOperations { throw new IllegalArgumentException("Illegal commit block list payload"); } - LOG.trace("Putting a blob [{}] block list from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Putting a blob [{}] block list from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); final List<String> blockIds = blockEntries.stream() .map(Block::getName) @@ -286,10 +290,10 @@ public class BlobOperations { return buildResponse(response, false); } - LOG.trace("Getting the blob block list [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Getting the blob block list [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); - final BlockListType blockListType = BlobExchangeHeaders.getBlockListTypeFromHeaders(exchange) == null ? BlockListType.COMMITTED : BlobExchangeHeaders.getBlockListTypeFromHeaders(exchange); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlockListType blockListType = configurationProxy.getBlockListType(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); final Response<BlockList> response = client.listBlobBlocks(blockListType, commonRequestOptions.leaseId(), commonRequestOptions.getTimeout()); @@ -303,9 +307,9 @@ public class BlobOperations { return buildResponse(response, true); } - LOG.trace("Creating an append blob [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Creating an append blob [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); final Response<AppendBlobItem> response = client.createAppendBlob(commonRequestOptions.getBlobHttpHeaders(), commonRequestOptions.getMetadata(), commonRequestOptions.getBlobRequestConditions(), commonRequestOptions.getTimeout()); @@ -316,8 +320,8 @@ public class BlobOperations { public BlobOperationResponse commitAppendBlob(final Exchange exchange) throws IOException { ObjectHelper.notNull(exchange, "exchange cannot be null"); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); - final boolean createAppendBlob = BlobExchangeHeaders.getCreateAppendBlobFlagFromHeaders(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); + final boolean createAppendBlob = configurationProxy.isCreateAppendBlob(exchange); if (createAppendBlob) { createAppendBlob(exchange); @@ -341,11 +345,11 @@ public class BlobOperations { return buildResponse(response, true); } - LOG.trace("Creating a page blob [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Creating a page blob [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); final Long pageSize = getPageBlobSize(exchange); - final BlobCommonRequestOptions requestOptions = BlobUtils.getCommonRequestOptions(exchange); - final Long sequenceNumber = BlobExchangeHeaders.getBlobSequenceNumberFromHeaders(exchange); + final BlobCommonRequestOptions requestOptions = getCommonRequestOptions(exchange); + final Long sequenceNumber = configurationProxy.getBlobSequenceNumber(exchange); final Response<PageBlobItem> response = client.createPageBlob(pageSize, sequenceNumber, requestOptions.getBlobHttpHeaders(), requestOptions.getMetadata(), requestOptions.getBlobRequestConditions(), requestOptions.getTimeout()); @@ -356,15 +360,15 @@ public class BlobOperations { public BlobOperationResponse uploadPageBlob(final Exchange exchange) throws IOException { ObjectHelper.notNull(exchange, "exchange cannot be null"); - final boolean createPageBlob = BlobExchangeHeaders.getCreatePageBlobFlagFromHeaders(exchange); + final boolean createPageBlob = configurationProxy.isCreatePageBlob(exchange); if (createPageBlob) { createPageBlob(exchange); } final BlobStreamAndLength streamAndLength = BlobStreamAndLength.createBlobStreamAndLengthFromExchangeBody(exchange); - final BlobCommonRequestOptions requestOptions = BlobUtils.getCommonRequestOptions(exchange); - final PageRange pageRange = BlobExchangeHeaders.getPageRangeFromHeaders(exchange); + final BlobCommonRequestOptions requestOptions = getCommonRequestOptions(exchange); + final PageRange pageRange = configurationProxy.getPageRange(exchange); if (pageRange == null) { throw new IllegalArgumentException("You need to set page range in the exchange headers."); @@ -386,10 +390,10 @@ public class BlobOperations { return buildResponse(response, true); } - LOG.trace("Resizing a page blob [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Resizing a page blob [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); final Long pageSize = getPageBlobSize(exchange); - final BlobCommonRequestOptions requestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobCommonRequestOptions requestOptions = getCommonRequestOptions(exchange); final Response<PageBlobItem> response = client.resizePageBlob(pageSize, requestOptions.getBlobRequestConditions(), requestOptions.getTimeout()); @@ -399,8 +403,8 @@ public class BlobOperations { public BlobOperationResponse clearPageBlob(final Exchange exchange) { ObjectHelper.notNull(exchange, "exchange cannot be null"); - final PageRange pageRange = BlobExchangeHeaders.getPageRangeFromHeaders(exchange); - final BlobCommonRequestOptions requestOptions = BlobUtils.getCommonRequestOptions(exchange); + final PageRange pageRange = configurationProxy.getPageRange(exchange); + final BlobCommonRequestOptions requestOptions = getCommonRequestOptions(exchange); if (pageRange == null) { throw new IllegalArgumentException("You need to set page range in the exchange headers."); @@ -414,18 +418,29 @@ public class BlobOperations { public BlobOperationResponse getPageBlobRanges(final Exchange exchange) { ObjectHelper.notNull(exchange, "exchange cannot be null"); - final BlobRange blobRange = getBlobRangeFromHeadersOrConfig(exchange, configuration); - final BlobCommonRequestOptions commonRequestOptions = BlobUtils.getCommonRequestOptions(exchange); + final BlobRange blobRange = configurationProxy.getBlobRange(exchange); + final BlobCommonRequestOptions commonRequestOptions = getCommonRequestOptions(exchange); - LOG.trace("Getting the page blob ranges [{}] from exchange [{}]...", configuration.getBlobName(), exchange); + LOG.trace("Getting the page blob ranges [{}] from exchange [{}]...", configurationProxy.getBlobName(exchange), exchange); final Response<PageList> response = client.getPageBlobRanges(blobRange, commonRequestOptions.getBlobRequestConditions(), commonRequestOptions.getTimeout()); return buildResponse(response, false); } - private DownloadRetryOptions getDownloadRetryOptions(final BlobConfiguration configuration) { - return new DownloadRetryOptions().setMaxRetryRequests(configuration.getMaxRetryRequests()); + private DownloadRetryOptions getDownloadRetryOptions(final BlobConfigurationOptionsProxy configurationProxy) { + return new DownloadRetryOptions().setMaxRetryRequests(configurationProxy.getMaxRetryRequests()); + } + + private BlobCommonRequestOptions getCommonRequestOptions(final Exchange exchange) { + final BlobHttpHeaders blobHttpHeaders = configurationProxy.getBlobHttpHeaders(exchange); + final Map<String, String> metadata = configurationProxy.getMetadata(exchange); + final AccessTier accessTier = configurationProxy.getAccessTier(exchange); + final BlobRequestConditions blobRequestConditions = configurationProxy.getBlobRequestConditions(exchange); + final Duration timeout = configurationProxy.getTimeout(exchange); + final byte[] contentMD5 = configurationProxy.getContentMd5(exchange); + + return new BlobCommonRequestOptions(blobHttpHeaders, metadata, accessTier, blobRequestConditions, contentMD5, timeout); } @SuppressWarnings("rawtypes") @@ -450,30 +465,17 @@ public class BlobOperations { return new BlobOperationResponse(body, exchangeHeaders.toMap()); } - private BlobRange getBlobRangeFromHeadersOrConfig(final Exchange exchange, final BlobConfiguration configuration) { - if (configuration.getBlobType() == BlobType.pageblob) { - final PageRange pageRange = BlobExchangeHeaders.getPageRangeFromHeaders(exchange); - if (pageRange != null) { - final long blobOffset = pageRange.getStart(); - final long dataCount = pageRange.getEnd() - pageRange.getStart(); - - return new BlobRange(blobOffset, dataCount); - } - } - return new BlobRange(configuration.getBlobOffset(), configuration.getDataCount()); - } - private Long getPageBlobSize(final Exchange exchange) { if (exchange == null) { return BlobConstants.PAGE_BLOB_DEFAULT_SIZE; } // we try to get the size from the page range if exists - final PageRange pageRange = BlobExchangeHeaders.getPageRangeFromHeaders(exchange); + final PageRange pageRange = configurationProxy.getPageRange(exchange); if (pageRange != null) { return pageRange.getEnd() - pageRange.getStart() + 1; //e.g: 1023-0+1 = 1024 size } // now we try the page size - final Long pageSize = BlobExchangeHeaders.getPageBlobSize(exchange); + final Long pageSize = configurationProxy.getPageBlobSize(exchange); if (pageSize != null) { return pageSize; } @@ -481,7 +483,7 @@ public class BlobOperations { } private void closeInputStreamIfNeeded(InputStream inputStream) throws IOException { - if (configuration.isCloseStreamAfterWrite()) { + if (configurationProxy.getConfiguration().isCloseStreamAfterWrite()) { inputStream.close(); } } diff --git a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobServiceOperations.java b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobServiceOperations.java index 0a97b83..3439466 100644 --- a/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobServiceOperations.java +++ b/components/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/operations/BlobServiceOperations.java @@ -20,7 +20,8 @@ import java.time.Duration; import com.azure.storage.blob.models.ListBlobContainersOptions; import org.apache.camel.Exchange; -import org.apache.camel.component.azure.storage.blob.BlobExchangeHeaders; +import org.apache.camel.component.azure.storage.blob.BlobConfiguration; +import org.apache.camel.component.azure.storage.blob.BlobConfigurationOptionsProxy; import org.apache.camel.component.azure.storage.blob.client.BlobServiceClientWrapper; import org.apache.camel.util.ObjectHelper; @@ -30,19 +31,21 @@ import org.apache.camel.util.ObjectHelper; public class BlobServiceOperations { private final BlobServiceClientWrapper client; + private final BlobConfigurationOptionsProxy configurationProxy; - public BlobServiceOperations(final BlobServiceClientWrapper client) { + public BlobServiceOperations(final BlobConfiguration configuration, final BlobServiceClientWrapper client) { ObjectHelper.notNull(client, "client cannot be null"); this.client = client; + this.configurationProxy = new BlobConfigurationOptionsProxy(configuration); } public BlobOperationResponse listBlobContainers(final Exchange exchange) { if (exchange == null) { return new BlobOperationResponse(client.listBlobContainers(null, null)); } - final ListBlobContainersOptions listBlobContainersOptions = BlobExchangeHeaders.getListBlobContainersOptionsFromHeaders(exchange); - final Duration timeout = BlobExchangeHeaders.getTimeoutFromHeaders(exchange); + final ListBlobContainersOptions listBlobContainersOptions = configurationProxy.getListBlobContainersOptions(exchange); + final Duration timeout = configurationProxy.getTimeout(exchange); return new BlobOperationResponse(client.listBlobContainers(listBlobContainersOptions, timeout)); } diff --git a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxyTest.java b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxyTest.java new file mode 100644 index 0000000..df75009 --- /dev/null +++ b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobConfigurationOptionsProxyTest.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.azure.storage.blob; + +import org.apache.camel.Exchange; +import org.apache.camel.support.DefaultExchange; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +class BlobConfigurationOptionsProxyTest extends CamelTestSupport { + + @Test + public void testIfCorrectOptionsReturnedCorrectly() { + final BlobConfiguration configuration = new BlobConfiguration(); + + // first case: when exchange is set + final Exchange exchange = new DefaultExchange(context); + final BlobConfigurationOptionsProxy configurationOptionsProxy = new BlobConfigurationOptionsProxy(configuration); + + exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "testBlobExchange"); + configuration.setBlobName("testBlobConfig"); + + assertEquals("testBlobExchange", configurationOptionsProxy.getBlobName(exchange)); + + // second class: exchange is empty + exchange.getIn().setHeader(BlobConstants.BLOB_NAME, null); + + assertEquals("testBlobConfig", configurationOptionsProxy.getBlobName(exchange)); + + // third class: if no option at all + configuration.setBlobName(null); + + assertNull(configurationOptionsProxy.getBlobName(exchange)); + } +} \ No newline at end of file diff --git a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobProducerIT.java b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobProducerIT.java index 27a9f8a..149526b 100644 --- a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobProducerIT.java +++ b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobProducerIT.java @@ -162,6 +162,15 @@ public class BlobProducerIT extends CamelTestSupport { assertNotNull(result.getExchanges().get(0).getMessage().getHeader(BlobConstants.E_TAG)); } + @Test + public void testUploadBlockBlobWithConfigUri() throws InterruptedException { + result.expectedMessageCount(1); + + template.send("direct:uploadBlockBlobWithConfigUri", ExchangePattern.InOnly, exchange -> exchange.getIn().setBody("Block Blob")); + + result.assertIsSatisfied(); + } + @AfterAll public void tearDown() { @@ -196,6 +205,10 @@ public class BlobProducerIT extends CamelTestSupport { from("direct:uploadPageBlob") .to(componentUri("uploadPageBlob")) .to(resultName); + + from("direct:uploadBlockBlobWithConfigUri") + .to(componentUri("uploadBlockBlob") + "&blobName=uploadBlockName") + .to(resultName); } }; } diff --git a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsIT.java b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsIT.java index ac0798e..0f75958 100644 --- a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsIT.java +++ b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsIT.java @@ -60,7 +60,7 @@ public class BlobContainerOperationsIT extends CamelTestSupport { @Test public void testCreateAndDeleteContainer() { final BlobContainerClientWrapper containerClientWrapper = blobServiceClientWrapper.getBlobContainerClientWrapper("testcontainer1"); - final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(containerClientWrapper); + final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(configuration, containerClientWrapper); final BlobOperationResponse response = blobContainerOperations.createContainer(null); diff --git a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsTest.java b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsTest.java index 2a89e12..4e23a28 100644 --- a/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsTest.java +++ b/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/operations/BlobContainerOperationsTest.java @@ -58,7 +58,7 @@ class BlobContainerOperationsTest { public void testCreateContainer() { when(client.createContainer(any(), any(), any())).thenReturn(createContainerMock()); - final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(client); + final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(configuration, client); final BlobOperationResponse response = blobContainerOperations.createContainer(null); assertNotNull(response); @@ -70,7 +70,7 @@ class BlobContainerOperationsTest { public void testDeleteContainer() { when(client.deleteContainer(any(), any())).thenReturn(deleteContainerMock()); - final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(client); + final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(configuration, client); final BlobOperationResponse response = blobContainerOperations.deleteContainer(null); assertNotNull(response); @@ -82,7 +82,7 @@ class BlobContainerOperationsTest { public void testListBlob() { when(client.listBlobs(any(), any())).thenReturn(listBlobsMock()); - final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(client); + final BlobContainerOperations blobContainerOperations = new BlobContainerOperations(configuration, client); final BlobOperationResponse response = blobContainerOperations.listBlobs(null); assertNotNull(response); diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureStorageBlobComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureStorageBlobComponentBuilderFactory.java index 09078e8..c61e17a 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureStorageBlobComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureStorageBlobComponentBuilderFactory.java @@ -158,6 +158,21 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option is a: <code>java.lang.Integer</code> type. + * + * Group: common + */ + default AzureStorageBlobComponentBuilder maxResultsPerPage( + java.lang.Integer maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** * Specifies the maximum number of additional HTTP Get requests that * will be made while reading the data from a response body. * @@ -172,6 +187,18 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * Filters the results to return only blobs whose names begin with the + * specified prefix. May be null to return all blobs. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + */ + default AzureStorageBlobComponentBuilder prefix(java.lang.String prefix) { + doSetProperty("prefix", prefix); + return this; + } + /** * Client to a storage account. This client does not hold any state * about a particular storage account but is instead a convenient way of * sending off appropriate requests to the resource on the service. It @@ -193,6 +220,19 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option is a: <code>java.time.Duration</code> type. + * + * Group: common + */ + default AzureStorageBlobComponentBuilder timeout( + java.time.Duration timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** * 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 @@ -212,6 +252,35 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * A user-controlled value that you can use to track requests. The value + * of the sequence number must be between 0 and 263 - 1.The default + * value is 0. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Default: 0 + * Group: producer + */ + default AzureStorageBlobComponentBuilder blobSequenceNumber( + java.lang.Long blobSequenceNumber) { + doSetProperty("blobSequenceNumber", blobSequenceNumber); + return this; + } + /** + * Specifies which type of blocks to return. + * + * The option is a: + * <code>com.azure.storage.blob.models.BlockListType</code> type. + * + * Default: committed + * Group: producer + */ + default AzureStorageBlobComponentBuilder blockListType( + com.azure.storage.blob.models.BlockListType blockListType) { + doSetProperty("blockListType", blockListType); + return this; + } + /** * Close the stream after write or keep it open, default is true. * * The option is a: <code>boolean</code> type. @@ -225,6 +294,60 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * When is set to true, the staged blocks will not be committed + * directly. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default AzureStorageBlobComponentBuilder commitBlockListLater( + boolean commitBlockListLater) { + doSetProperty("commitBlockListLater", commitBlockListLater); + return this; + } + /** + * When is set to true, the append blocks will be created when + * committing append blocks. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default AzureStorageBlobComponentBuilder createAppendBlob( + boolean createAppendBlob) { + doSetProperty("createAppendBlob", createAppendBlob); + return this; + } + /** + * When is set to true, the page blob will be created when uploading + * page blob. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default AzureStorageBlobComponentBuilder createPageBlob( + boolean createPageBlob) { + doSetProperty("createPageBlob", createPageBlob); + return this; + } + /** + * Override the default expiration (millis) of URL download link. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Group: producer + */ + default AzureStorageBlobComponentBuilder downloadLinkExpiration( + java.lang.Long downloadLinkExpiration) { + doSetProperty("downloadLinkExpiration", downloadLinkExpiration); + return this; + } + /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during @@ -261,6 +384,20 @@ public interface AzureStorageBlobComponentBuilderFactory { return this; } /** + * Specifies the maximum size for the page blob, up to 8 TB. The page + * blob size must be aligned to a 512-byte boundary. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Default: 512 + * Group: producer + */ + default AzureStorageBlobComponentBuilder pageBlobSize( + java.lang.Long pageBlobSize) { + doSetProperty("pageBlobSize", pageBlobSize); + return this; + } + /** * Whether the component should use basic property binding (Camel 2.x) * or the newer property binding with additional capabilities. * @@ -319,12 +456,22 @@ public interface AzureStorageBlobComponentBuilderFactory { case "credentials": getOrCreateConfiguration((BlobComponent) component).setCredentials((com.azure.storage.common.StorageSharedKeyCredential) value); return true; case "dataCount": getOrCreateConfiguration((BlobComponent) component).setDataCount((java.lang.Long) value); return true; case "fileDir": getOrCreateConfiguration((BlobComponent) component).setFileDir((java.lang.String) value); return true; + case "maxResultsPerPage": getOrCreateConfiguration((BlobComponent) component).setMaxResultsPerPage((java.lang.Integer) value); return true; case "maxRetryRequests": getOrCreateConfiguration((BlobComponent) component).setMaxRetryRequests((int) value); return true; + case "prefix": getOrCreateConfiguration((BlobComponent) component).setPrefix((java.lang.String) value); return true; case "serviceClient": getOrCreateConfiguration((BlobComponent) component).setServiceClient((com.azure.storage.blob.BlobServiceClient) value); return true; + case "timeout": getOrCreateConfiguration((BlobComponent) component).setTimeout((java.time.Duration) value); return true; case "bridgeErrorHandler": ((BlobComponent) component).setBridgeErrorHandler((boolean) value); return true; + case "blobSequenceNumber": getOrCreateConfiguration((BlobComponent) component).setBlobSequenceNumber((java.lang.Long) value); return true; + case "blockListType": getOrCreateConfiguration((BlobComponent) component).setBlockListType((com.azure.storage.blob.models.BlockListType) value); return true; case "closeStreamAfterWrite": getOrCreateConfiguration((BlobComponent) component).setCloseStreamAfterWrite((boolean) value); return true; + case "commitBlockListLater": getOrCreateConfiguration((BlobComponent) component).setCommitBlockListLater((boolean) value); return true; + case "createAppendBlob": getOrCreateConfiguration((BlobComponent) component).setCreateAppendBlob((boolean) value); return true; + case "createPageBlob": getOrCreateConfiguration((BlobComponent) component).setCreatePageBlob((boolean) value); return true; + case "downloadLinkExpiration": getOrCreateConfiguration((BlobComponent) component).setDownloadLinkExpiration((java.lang.Long) value); return true; case "lazyStartProducer": ((BlobComponent) component).setLazyStartProducer((boolean) value); return true; case "operation": getOrCreateConfiguration((BlobComponent) component).setOperation((org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition) value); return true; + case "pageBlobSize": getOrCreateConfiguration((BlobComponent) component).setPageBlobSize((java.lang.Long) value); return true; case "basicPropertyBinding": ((BlobComponent) component).setBasicPropertyBinding((boolean) value); return true; case "accessKey": getOrCreateConfiguration((BlobComponent) component).setAccessKey((java.lang.String) value); return true; default: return false; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 422c709..ec4c1e7 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -2538,7 +2538,7 @@ public class StaticEndpointBuilders { * * @param path containerName */ - public static org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.BlobEndpointBuilder azureStorageBlob( + static org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.BlobEndpointBuilder azureStorageBlob( String path) { return org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.endpointBuilder("azure-storage-blob", path); } @@ -2562,7 +2562,7 @@ public class StaticEndpointBuilders { * instead of the default name * @param path containerName */ - public static org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.BlobEndpointBuilder azureStorageBlob( + static org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.BlobEndpointBuilder azureStorageBlob( String componentName, String path) { return org.apache.camel.builder.endpoint.dsl.BlobEndpointBuilderFactory.endpointBuilder(componentName, path); diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BlobEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BlobEndpointBuilderFactory.java index 7113639..43f08cc 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BlobEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BlobEndpointBuilderFactory.java @@ -16,6 +16,7 @@ */ package org.apache.camel.builder.endpoint.dsl; +import java.time.Duration; import javax.annotation.Generated; import org.apache.camel.ExchangePattern; import org.apache.camel.builder.EndpointConsumerBuilder; @@ -243,6 +244,37 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option is a: <code>java.lang.Integer</code> type. + * + * Group: common + */ + default BlobEndpointConsumerBuilder maxResultsPerPage( + Integer maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option will be converted to a <code>java.lang.Integer</code> + * type. + * + * Group: common + */ + default BlobEndpointConsumerBuilder maxResultsPerPage( + String maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** * Specifies the maximum number of additional HTTP Get requests that * will be made while reading the data from a response body. * @@ -271,6 +303,18 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Filters the results to return only blobs whose names begin with the + * specified prefix. May be null to return all blobs. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + */ + default BlobEndpointConsumerBuilder prefix(String prefix) { + doSetProperty("prefix", prefix); + return this; + } + /** * Client to a storage account. This client does not hold any state * about a particular storage account but is instead a convenient way of * sending off appropriate requests to the resource on the service. It @@ -311,6 +355,31 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option is a: <code>java.time.Duration</code> type. + * + * Group: common + */ + default BlobEndpointConsumerBuilder timeout(Duration timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option will be converted to a <code>java.time.Duration</code> + * type. + * + * Group: common + */ + default BlobEndpointConsumerBuilder timeout(String timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** * 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 @@ -698,6 +767,37 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option is a: <code>java.lang.Integer</code> type. + * + * Group: common + */ + default BlobEndpointProducerBuilder maxResultsPerPage( + Integer maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option will be converted to a <code>java.lang.Integer</code> + * type. + * + * Group: common + */ + default BlobEndpointProducerBuilder maxResultsPerPage( + String maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** * Specifies the maximum number of additional HTTP Get requests that * will be made while reading the data from a response body. * @@ -726,6 +826,18 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Filters the results to return only blobs whose names begin with the + * specified prefix. May be null to return all blobs. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + */ + default BlobEndpointProducerBuilder prefix(String prefix) { + doSetProperty("prefix", prefix); + return this; + } + /** * Client to a storage account. This client does not hold any state * about a particular storage account but is instead a convenient way of * sending off appropriate requests to the resource on the service. It @@ -766,6 +878,88 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option is a: <code>java.time.Duration</code> type. + * + * Group: common + */ + default BlobEndpointProducerBuilder timeout(Duration timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option will be converted to a <code>java.time.Duration</code> + * type. + * + * Group: common + */ + default BlobEndpointProducerBuilder timeout(String timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** + * A user-controlled value that you can use to track requests. The value + * of the sequence number must be between 0 and 263 - 1.The default + * value is 0. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Default: 0 + * Group: producer + */ + default BlobEndpointProducerBuilder blobSequenceNumber( + Long blobSequenceNumber) { + doSetProperty("blobSequenceNumber", blobSequenceNumber); + return this; + } + /** + * A user-controlled value that you can use to track requests. The value + * of the sequence number must be between 0 and 263 - 1.The default + * value is 0. + * + * The option will be converted to a <code>java.lang.Long</code> type. + * + * Default: 0 + * Group: producer + */ + default BlobEndpointProducerBuilder blobSequenceNumber( + String blobSequenceNumber) { + doSetProperty("blobSequenceNumber", blobSequenceNumber); + return this; + } + /** + * Specifies which type of blocks to return. + * + * The option is a: + * <code>com.azure.storage.blob.models.BlockListType</code> type. + * + * Default: committed + * Group: producer + */ + default BlobEndpointProducerBuilder blockListType( + BlockListType blockListType) { + doSetProperty("blockListType", blockListType); + return this; + } + /** + * Specifies which type of blocks to return. + * + * The option will be converted to a + * <code>com.azure.storage.blob.models.BlockListType</code> type. + * + * Default: committed + * Group: producer + */ + default BlobEndpointProducerBuilder blockListType(String blockListType) { + doSetProperty("blockListType", blockListType); + return this; + } + /** * Close the stream after write or keep it open, default is true. * * The option is a: <code>boolean</code> type. @@ -792,6 +986,113 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * When is set to true, the staged blocks will not be committed + * directly. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder commitBlockListLater( + boolean commitBlockListLater) { + doSetProperty("commitBlockListLater", commitBlockListLater); + return this; + } + /** + * When is set to true, the staged blocks will not be committed + * directly. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder commitBlockListLater( + String commitBlockListLater) { + doSetProperty("commitBlockListLater", commitBlockListLater); + return this; + } + /** + * When is set to true, the append blocks will be created when + * committing append blocks. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder createAppendBlob( + boolean createAppendBlob) { + doSetProperty("createAppendBlob", createAppendBlob); + return this; + } + /** + * When is set to true, the append blocks will be created when + * committing append blocks. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder createAppendBlob( + String createAppendBlob) { + doSetProperty("createAppendBlob", createAppendBlob); + return this; + } + /** + * When is set to true, the page blob will be created when uploading + * page blob. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder createPageBlob( + boolean createPageBlob) { + doSetProperty("createPageBlob", createPageBlob); + return this; + } + /** + * When is set to true, the page blob will be created when uploading + * page blob. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: true + * Group: producer + */ + default BlobEndpointProducerBuilder createPageBlob(String createPageBlob) { + doSetProperty("createPageBlob", createPageBlob); + return this; + } + /** + * Override the default expiration (millis) of URL download link. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Group: producer + */ + default BlobEndpointProducerBuilder downloadLinkExpiration( + Long downloadLinkExpiration) { + doSetProperty("downloadLinkExpiration", downloadLinkExpiration); + return this; + } + /** + * Override the default expiration (millis) of URL download link. + * + * The option will be converted to a <code>java.lang.Long</code> type. + * + * Group: producer + */ + default BlobEndpointProducerBuilder downloadLinkExpiration( + String downloadLinkExpiration) { + doSetProperty("downloadLinkExpiration", downloadLinkExpiration); + return this; + } + /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during @@ -863,6 +1164,32 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Specifies the maximum size for the page blob, up to 8 TB. The page + * blob size must be aligned to a 512-byte boundary. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Default: 512 + * Group: producer + */ + default BlobEndpointProducerBuilder pageBlobSize(Long pageBlobSize) { + doSetProperty("pageBlobSize", pageBlobSize); + return this; + } + /** + * Specifies the maximum size for the page blob, up to 8 TB. The page + * blob size must be aligned to a 512-byte boundary. + * + * The option will be converted to a <code>java.lang.Long</code> type. + * + * Default: 512 + * Group: producer + */ + default BlobEndpointProducerBuilder pageBlobSize(String pageBlobSize) { + doSetProperty("pageBlobSize", pageBlobSize); + return this; + } + /** * Access key for the associated azure account name to be used for * authentication with azure blob services. * @@ -1153,6 +1480,35 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option is a: <code>java.lang.Integer</code> type. + * + * Group: common + */ + default BlobEndpointBuilder maxResultsPerPage(Integer maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** + * Specifies the maximum number of blobs to return, including all + * BlobPrefix elements. If the request does not specify + * maxResultsPerPage or specifies a value greater than 5,000, the server + * will return up to 5,000 items. + * + * The option will be converted to a <code>java.lang.Integer</code> + * type. + * + * Group: common + */ + default BlobEndpointBuilder maxResultsPerPage(String maxResultsPerPage) { + doSetProperty("maxResultsPerPage", maxResultsPerPage); + return this; + } + /** * Specifies the maximum number of additional HTTP Get requests that * will be made while reading the data from a response body. * @@ -1179,6 +1535,18 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * Filters the results to return only blobs whose names begin with the + * specified prefix. May be null to return all blobs. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + */ + default BlobEndpointBuilder prefix(String prefix) { + doSetProperty("prefix", prefix); + return this; + } + /** * Client to a storage account. This client does not hold any state * about a particular storage account but is instead a convenient way of * sending off appropriate requests to the resource on the service. It @@ -1219,6 +1587,31 @@ public interface BlobEndpointBuilderFactory { return this; } /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option is a: <code>java.time.Duration</code> type. + * + * Group: common + */ + default BlobEndpointBuilder timeout(Duration timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** + * An optional timeout value beyond which a RuntimeException will be + * raised. + * + * The option will be converted to a <code>java.time.Duration</code> + * type. + * + * Group: common + */ + default BlobEndpointBuilder timeout(String timeout) { + doSetProperty("timeout", timeout); + return this; + } + /** * Access key for the associated azure account name to be used for * authentication with azure blob services. * @@ -1310,6 +1703,16 @@ public interface BlobEndpointBuilderFactory { } /** + * Proxy enum for <code>com.azure.storage.blob.models.BlockListType</code> + * enum. + */ + enum BlockListType { + COMMITTED, + UNCOMMITTED, + ALL; + } + + /** * Proxy enum for * <code>org.apache.camel.component.azure.storage.blob.BlobOperationsDefinition</code> enum. */