C
- The service client typeP
- The type of the parent object, i.e. CloudBlobContainer for downloadAttributes etc.R
- The type of the expected resultpublic abstract class StorageRequest<C,P,R> extends Object
Modifier | Constructor and Description |
---|---|
protected |
StorageRequest()
Default Ctor.
|
|
StorageRequest(RequestOptions options,
StorageUri storageUri)
Initializes a new instance of the StorageRequest class.
|
protected StorageRequest()
public StorageRequest(RequestOptions options, StorageUri storageUri)
options
- the RequestOptions to usepublic final StorageException getException()
public final RequestOptions getRequestOptions()
public final RequestResult getResult()
public final HttpURLConnection getConnection()
public final InputStream getSendStream()
public Long getOffset()
public Long getLength()
public final String getLockedETag()
public final String getContentMD5()
protected StreamMd5AndLength getCurrentDescriptor()
public LocationMode getLocationMode()
public RequestLocationMode getRequestLocationMode()
public StorageLocation getCurrentLocation()
public AccessCondition getETagLockCondition()
public boolean getArePropertiesPopulated()
public StorageUri getStorageUri()
public long getCurrentRequestByteCount()
protected boolean isSent()
protected final void initialize(OperationContext opContext)
public final boolean isNonExceptionedRetryableFailure()
protected final StorageException materializeException(OperationContext opContext)
request
- the reference to the HttpURLConnection for the operation.opContext
- an object used to track the execution of the operationpublic static final void signBlobQueueAndFileRequest(HttpURLConnection request, ServiceClient client, long contentLength, OperationContext context) throws InvalidKeyException, StorageException
InvalidKeyException
StorageException
public static final void signTableRequest(HttpURLConnection request, ServiceClient client, long contentLength, OperationContext context) throws InvalidKeyException, StorageException
InvalidKeyException
StorageException
public void applyLocationModeToRequest()
public void initializeLocation()
public void validateLocation()
protected final void setException(StorageException exceptionReference)
exceptionReference
- the exception to setpublic final void setNonExceptionedRetryableFailure(boolean nonExceptionedRetryableFailure)
nonExceptionedRetryableFailure
- the nonExceptionedRetryableFailure to setprotected final void setRequestOptions(RequestOptions requestOptions)
requestOptions
- the requestOptions to setpublic final void setResult(RequestResult result)
result
- the result to setpublic final void setConnection(HttpURLConnection connection)
connection
- the connection to setpublic void setSendStream(InputStream sendStream)
sendStream
- the stream to send to the serverpublic void setOffset(Long offset)
offset
- the stream offset to start copying frompublic void setLength(Long length)
length
- the length, in bytes, of the streampublic void setLockedETag(String lockedETag)
lockedETag
- the locked ETagpublic void setContentMD5(String contentMD5)
contentMD5
- the contentMD5protected void setCurrentDescriptor(StreamMd5AndLength currentDescriptor)
currentDescriptor
- the descriptor valuepublic void setETagLockCondition(AccessCondition etagLockCondition)
etagLockCondition
- the locked ETag conditionpublic void setArePropertiesPopulated(boolean arePropertiesPopulated)
arePropertiesPopulated
- the arePropertiesPopulated valuepublic void setLocationMode(LocationMode locationMode)
locationMode
- the locationMode valuepublic void setRequestLocationMode(RequestLocationMode requestLocationMode)
requestLocationMode
- the requestLocationMode valuepublic void setCurrentLocation(StorageLocation currentLocation)
storageLocation
- the storageLocation valuepublic void setStorageUri(StorageUri storageUri)
storageUri
- the storageUri valuepublic void setCurrentRequestByteCount(long currentRequestByteCount)
currentRequestByteCount
- the currentRequestByteCount to setpublic void setRequestLocationMode()
protected void setIsSent(boolean isSent)
isSent
- the isSent valuepublic abstract HttpURLConnection buildRequest(C client, P parentObject, OperationContext context) throws Exception
parentObject
- Parent object, i.e. CloudBlobContainer for downloadAttributes etc.context
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.Exception
public void setHeaders(HttpURLConnection connection, P parentObject, OperationContext context)
connection
- HttpURLConnection configured for the operation.parentObject
- Parent object, i.e. CloudBlobContainer for downloadAttributes etc.context
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.public abstract void signRequest(HttpURLConnection connection, C client, OperationContext context) throws Exception
connection
- HttpURLConnection configured for the operation.client
- The service client.context
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.Exception
public abstract R preProcessResponse(P parentObject, C client, OperationContext context) throws Exception
command
- StorageCommand for the operation.parentObject
- Parent object, i.e. CloudBlobContainer for downloadAttributes etc.client
- The service client.Exception
public R postProcessResponse(HttpURLConnection connection, P parentObject, C client, OperationContext context, R storageObject) throws Exception
connection
- HttpURLConnection configured for the operation.storageObject
- An object of the expected result's type.Exception
public void validateStreamWrite(StreamMd5AndLength descriptor) throws StorageException
StorageException
public void recoveryAction(OperationContext context) throws IOException
IOException
public StorageExtendedErrorInformation parseErrorDetails()
StorageExtendedErrorInformation
object that represents the error details for the specified
request.Copyright © 2019. All rights reserved.