CloudBlob.acquireLease Method

Definition

Overloads

acquireLease()

Acquires a new infinite lease on the blob.

acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)

Acquires a new lease on the blob with the specified lease time and proposed lease ID.

acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Acquires a new lease on the blob with the specified lease time, proposed lease ID, request options, and operation context.

acquireLease()

Acquires a new infinite lease on the blob.

public final String acquireLease()
Returns
final String

A String that represents the lease ID.

Exceptions

If a storage service error occurred.

acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)

Acquires a new lease on the blob with the specified lease time and proposed lease ID.

public final String acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)
Parameters
leaseTimeInSeconds
final Integer

An Integer which specifies the span of time for which to acquire the lease, in seconds. If null, an infinite lease will be acquired. If not null, the value must be greater than zero.

proposedLeaseId
final String

A String that represents the proposed lease ID for the new lease, or null if no lease ID is proposed.

Returns
final String

A String that represents the lease ID.

Exceptions

If a storage service error occurred.

acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Acquires a new lease on the blob with the specified lease time, proposed lease ID, request options, and operation context.

public final String acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Parameters
leaseTimeInSeconds
final Integer

An Integer which specifies the span of time for which to acquire the lease, in seconds. If null, an infinite lease will be acquired. If not null, the value must be greater than zero.

proposedLeaseId
final String

A String that represents the proposed lease ID for the new lease, or null if no lease ID is proposed.

accessCondition
final AccessCondition

An AccessCondition object that represents the access conditions for the blob.

options
BlobRequestOptions

A BlobRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (CloudBlobClient).

opContext
OperationContext

An OperationContext object that represents the context for the current operation. The context is used to track requests to the storage service, and to provide additional runtime information about the operation.

Returns
final String

A String that represents the lease ID.

Exceptions

If a storage service error occurred.