Class AzureBlobStorageFactory

java.lang.Object
io.micronaut.objectstorage.azure.AzureBlobStorageFactory

@Factory public class AzureBlobStorageFactory extends Object

Creates beans of the following types:

  • For each AzureBlobStorageConfiguration, creates a BlobServiceClientBuilder.
  • For each BlobServiceClientBuilder, creates a BlobServiceClient
  • For each BlobServiceClient, creates a BlobContainerClient
Since:
1.0
Author:
Pavol Gressa
  • Constructor Details

    • AzureBlobStorageFactory

      public AzureBlobStorageFactory(io.micronaut.context.BeanContext beanContext)
  • Method Details

    • blobServiceClientBuilderWithTokenCredential

      @EachBean(AzureBlobStorageConfiguration.class) @Requires(bean=com.azure.core.credential.TokenCredential.class) @Requires(missingBeans=com.azure.storage.common.StorageSharedKeyCredential.class) public com.azure.storage.blob.BlobServiceClientBuilder blobServiceClientBuilderWithTokenCredential(AzureBlobStorageConfiguration configuration, @NonNull @NonNull com.azure.core.credential.TokenCredential tokenCredential)
      Parameters:
      configuration - the configuration
      tokenCredential - the token credential
      Returns:
      the BlobServiceClientBuilder
    • blobServiceClientBuilderWithSharedKeyCredential

      @EachBean(AzureBlobStorageConfiguration.class) @Requires(bean=com.azure.storage.common.StorageSharedKeyCredential.class) public com.azure.storage.blob.BlobServiceClientBuilder blobServiceClientBuilderWithSharedKeyCredential(AzureBlobStorageConfiguration configuration, @NonNull @NonNull com.azure.storage.common.StorageSharedKeyCredential sharedKeyCredential)
      Parameters:
      configuration - the configuration
      sharedKeyCredential - the shared key credential
      Returns:
      the BlobServiceClientBuilder
    • blobServiceClient

      @EachBean(com.azure.storage.blob.BlobServiceClientBuilder.class) public com.azure.storage.blob.BlobServiceClient blobServiceClient(@NonNull @NonNull com.azure.storage.blob.BlobServiceClientBuilder builder)
      Parameters:
      builder - the builder
      Returns:
      the BlobServiceClient
    • blobContainerClient

      @EachBean(com.azure.storage.blob.BlobServiceClient.class) public com.azure.storage.blob.BlobContainerClient blobContainerClient(@Parameter String name, @NonNull @NonNull com.azure.storage.blob.BlobServiceClient serviceClient)
      Parameters:
      name - The configuration
      serviceClient - The service client
      Returns:
      The BlobContainerClient