public IAsyncResult BeginBreakLease(TimeSpan?leaseBreakPeriod, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("BaseBlobContainer.BreakLease", callback, state); asyncIteratorContext.Begin(this.BreakLeaseImpl(leaseBreakPeriod, condition, updateLastModificationTime, useContainerNotFoundError, asyncIteratorContext)); return(asyncIteratorContext); }
public IAsyncResult BeginGetProperties(ContainerPropertyNames propertyNames, IContainerCondition condition, CacheRefreshOptions cacheRefreshOptions, bool shouldUpdateCacheEntryOnRefresh, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbTableContainer.GetProperties", callback, state); asyncIteratorContext.Begin(this.GetPropertiesImpl(propertyNames, condition, asyncIteratorContext)); return(asyncIteratorContext); }
private IEnumerator <IAsyncResult> ReleaseLeaseImpl(Guid leaseId, IContainerCondition condition, bool updateLastModificationTime, AsyncIteratorContext <NoResults> context) { IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => { using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer nullable = this.LoadBlobContainer(dbContext); DbBlobContainer.CheckBlobContainerConditionWithoutLeaseCondition(nullable, condition); DateTime utcNow = DateTime.UtcNow; ContainerLeaseInfo containerLeaseInfo = new ContainerLeaseInfo(nullable, utcNow); if (containerLeaseInfo.Id.HasValue && containerLeaseInfo.Id.Value != leaseId) { throw new LeaseLostException(); } if (containerLeaseInfo.State.Value == LeaseState.Available) { throw new LeaseLostException(); } nullable.LeaseEndTime = new DateTime?(utcNow); nullable.LeaseState = 0; nullable.IsLeaseOp = !updateLastModificationTime; dbContext.SubmitChanges(); containerLeaseInfo.SetBlobContainer(nullable, utcNow); this._container = nullable; this.LeaseInfo = containerLeaseInfo; } }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbBlobContainer.ReleaseLease")); yield return(asyncResult); this.StorageManager.AsyncProcessor.EndExecute(asyncResult); }
public IAsyncResult BeginDeleteTableContainer(string tableName, IContainerCondition conditions, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("StorageAccount.DeleteTableContainer", callback, state); asyncIteratorContext.Begin(this.DeleteTableContainerImpl(tableName, conditions, asyncIteratorContext)); return(asyncIteratorContext); }
public IAsyncResult BeginSetProperties(ContainerPropertyNames propertyNames, IContainerCondition condition, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbBlobContainer.SetProperties", callback, state); asyncIteratorContext.Begin(this.SetPropertiesImpl(propertyNames, condition, asyncIteratorContext)); return(asyncIteratorContext); }
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; } }
private IEnumerator <IAsyncResult> ReleaseLeaseImpl(Guid leaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncIteratorContext <NoResults> context) { IAsyncResult asyncResult; try { asyncResult = this.InternalContainer.BeginReleaseLease(leaseId, Helpers.Convert(condition), updateLastModificationTime, useContainerNotFoundError, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.ReleaseLeaseImpl")); } catch (Exception exception) { StorageStamp.TranslateException(exception); throw; } yield return(asyncResult); try { this.InternalContainer.EndReleaseLease(asyncResult); } catch (Exception exception1) { StorageStamp.TranslateException(exception1); throw; } }
public IAsyncResult BeginChangeLease(Guid leaseId, Guid proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("BaseBlobContainer.ChangeLease", callback, state); asyncIteratorContext.Begin(this.ChangeLeaseImpl(leaseId, proposedLeaseId, condition, updateLastModificationTime, useContainerNotFoundError, asyncIteratorContext)); return(asyncIteratorContext); }
public IAsyncResult BeginDeleteContainer(IContainerCondition conditions, Guid?leaseId, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("BaseBlobContainer.DeleteContainer", callback, state); asyncIteratorContext.Begin(this.DeleteContainerImpl(conditions, leaseId, asyncIteratorContext)); return(asyncIteratorContext); }
public static ContainerCondition Convert(IContainerCondition condition) { if (condition == null) { return(null); } return(new ContainerCondition(condition.IncludeDisabledContainers, condition.IncludeExpiredContainers, condition.IncludeSnapshots, StorageStampHelpers.AdjustNullableDatetimeRange(condition.IfModifiedSinceTime), StorageStampHelpers.AdjustNullableDatetimeRange(condition.IfNotModifiedSinceTime), condition.SnapshotTimestamp, condition.IsRequiringNoSnapshots, condition.IsDeletingOnlySnapshots, condition.LeaseId)); }
private IEnumerator <IAsyncResult> BreakLeaseImpl(TimeSpan?leaseBreakPeriod, IContainerCondition condition, bool updateLastModificationTime, AsyncIteratorContext <NoResults> context) { // // Current member / type: System.Collections.Generic.IEnumerator`1<System.IAsyncResult> Microsoft.WindowsAzure.DevelopmentStorage.Store.DbBlobContainer::BreakLeaseImpl(System.Nullable`1<System.TimeSpan>,Microsoft.Cis.Services.Nephos.Common.Storage.IContainerCondition,System.Boolean,AsyncHelper.AsyncIteratorContext`1<AsyncHelper.NoResults>) // File path: C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\Microsoft.Azure.DevelopmentStorage.Store.dll // // Product version: 2017.3.1005.3 // Exception in: System.Collections.Generic.IEnumerator<System.IAsyncResult> BreakLeaseImpl(System.Nullable<System.TimeSpan>,Microsoft.Cis.Services.Nephos.Common.Storage.IContainerCondition,System.Boolean,AsyncHelper.AsyncIteratorContext<AsyncHelper.NoResults>) // // The given key was not present in the dictionary. // at System.Collections.Generic.Dictionary`2.get_Item(TKey key) // at ..() in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 61 // at ..() in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 35 // at ..(DecompilationContext , ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 26 // at ..(MethodBody , , ILanguage ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 88 // at ..(MethodBody , ILanguage ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 70 // at Telerik.JustDecompiler.Decompiler.Extensions.( , ILanguage , MethodBody , DecompilationContext& ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 95 // at Telerik.JustDecompiler.Decompiler.Extensions.(MethodBody , ILanguage , DecompilationContext& , ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 58 // at ..(ILanguage , MethodDefinition , ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 117 // // mailto: [email protected] }
private IEnumerator <IAsyncResult> ChangeLeaseImpl(Guid leaseId, Guid proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, AsyncIteratorContext <NoResults> context) { IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => { using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer nullable = this.LoadBlobContainer(dbContext); DbBlobContainer.CheckBlobContainerConditionWithoutLeaseCondition(nullable, condition); DateTime utcNow = DateTime.UtcNow; ContainerLeaseInfo containerLeaseInfo = new ContainerLeaseInfo(nullable, utcNow); switch (containerLeaseInfo.State.Value) { case LeaseState.Available: { throw new LeaseNotPresentException(); } case LeaseState.Leased: { if (!(leaseId != containerLeaseInfo.Id.Value) || !(proposedLeaseId != containerLeaseInfo.Id.Value)) { break; } throw new LeaseHeldException(); } case LeaseState.Expired: { throw new LeaseHeldException(); } case LeaseState.Breaking: { if (!containerLeaseInfo.Id.HasValue || !(leaseId != containerLeaseInfo.Id.Value) || !(proposedLeaseId != containerLeaseInfo.Id.Value)) { throw new LeaseBrokenException(); } throw new LeaseHeldException(); } case LeaseState.Broken: { throw new LeaseNotPresentException(); } } nullable.LeaseId = new Guid?(proposedLeaseId); nullable.IsLeaseOp = !updateLastModificationTime; dbContext.SubmitChanges(); containerLeaseInfo.SetBlobContainer(nullable, utcNow); this._container = nullable; this.LeaseInfo = containerLeaseInfo; } }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbBlobContainer.ChangeLease")); yield return(asyncResult); this.StorageManager.AsyncProcessor.EndExecute(asyncResult); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IStorageAccount.BeginDeleteQueueContainer(string queueName, IContainerCondition conditions, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("StorageAccount.DeleteQueueContainer", callback, state); asyncIteratorContext.Begin(this.DeleteQueueContainerImpl(queueName, conditions, asyncIteratorContext)); return(asyncIteratorContext); }
private IEnumerator <IAsyncResult> GetPropertiesImpl(ContainerPropertyNames propertyNames, IContainerCondition condition, AsyncIteratorContext <NoResults> context) { IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => { using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer = this.LoadBlobContainer(dbContext); ContainerLeaseInfo containerLeaseInfo = new ContainerLeaseInfo(blobContainer, DateTime.UtcNow); DbBlobContainer.CheckBlobContainerCondition(blobContainer, condition, containerLeaseInfo); this._container = blobContainer; this.LeaseInfo = containerLeaseInfo; } }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbBlobContainer.GetProperties")); yield return(asyncResult); this.StorageManager.AsyncProcessor.EndExecute(asyncResult); }
internal static void CheckBlobContainerConditionWithoutLeaseCondition(Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer, IContainerCondition condition) { DbBlobContainer.CheckBlobContainerCondition(blobContainer, condition, null, false, null); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IStorageAccount.BeginListTableContainers(string containerName, ContainerPropertyNames propertyNames, string separator, string containerNameStart, IContainerCondition condition, int maxContainerNames, AsyncCallback callback, object state) { throw new NotSupportedException(); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IStorageAccount.BeginListQueueContainers(string containerName, ContainerPropertyNames propertyNames, string separator, string containerNameStart, IContainerCondition condition, int maxContainerNames, AsyncCallback callback, object state) { AsyncIteratorContext <IQueueContainerCollection> asyncIteratorContext = new AsyncIteratorContext <IQueueContainerCollection>("StorageAccount.ListQueueContainers", callback, state); asyncIteratorContext.Begin(this.ListQueueContainersImpl(containerName, propertyNames, separator, containerNameStart, condition, maxContainerNames, asyncIteratorContext)); return(asyncIteratorContext); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IStorageAccount.BeginDeleteTableContainer(string tableName, IContainerCondition conditions, AsyncCallback callback, object state) { throw new NotImplementedException(); }
internal static void CheckBlobContainerCondition(Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer, IContainerCondition condition, ContainerLeaseInfo leaseInfo) { DbBlobContainer.CheckBlobContainerCondition(blobContainer, condition, null, true, leaseInfo); }
public IAsyncResult BeginAcquireLease(LeaseType leaseType, TimeSpan leaseDuration, Guid?proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("BaseBlobContainer.AcquireLease", callback, state); asyncIteratorContext.Begin(this.AcquireLeaseImpl(leaseType, leaseDuration, proposedLeaseId, condition, updateLastModificationTime, useContainerNotFoundError, asyncIteratorContext)); return(asyncIteratorContext); }
internal static void CheckBlobContainerCondition(Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer, IContainerCondition condition, bool?isForSource, bool shouldCheckLease, ContainerLeaseInfo leaseInfo) { if (condition != null && condition.IfModifiedSinceTime.HasValue && condition.IfModifiedSinceTime.Value >= blobContainer.LastModificationTime) { throw new ConditionNotMetException(null, isForSource, null); } if (condition != null && condition.IfNotModifiedSinceTime.HasValue && condition.IfNotModifiedSinceTime.Value < blobContainer.LastModificationTime) { throw new ConditionNotMetException(null, isForSource, null); } if (shouldCheckLease && condition != null && condition.LeaseId.HasValue && leaseInfo != null) { LeaseState?state = leaseInfo.State; LeaseState valueOrDefault = state.GetValueOrDefault(); if (state.HasValue) { switch (valueOrDefault) { case LeaseState.Available: case LeaseState.Broken: { if (!leaseInfo.Id.HasValue) { throw new LeaseNotPresentException(); } throw new LeaseLostException(); } case LeaseState.Expired: { throw new LeaseLostException(); } } } if (leaseInfo.Id.Value != condition.LeaseId.Value) { throw new LeaseHeldException(); } } }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IBaseBlobContainer.BeginRenewLease(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbBlobContainer.RenewLease", callback, state); asyncIteratorContext.Begin(this.RenewLeaseImpl(leaseType, leaseId, leaseDuration, condition, updateLastModificationTime, asyncIteratorContext)); return(asyncIteratorContext); }
private IEnumerator <IAsyncResult> DeleteContainerImpl(IContainerCondition conditions, Guid?leaseId, AsyncIteratorContext <NoResults> context) { object obj; IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug; object[] timeout = new object[2]; object[] objArray = timeout; obj = (leaseId.HasValue ? leaseId.Value.ToString() : "NULL"); objArray[0] = obj; timeout[1] = this.Timeout; verboseDebug.Log("DeleteContainerImpl({0},{1})", timeout); IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => { using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer = this.LoadBlobContainer(dbContext); ContainerLeaseInfo containerLeaseInfo = new ContainerLeaseInfo(blobContainer, DateTime.UtcNow); DbBlobContainer.CheckBlobContainerCondition(blobContainer, conditions, containerLeaseInfo); LeaseState?state = containerLeaseInfo.State; LeaseState valueOrDefault = state.GetValueOrDefault(); if (state.HasValue) { switch (valueOrDefault) { case LeaseState.Available: case LeaseState.Broken: { if (!leaseId.HasValue) { break; } if (!containerLeaseInfo.Id.HasValue) { throw new LeaseNotPresentException(); } throw new LeaseLostException(); } case LeaseState.Leased: case LeaseState.Breaking: { if (leaseId.HasValue && !(leaseId.Value != containerLeaseInfo.Id.Value)) { break; } throw new LeaseHeldException(); } case LeaseState.Expired: { if (!leaseId.HasValue) { break; } throw new LeaseLostException(); } } } dbContext.BlobContainers.DeleteOnSubmit(blobContainer); dbContext.SubmitChanges(); } }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbBlobContainer.DeleteContainerImpl")); yield return(asyncResult); this.StorageManager.AsyncProcessor.EndExecute(asyncResult); }
private IEnumerator <IAsyncResult> ListQueueContainersImpl(string containerNamePrefix, ContainerPropertyNames propertyNames, string separator, string containerNameStart, IContainerCondition condition, int maxQueueNames, AsyncIteratorContext <IQueueContainerCollection> context) { IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug; object[] objArray = new object[] { containerNamePrefix, propertyNames, separator, containerNameStart, condition, maxQueueNames, this.Timeout }; verboseDebug.Log("ListQueueContainersImpl({0},{1},{2},{3},{4},{5},{6})", objArray); IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <DbQueueContainerCollection>((TimeSpan param0) => { DbQueueContainerCollection dbQueueContainerCollections; StorageStampHelpers.ValidateMaxContainers(maxQueueNames); using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer> queueContainers = this.MakeListQueueContainersQuery(containerNamePrefix, separator, containerNameStart, condition, maxQueueNames, dbContext); dbQueueContainerCollections = this.ReadListQueueContainersResult(containerNamePrefix, separator, maxQueueNames, queueContainers); } return(dbQueueContainerCollections); }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageStamp.ListQueueContainersImpl")); yield return(asyncResult); context.ResultData = this.StorageManager.AsyncProcessor.EndExecute <DbQueueContainerCollection>(asyncResult); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IBaseBlobContainer.BeginDeleteContainer(IContainerCondition conditions, Guid?leaseId, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbBlobContainer.DeleteContainer", callback, state); asyncIteratorContext.Begin(this.DeleteContainerImpl(conditions, leaseId, asyncIteratorContext)); return(asyncIteratorContext); }
private IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer> MakeListQueueContainersQuery(string containerNamePrefix, string separator, string containerNameStart, IContainerCondition condition, int maxQueueNames, DevelopmentStorageDbDataContext dataContext) { IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer> queueContainers = from c in dataContext.QueueContainers where c.AccountName == this._account.Name select c; if (!string.IsNullOrEmpty(separator)) { queueContainers = from c in dataContext.GetSummaryQueueContainers(this._account.Name, containerNamePrefix, separator) select c; } else if (!string.IsNullOrEmpty(containerNamePrefix)) { queueContainers = from c in queueContainers where c.QueueName.StartsWith(DbStorageAccount.FixTildeInPrefix(containerNamePrefix)) select c; } if (!string.IsNullOrEmpty(containerNameStart)) { queueContainers = from c in queueContainers where c.QueueName.CompareTo(containerNameStart) >= 0 select c; } if (condition != null) { if (condition.IfModifiedSinceTime.HasValue) { queueContainers = from c in queueContainers where c.LastModificationTime > condition.IfModifiedSinceTime.Value select c; } if (condition.IfNotModifiedSinceTime.HasValue) { queueContainers = from c in queueContainers where c.LastModificationTime <= condition.IfNotModifiedSinceTime.Value select c; } } if (maxQueueNames != 0) { queueContainers = queueContainers.Take <Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer>(maxQueueNames + 1); } return(queueContainers); }
IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IContainer.BeginGetProperties(ContainerPropertyNames propertyNames, IContainerCondition condition, CacheRefreshOptions cacheRefreshOptions, bool shouldUpdateCacheEntryOnRefresh, AsyncCallback callback, object state) { AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbBlobContainer.GetProperties", callback, state); asyncIteratorContext.Begin(this.GetPropertiesImpl(propertyNames, condition, asyncIteratorContext)); return(asyncIteratorContext); }
private IEnumerator <IAsyncResult> ListBlobContainersImpl(string containerNamePrefix, ContainerPropertyNames propertyNames, string separator, string containerKeyStart, IContainerCondition condition, int maxContainerNames, AsyncIteratorContext <IBlobContainerCollection> context) { IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug; object[] objArray = new object[] { containerNamePrefix, propertyNames, separator, containerKeyStart, condition, maxContainerNames, this.Timeout }; verboseDebug.Log("ListBlobContainersImpl({0},{1},{2},{3},{4},{5},{6})", objArray); string str = null; if (containerKeyStart != null) { string[] strArrays = containerKeyStart.Split(new char[] { '/' }); if ((int)strArrays.Length != 3) { throw new ArgumentOutOfRangeException("containerKeyStart", "The marker is not well formed."); } string str1 = strArrays[1]; str = strArrays[2]; if (str1 != this.Name) { throw new ArgumentException(string.Format("Account name '{0}' specified in the container key start does not match the account being listed '{1}'", str1, this.Name), "containerKeyStart"); } } IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <DbBlobContainerCollection>((TimeSpan param0) => { DbBlobContainerCollection dbBlobContainerCollections; StorageStampHelpers.ValidateMaxContainers(maxContainerNames); using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { IQueryable <Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer> blobContainers = this.MakeListBlobContainersQuery(containerNamePrefix, separator, str, condition, maxContainerNames, dbContext); dbBlobContainerCollections = this.ReadListBlobContainersResult(containerNamePrefix, separator, maxContainerNames, blobContainers); } return(dbBlobContainerCollections); }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageStamp.ListBlobContainersImpl")); yield return(asyncResult); context.ResultData = this.StorageManager.AsyncProcessor.EndExecute <DbBlobContainerCollection>(asyncResult); }
private IEnumerator <IAsyncResult> SetPropertiesImpl(ContainerPropertyNames propertyNames, IContainerCondition condition, AsyncIteratorContext <NoResults> context) { IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer>((TimeSpan param0) => { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer blobContainer; using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer serviceMetadata = this.LoadBlobContainer(dbContext); ContainerLeaseInfo containerLeaseInfo = new ContainerLeaseInfo(serviceMetadata, DateTime.UtcNow); DbBlobContainer.CheckBlobContainerCondition(serviceMetadata, condition, containerLeaseInfo); if ((propertyNames & ContainerPropertyNames.ServiceMetadata) != ContainerPropertyNames.None) { serviceMetadata.ServiceMetadata = ((IContainer)this).ServiceMetadata; } if ((propertyNames & ContainerPropertyNames.ApplicationMetadata) != ContainerPropertyNames.None) { serviceMetadata.Metadata = this.ApplicationMetadata; } dbContext.SubmitChanges(); this.LeaseInfo = containerLeaseInfo; blobContainer = serviceMetadata; } return(blobContainer); }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbBlobContainer.SetProperties")); yield return(asyncResult); this._container = this.StorageManager.AsyncProcessor.EndExecute <Microsoft.WindowsAzure.DevelopmentStorage.Store.BlobContainer>(asyncResult); }
public static IAsyncResult BeginListContainers(this IStorageAccount account, ServiceType serviceType, string containerName, ContainerPropertyNames propertyNames, string separator, string containerNameStart, IContainerCondition condition, int maxContainerNames, AsyncCallback callback, object state) { if (serviceType == ServiceType.BlobService) { return(account.BeginListBlobContainers(containerName, propertyNames, separator, containerNameStart, condition, maxContainerNames, callback, state)); } NephosAssertionException.Fail("Invalid service type {0}.", new object[] { serviceType }); return(null); }