BlobLeaseClientBuilder Class
- java.
lang. Object - com.
azure. storage. blob. specialized. BlobLeaseClientBuilder
- com.
public final class BlobLeaseClientBuilder
This class provides a fluent builder API to help aid the configuration and instantiation of Storage Lease clients. Lease clients are able to interact with both container and blob clients and act as a supplement client. A new instance of BlobLeaseClient and BlobLeaseAsyncClient are constructed every time buildClient() and buildAsyncClient() are called respectively.
When a client is instantiated and a leaseId(String leaseId) hasn't been set a UUID will be used as the lease identifier.
Instantiating LeaseClients
BlobLeaseClient blobLeaseClient = new BlobLeaseClientBuilder()
.blobClient(blobClient)
.leaseId(leaseId)
.buildClient();
BlobLeaseClient blobLeaseClient = new BlobLeaseClientBuilder()
.containerClient(blobContainerClient)
.leaseId(leaseId)
.buildClient();
Instantiating LeaseAsyncClients
BlobLeaseAsyncClient blobLeaseAsyncClient = new BlobLeaseClientBuilder()
.blobAsyncClient(blobAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
BlobLeaseAsyncClient blobLeaseAsyncClient = new BlobLeaseClientBuilder()
.containerAsyncClient(blobContainerAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
Constructor Summary
Constructor | Description | |
---|---|---|
BlobLeaseClientBuilder() |
Method Summary
Modifier and Type | Method and Description |
---|---|
Blob |
blobAsyncClient(BlobAsyncClientBase blobAsyncClient)
Configures the builder based on the passed BlobAsyncClient. |
Blob |
blobClient(BlobClientBase blobClient)
Configures the builder based on the passed BlobClient. |
Blob |
buildAsyncClient()
Creates a BlobLeaseAsyncClient based on the configurations set in the builder. |
Blob |
buildClient()
Creates a BlobLeaseClient based on the configurations set in the builder. |
Blob |
containerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)
Configures the builder based on the passed BlobContainerAsyncClient. |
Blob |
containerClient(BlobContainerClient blobContainerClient)
Configures the builder based on the passed BlobContainerClient. |
Blob |
leaseId(String leaseId)
Sets the identifier for the lease. |
Methods inherited from java.lang.Object
Constructor Details
BlobLeaseClientBuilder
public BlobLeaseClientBuilder()
Method Details
blobAsyncClient
public BlobLeaseClientBuilder blobAsyncClient(BlobAsyncClientBase blobAsyncClient)
Configures the builder based on the passed BlobAsyncClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
blobClient
public BlobLeaseClientBuilder blobClient(BlobClientBase blobClient)
Configures the builder based on the passed BlobClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
buildAsyncClient
public BlobLeaseAsyncClient buildAsyncClient()
Creates a BlobLeaseAsyncClient based on the configurations set in the builder.
Returns:
buildClient
public BlobLeaseClient buildClient()
Creates a BlobLeaseClient based on the configurations set in the builder.
Returns:
containerAsyncClient
public BlobLeaseClientBuilder containerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)
Configures the builder based on the passed BlobContainerAsyncClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
containerClient
public BlobLeaseClientBuilder containerClient(BlobContainerClient blobContainerClient)
Configures the builder based on the passed BlobContainerClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
leaseId
public BlobLeaseClientBuilder leaseId(String leaseId)
Sets the identifier for the lease.
If a lease ID isn't set then a UUID will be used.
Parameters:
Returns:
Applies to
Azure SDK for Java