Beispiel #1
0
        private IEnumerator <IAsyncResult> SetPropertiesImpl(string contentType, long?maxBlobSize, NameValueCollection serviceMetadata, ServiceMetadataUpdatePolicy serviceMetadataPolicy, string[] serviceMetadataPolicyArguments, NameValueCollection applicationMetadata, ISequenceNumberUpdate sequenceNumberUpdate, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSetProperties(contentType, maxBlobSize, serviceMetadata, serviceMetadataPolicy, serviceMetadataPolicyArguments, applicationMetadata, sequenceNumberUpdate, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.SetPropertiesImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndSetProperties(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #2
0
        private IEnumerator <IAsyncResult> GetBlockListImpl(IBlobObjectCondition condition, BlockListTypes blockListTypes, BlobServiceVersion blobServiceVersion, AsyncIteratorContext <IBlockLists> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = ((IListBlobObject)this.blob).BeginGetBlockList(Helpers.Convert(condition), blockListTypes, blobServiceVersion, context.GetResumeCallback(), context.GetResumeState("RealBlobObject.GetBlockListImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = ((IListBlobObject)this.blob).EndGetBlockList(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #3
0
        private IEnumerator <IAsyncResult> PutBlockImpl(byte[] blockIdentifier, long contentLength, Stream inputStream, CrcReaderStream crcReaderStream, byte[] contentMD5, bool isLargeBlockBlobRequest, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = ((IListBlobObject)this.blob).BeginPutBlock(blockIdentifier, contentLength, inputStream, crcReaderStream, contentMD5, isLargeBlockBlobRequest, condition, context.GetResumeCallback(), context.GetResumeState("RealBlobObject.PutBlockImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                ((IListBlobObject)this.blob).EndPutBlock(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #4
0
        private IEnumerator <IAsyncResult> BreakLeaseImpl(TimeSpan?leaseBreakPeriod, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.InternalContainer.BeginBreakLease(leaseBreakPeriod, Helpers.Convert(condition), updateLastModificationTime, useContainerNotFoundError, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.BreakLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndBreakLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #5
0
        private IEnumerator <IAsyncResult> DeleteContainerImpl(IContainerCondition conditions, Guid?leaseId, AsyncIteratorContext <NoResults> context)
        {
            object                 obj;
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] timeout  = new object[2];
            object[] objArray = timeout;
            obj         = (leaseId.HasValue ? leaseId.ToString() : "<null>");
            objArray[0] = obj;
            timeout[1]  = base.Timeout;
            verboseDebug.Log("DeleteContainerImpl({0},{1})", timeout);
            try
            {
                asyncResult = this.InternalContainer.BeginDeleteContainer(Helpers.Convert(conditions), leaseId, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.DeleteBlobContainerImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndDeleteContainer(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #6
0
        private IEnumerator <IAsyncResult> DeleteTableContainerImpl(string tableName, IContainerCondition conditions, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { tableName, this.Timeout };
            verboseDebug.Log("DeleteTableContainerImpl({0},{1})", objArray);
            try
            {
                asyncResult = this.internalAccount.BeginDeleteTableContainer(tableName, Helpers.Convert(conditions), context.GetResumeCallback(), context.GetResumeState("StorageAccount.DeleteTableContainerImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.internalAccount.EndDeleteTableContainer(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #7
0
        private IEnumerator <IAsyncResult> ListTableContainersImpl(string tableName, ContainerPropertyNames propertyNames, string separator, string tableNameStart, IContainerCondition condition, int maxContainerNames, AsyncIteratorContext <ITableContainerCollection> context)
        {
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { tableName, propertyNames, separator, tableNameStart, condition, maxContainerNames, this.Timeout };
            verboseDebug.Log("ListTableContainersImpl({0},{1},{2},{3},{4},{5},{6})", objArray);
            try
            {
                asyncResult = this.internalAccount.BeginListTableContainers(tableName, propertyNames, separator, tableNameStart, Helpers.Convert(condition), maxContainerNames, context.GetResumeCallback(), context.GetResumeState("StorageStamp.ListTableContainersImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                ITableContainerCollection tableContainerCollections = this.internalAccount.EndListTableContainers(asyncResult);
                context.ResultData = new TableContainerCollection(tableContainerCollections);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #8
0
        private IEnumerator <IAsyncResult> ChangeLeaseImpl(Guid leaseId, Guid proposedLeaseId, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginChangeLease(leaseId, proposedLeaseId, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.ChangeLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndChangeLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #9
0
        private IEnumerator <IAsyncResult> GetBlobImpl(IBlobRegion blobRegion, BlobPropertyNames propertyNames, IBlobObjectCondition condition, AsyncIteratorContext <CrcStream> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginGetBlob(blobRegion, propertyNames, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("RealBlobObject.GetBlobImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = this.blob.EndGetBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #10
0
        private IEnumerator <IAsyncResult> AsynchronousCopyBlobImpl(UriString copySource, bool isSourceAzureBlob, FECopyType copyType, long contentLength, string contentType, NameValueCollection serviceMetadataCollection, byte[] applicationMetadata, ISequenceNumberUpdate sequenceNumberUpdate, OverwriteOption overwriteOption, string sourceETag, IBlobObjectCondition destinationCondition, AsyncIteratorContext <CopyBlobOperationInfo> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginAsynchronousCopyBlob(copySource, isSourceAzureBlob, copyType, contentLength, contentType, serviceMetadataCollection, applicationMetadata, sequenceNumberUpdate, overwriteOption, sourceETag, Helpers.Convert(destinationCondition), context.GetResumeCallback(), context.GetResumeState("IBlobObject.BeginAsynchronousCopyBlob"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            CopyBlobOperationInfo copyBlobOperationInfo = null;

            try
            {
                copyBlobOperationInfo = this.blob.EndAsynchronousCopyBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            context.ResultData = copyBlobOperationInfo;
        }
Beispiel #11
0
        private IEnumerator <IAsyncResult> BreakLeaseImpl(TimeSpan?leaseBreakPeriod, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginBreakLease(leaseBreakPeriod, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.BreakLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndBreakLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #12
0
        private IEnumerator <IAsyncResult> AbortCopyBlobImpl(Guid copyId, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginAbortCopyBlob(copyId, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.AbortCopyBlobImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndAbortCopyBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #13
0
        private IEnumerator <IAsyncResult> SynchronousCopyBlobImpl(string sourceAccount, IBlobObject sourceBlob, DateTime?expiryTime, byte[] applicationMetadata, OverwriteOption overwriteOption, IBlobObjectCondition sourceCondition, IBlobObjectCondition destinationCondition, UriString copySource, AsyncIteratorContext <CopyBlobOperationInfo> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSynchronousCopyBlob(sourceAccount, ((BaseBlobObject)sourceBlob).blob, StorageStampHelpers.AdjustNullableDatetimeRange(expiryTime), applicationMetadata, overwriteOption, Helpers.Convert(sourceCondition), Helpers.Convert(destinationCondition), copySource, context.GetResumeCallback(), context.GetResumeState("IBlobObject.BeginSynchronousCopyBlob"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            CopyBlobOperationInfo copyBlobOperationInfo = null;

            try
            {
                copyBlobOperationInfo = this.blob.EndSynchronousCopyBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            context.ResultData = copyBlobOperationInfo;
        }
Beispiel #14
0
        private IEnumerator <IAsyncResult> SnapshotBlobImpl(byte[] metadata, IBlobObjectCondition condition, AsyncIteratorContext <DateTime> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSnapshotBlob(metadata, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.SnapshotBlobImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            DateTime minValue = DateTime.MinValue;

            try
            {
                minValue = this.blob.EndSnapshotBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            NephosAssertionException.Assert(minValue != DateTime.MinValue, "The snapshot timestamp must be set!");
            context.ResultData = minValue;
        }
Beispiel #15
0
        private IEnumerator <IAsyncResult> ClearPageImpl(IBlobRegion blobRegion, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = ((IIndexBlobObject)this.blob).BeginClearPage(blobRegion, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("IndexBlobObject.ClearPageImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                ((IIndexBlobObject)this.blob).EndClearPage(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #16
0
        private IEnumerator <IAsyncResult> GetPropertiesImpl(BlobPropertyNames propertyNames, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginGetProperties(propertyNames, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.GetPropertiesImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndGetProperties(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #17
0
        private IEnumerator <IAsyncResult> CreateTableContainerImpl(string tableName, DateTime?expiryTime, byte[] serviceMetadata, byte[] applicationMetadata, AsyncIteratorContext <ITableContainer> context)
        {
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { tableName, expiryTime, serviceMetadata, applicationMetadata, this.Timeout };
            verboseDebug.Log("CreateTableContainerImpl({0},{1},{2},{3},{4})", objArray);
            try
            {
                asyncResult = this.internalAccount.BeginCreateTableContainer(tableName, StorageStampHelpers.AdjustNullableDatetimeRange(expiryTime), serviceMetadata, applicationMetadata, context.GetResumeCallback(), context.GetResumeState("StorageAccount.CreateTableContainerImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                ITableContainer tableContainer = this.internalAccount.EndCreateTableContainer(asyncResult);
                context.ResultData = new TableContainer(tableContainer);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #18
0
        private IEnumerator <IAsyncResult> PutBlobImpl(string contentType, long contentLength, long?maxBlobSize, byte[] serviceMetadata, byte[] applicationMetadata, Stream inputStream, CrcReaderStream crcReaderStream, byte[] contentMD5, bool invokeGeneratePutBlobServiceMetadata, GeneratePutBlobServiceMetadata generatePutBlobServiceMetadata, bool isLargeBlockBlobRequest, bool is8TBPageBlobAllowed, ISequenceNumberUpdate sequenceNumberUpdate, OverwriteOption overwriteOption, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            if (contentLength < (long)0)
            {
                throw new ArgumentOutOfRangeException("contentLength", "contentLength must be >= 0");
            }
            try
            {
                asyncResult = this.blob.BeginPutBlob(contentType, contentLength, maxBlobSize, serviceMetadata, applicationMetadata, inputStream, crcReaderStream, contentMD5, invokeGeneratePutBlobServiceMetadata, generatePutBlobServiceMetadata, isLargeBlockBlobRequest, is8TBPageBlobAllowed, sequenceNumberUpdate, overwriteOption, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("RealBlobObject.PutBlobImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndPutBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #19
0
        private IEnumerator <IAsyncResult> GetPropertiesImplOld(AccountPropertyNames propertyNames, IAccountCondition condition, CacheRefreshOptions cacheRefreshOptions, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.internalAccount.BeginGetProperties(propertyNames, condition, context.GetResumeCallback(), context.GetResumeState("StorageAccount.GetPropertiesImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.internalAccount.EndGetProperties(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #20
0
        private IEnumerator <IAsyncResult> RenewLeaseImpl(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginRenewLease(leaseType, leaseId, leaseDuration, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.RenewLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndRenewLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #21
0
        private IEnumerator <IAsyncResult> SetPropertiesImpl(AccountPropertyNames propertyNames, IAccountCondition conditions, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { propertyNames, conditions, this.Timeout };
            verboseDebug.Log("SetPropertiesImpl({0},{1},{2})", objArray);
            try
            {
                asyncResult = this.internalAccount.BeginSetProperties(propertyNames, null, context.GetResumeCallback(), context.GetResumeState("StorageAccount.SetPropertiesImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.internalAccount.EndSetProperties(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #22
0
        private IEnumerator <IAsyncResult> SetApplicationMetadataImpl(byte[] metadata, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSetApplicationMetadata(metadata, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.SetApplicationMetadataImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndSetApplicationMetadata(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #23
0
        private IEnumerator <IAsyncResult> CreateContainerImpl(DateTime?expiryTime, byte[] serviceMetadata, byte[] applicationMetadata, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult           asyncResult;
            IStringDataEventStream verboseDebug = Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { expiryTime, serviceMetadata, applicationMetadata, base.Timeout };
            verboseDebug.Log("CreateContainerImpl({0},{1},{2},{3})", objArray);
            try
            {
                asyncResult = this.InternalContainer.BeginCreateContainer(StorageStampHelpers.AdjustNullableDatetimeRange(expiryTime), serviceMetadata, applicationMetadata, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.CreateContainerImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndCreateContainer(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #24
0
        private IEnumerator <IAsyncResult> SetExpiryTimeImpl(DateTime expiryTime, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginSetExpiryTime(StorageStampHelpers.AdjustDateTimeRange(expiryTime), Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.SetExpiryTimeImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndSetExpiryTime(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #25
0
        private IEnumerator <IAsyncResult> AcquireLeaseImpl(LeaseType leaseType, TimeSpan leaseDuration, Guid?proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.InternalContainer.BeginAcquireLease(leaseType, leaseDuration, proposedLeaseId, Helpers.Convert(condition), updateLastModificationTime, useContainerNotFoundError, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.AcquireLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndAcquireLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #26
0
        private IEnumerator <IAsyncResult> ListBlobsImpl(string blobNamePrefix, BlobPropertyNames propertyNames, string separator, string blobNameStart, DateTime?snapshotStart, IBlobObjectCondition condition, int maxBlobNames, BlobServiceVersion version, AsyncIteratorContext <IBlobObjectCollection> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.InternalContainer.BeginListBlobs(blobNamePrefix, propertyNames, separator, blobNameStart, snapshotStart, Helpers.Convert(condition), maxBlobNames, version, context.GetResumeCallback(), context.GetResumeState("BlobContainer.ListBlobsImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                IBlobObjectCollection blobObjectCollections = this.InternalContainer.EndListBlobs(asyncResult);
                context.ResultData = new BlobObjectCollection(blobObjectCollections);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #27
0
        private IEnumerator <IAsyncResult> PutBlobImpl(string contentType, long contentLength, byte[] serviceMetadata, byte[] applicationMetadata, byte[][] blockIdList, BlockSource[] blockSourceList, byte[] contentMD5, OverwriteOption overwriteOption, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;
            bool         flag = contentLength == (long)-1;

            object[] objArray = new object[] { contentLength };
            NephosAssertionException.Assert(flag, "The contentLength we are going to pass into XStore for commiting blob is invalid: {0}", objArray);
            try
            {
                asyncResult = ((IListBlobObject)this.blob).BeginPutBlob(contentType, contentLength, serviceMetadata, applicationMetadata, blockIdList, blockSourceList, contentMD5, overwriteOption, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("RealBlobObject.PutBlobImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndPutBlob(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #28
0
        private IEnumerator <IAsyncResult> GetPageRangeListImpl(IBlobRegion blobRegion, BlobPropertyNames additionalPropertyNames, IBlobObjectCondition condition, int maxPageRanges, DateTime?prevSnapshotTimestamp, bool isRangeCompressed, bool skipClearPages, AsyncIteratorContext <IPageRangeCollection> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = ((IIndexBlobObject)this.blob).BeginGetPageRangeList(blobRegion, additionalPropertyNames, Helpers.Convert(condition), maxPageRanges, prevSnapshotTimestamp, isRangeCompressed, skipClearPages, context.GetResumeCallback(), context.GetResumeState("IndexBlobObject.GetPageRangeListImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = ((IIndexBlobObject)this.blob).EndGetPageRangeList(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #29
0
        private IEnumerator <IAsyncResult> AppendBlockImpl(long contentLength, Stream inputStream, CrcReaderStream crcReaderStream, IBlobObjectCondition condition, long?conditionalMaxBlobSize, long?conditionalAppendBlockPosition, AsyncIteratorContext <IAppendBlockResult> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = ((IListBlobObject)this.blob).BeginAppendBlock(contentLength, inputStream, crcReaderStream, condition, conditionalMaxBlobSize, conditionalAppendBlockPosition, context.GetResumeCallback(), context.GetResumeState("RealBlobObject.AppendBlockImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                ((IListBlobObject)this.blob).EndAppendBlock(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
Beispiel #30
0
        private IEnumerator <IAsyncResult> SetPropertiesImpl(ContainerPropertyNames propertyNames, IContainerCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.container.BeginSetProperties(propertyNames, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BlobContainer.SetProperties"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.container.EndSetProperties(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }