Class DataLakeLeaseClientBuilder
- java.lang.Object
-
- com.azure.storage.file.datalake.specialized.DataLakeLeaseClientBuilder
-
public final class DataLakeLeaseClientBuilder extends Object
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 file system and path clients and act as a supplement client. A new instance ofDataLakeLeaseClientandDataLakeLeaseAsyncClientare constructed every timebuildClientandbuildAsyncClientare called respectively.When a client is instantiated and a
leaseIdhasn't been set aUUIDwill be used as the lease identifier.Instantiating LeaseClients
DataLakeLeaseClient dataLakeLeaseClient = new DataLakeLeaseClientBuilder() .fileClient(fileClient) .leaseId(leaseId) .buildClient();DataLakeLeaseClient dataLakeLeaseClient = new DataLakeLeaseClientBuilder() .directoryClient(directoryClient) .leaseId(leaseId) .buildClient();DataLakeLeaseClient dataLakeLeaseClient = new DataLakeLeaseClientBuilder() .fileSystemClient(dataLakeFileSystemClient) .leaseId(leaseId) .buildClient();Instantiating LeaseAsyncClients
DataLakeLeaseAsyncClient dataLakeLeaseAsyncClient = new DataLakeLeaseClientBuilder() .fileAsyncClient(fileAsyncClient) .leaseId(leaseId) .buildAsyncClient();DataLakeLeaseAsyncClient dataLakeLeaseAsyncClient = new DataLakeLeaseClientBuilder() .directoryAsyncClient(directoryAsyncClient) .leaseId(leaseId) .buildAsyncClient();DataLakeLeaseAsyncClient dataLakeLeaseAsyncClient = new DataLakeLeaseClientBuilder() .fileSystemAsyncClient(dataLakeFileSystemAsyncClient) .leaseId(leaseId) .buildAsyncClient();- See Also:
DataLakeLeaseClient,DataLakeLeaseAsyncClient
-
-
Constructor Summary
Constructors Constructor Description DataLakeLeaseClientBuilder()Creates a new instance ofDataLakeLeaseClientBuilder.
-
Method Summary
-
-
-
Constructor Detail
-
DataLakeLeaseClientBuilder
public DataLakeLeaseClientBuilder()
Creates a new instance ofDataLakeLeaseClientBuilder.
-
-
Method Detail
-
buildClient
public DataLakeLeaseClient buildClient()
Creates aDataLakeLeaseClientbased on the configurations set in the builder.- Returns:
- a
DataLakeLeaseClientbased on the configurations in this builder.
-
buildAsyncClient
public DataLakeLeaseAsyncClient buildAsyncClient()
Creates aDataLakeLeaseAsyncClientbased on the configurations set in the builder.- Returns:
- a
DataLakeLeaseAsyncClientbased on the configurations in this builder.
-
fileClient
public DataLakeLeaseClientBuilder fileClient(DataLakeFileClient dataLakeFileClient)
Configures the builder based on the passedDataLakeFileClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeFileClient- DataLakeFileClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfDataLakeFileClientisnull.
-
fileAsyncClient
public DataLakeLeaseClientBuilder fileAsyncClient(DataLakeFileAsyncClient dataLakeFileAsyncClient)
Configures the builder based on the passedDataLakeFileAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeFileAsyncClient- DataLakeFileAsyncClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfDataLakeFileAsyncClientisnull.
-
directoryClient
public DataLakeLeaseClientBuilder directoryClient(DataLakeDirectoryClient dataLakeDirectoryClient)
Configures the builder based on the passedDataLakeDirectoryClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeDirectoryClient- DataLakeDirectoryClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfDataLakeDirectoryClientisnull.
-
directoryAsyncClient
public DataLakeLeaseClientBuilder directoryAsyncClient(DataLakeDirectoryAsyncClient dataLakeDirectoryAsyncClient)
Configures the builder based on the passedDataLakeDirectoryAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeDirectoryAsyncClient- DataLakeDirectoryAsyncClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfDataLakeDirectoryAsyncClientisnull.
-
fileSystemClient
public DataLakeLeaseClientBuilder fileSystemClient(DataLakeFileSystemClient dataLakeFileSystemClient)
Configures the builder based on the passedDataLakeFileSystemClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeFileSystemClient- DataLakeFileSystemClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfdataLakeFileSystemClientisnull.
-
fileSystemAsyncClient
public DataLakeLeaseClientBuilder fileSystemAsyncClient(DataLakeFileSystemAsyncClient dataLakeFileSystemAsyncClient)
Configures the builder based on the passedDataLakeFileSystemAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
dataLakeFileSystemAsyncClient- DataLakeFileSystemAsyncClient used to configure the builder.- Returns:
- the updated DataLakeLeaseClientBuilder object
- Throws:
NullPointerException- IfdataLakeFileSystemAsyncClientisnull.
-
leaseId
public DataLakeLeaseClientBuilder leaseId(String leaseId)
Sets the identifier for the lease.If a lease ID isn't set then a
UUIDwill be used.- Parameters:
leaseId- Identifier for the lease.- Returns:
- the updated DataLakeLeaseClientBuilder object
-
-