Esempio n. 1
0
        private IEnumerator <IAsyncResult> DeleteQueueContainerImpl(string containerName, IContainerCondition conditions, AsyncIteratorContext <NoResults> context)
        {
            IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { containerName, this.Timeout };
            verboseDebug.Log("DeleteQueueContainerImpl({0},{1})", objArray);
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => {
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer queueContainer = new Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer()
                    {
                        AccountName = this._account.Name,
                        QueueName   = containerName
                    };
                    queueContainer = DbQueueContainer.LoadQueueContainer(dbContext, queueContainer);
                    DbQueueContainer.CheckQueueContainerCondition(queueContainer, conditions);
                    dbContext.QueueContainers.DeleteOnSubmit(queueContainer);
                    dbContext.SubmitChanges();
                }
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageAccount.DeleteBlobContainerImpl"));

            yield return(asyncResult);

            this.StorageManager.AsyncProcessor.EndExecute(asyncResult);
        }
Esempio n. 2
0
        private IEnumerator <IAsyncResult> CreateQueueContainerImpl(string containerName, DateTime?expiryTime, byte[] serviceMetadata, byte[] applicationMetadata, AsyncIteratorContext <IQueueContainer> context)
        {
            IStringDataEventStream verboseDebug = Logger <INormalAndDebugLogger> .Instance.VerboseDebug;

            object[] objArray = new object[] { containerName, expiryTime, serviceMetadata, applicationMetadata, this.Timeout };
            verboseDebug.Log("CreateQueueContainerImpl({0},{1},{2},{3},{4})", objArray);
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute <DbQueueContainer>((TimeSpan param0) => {
                Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer queueContainer = new Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer()
                {
                    AccountName     = this._account.Name,
                    QueueName       = containerName,
                    ServiceMetadata = serviceMetadata,
                    Metadata        = applicationMetadata
                };
                DbQueueContainer dbQueueContainer = new DbQueueContainer(this, queueContainer);
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    dbContext.QueueContainers.InsertOnSubmit(queueContainer);
                    dbContext.SubmitChanges();
                }
                return(dbQueueContainer);
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageAccount.CreateQueueContainer"));

            yield return(asyncResult);

            context.ResultData = this.StorageManager.AsyncProcessor.EndExecute <DbQueueContainer>(asyncResult);
        }
Esempio n. 3
0
        private IEnumerator <IAsyncResult> GetPropertiesImpl(ContainerPropertyNames propertyNames, IContainerCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan remaining) => {
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer queueContainer = this.LoadQueueContainer(dbContext);
                    DbQueueContainer.CheckQueueContainerCondition(queueContainer, condition);
                    this._queue = queueContainer;
                }
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbQueueContainer.GetPropertiesImpl"));

            yield return(asyncResult);

            this.StorageManager.AsyncProcessor.EndExecute(asyncResult);
        }
Esempio n. 4
0
 private Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer LoadQueueContainer(DevelopmentStorageDbDataContext context)
 {
     return(DbQueueContainer.LoadQueueContainer(context, this._queue));
 }