internal IEnumerable <CloudTable> ListTables(string prefix, TableRequestOptions requestOptions, OperationContext operationContext) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); return(this.GenerateListTablesQuery(prefix, null).Execute(this, TableConstants.TableServiceTablesName, requestOptions, operationContext).Select( tbl => new CloudTable(NavigationHelper.AppendPathToUri(this.BaseUri, tbl.Properties[TableConstants.TableName].StringValue), this))); }
public ServiceStats GetServiceStats(TableRequestOptions requestOptions = null, OperationContext operationContext = null) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); return(Executor.ExecuteSync( this.GetServiceStatsImpl(requestOptions), requestOptions.RetryPolicy, operationContext)); }
public IEnumerable <CloudTable> ListTables(string prefix = null, TableRequestOptions requestOptions = null, OperationContext operationContext = null) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); CloudTable serviceTable = this.GetTableReference(TableConstants.TableServiceTablesName); return(CloudTableClient.GenerateListTablesQuery(prefix, null).ExecuteInternal(this, serviceTable, requestOptions, operationContext).Select( tbl => new CloudTable(tbl[TableConstants.TableName].StringValue, this))); }
internal TableResult Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); return(Executor.ExecuteSync(this.GenerateCMDForOperation(client, table, modifiedOptions), modifiedOptions.RetryPolicy, operationContext)); }
internal static TableRequestOptions ApplyDefaultsAndClearEncryption(TableRequestOptions requestOptions, CloudTableClient serviceClient) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, serviceClient); #if !(WINDOWS_RT || NETCORE) modifiedOptions.ClearEncryption(); #endif return(modifiedOptions); }
internal TableResult Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); IOperationExecutor <TableResult, TableOperation> operationExecutor = GetExecutor(client); return(operationExecutor.Execute(this, client, table, modifiedOptions, operationContext)); }
internal static TableRequestOptions ApplyDefaultsAndClearEncryption(TableRequestOptions requestOptions, CloudTableClient serviceClient) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, serviceClient); #if !(WINDOWS_RT || NETCORE) modifiedOptions.RequireEncryption = false; modifiedOptions.EncryptionPolicy = null; modifiedOptions.EncryptionResolver = null; #endif return(modifiedOptions); }
public virtual Task SetServicePropertiesAsync(ServiceProperties properties, TableRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); return(Task.Run(async() => await Executor.ExecuteAsyncNullReturn( this.SetServicePropertiesImpl(properties, modifiedOptions), modifiedOptions.RetryPolicy, operationContext, cancellationToken), cancellationToken)); }
internal TableQuerySegment <TElement> ExecuteQuerySegmentedInternal(TableContinuationToken token, CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) { CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment <TElement> > cmdToExecute = QueryImpl(this, token, client, table, EntityUtilities.ResolveEntityByType <TElement>, modifiedOptions); return(Executor.ExecuteSync(cmdToExecute, modifiedOptions.RetryPolicy, operationContext)); }
internal TableQuerySegment <DynamicTableEntity> ExecuteQuerySegmented(TableContinuationToken token, CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext) { CommonUtils.AssertNotNullOrEmpty("tableName", tableName); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment <DynamicTableEntity> > cmdToExecute = QueryImpl(this, token, client, tableName, modifiedOptions); return(Executor.ExecuteSync(cmdToExecute, modifiedOptions.RetryPolicy, operationContext)); }
internal TableQuerySegment <TElement> ExecuteQuerySegmentedInternal(TableContinuationToken token, CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) { CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); IQueryExecutor <TElement, TElement> queryExecutor = GetExecutor <TElement>(client); return(queryExecutor.ExecuteQuerySegmented(this, token, client, table, modifiedOptions, operationContext)); }
public ICancellableAsyncResult BeginGetServiceStats(TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); return(Executor.BeginExecuteAsync( this.GetServiceStatsImpl(requestOptions), requestOptions.RetryPolicy, operationContext, callback, state)); }
/// <summary> /// Gets the permissions settings for the Table. /// </summary> /// <param name="requestOptions">A <see cref="TableRequestOptions"/> object that specifies execution options, such as retry policy and timeout settings, for the operation.</param> /// <param name="operationContext">An <see cref="OperationContext"/> object for tracking the current operation.</param> /// <returns>The Table's permissions.</returns> public IAsyncOperation <TablePermissions> GetPermissionsAsync(TableRequestOptions requestOptions, OperationContext operationContext) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, this.ServiceClient); operationContext = operationContext ?? new OperationContext(); return(AsyncInfo.Run(async(cancellationToken) => await Executor.ExecuteAsync( this.GetPermissionsImpl(modifiedOptions), modifiedOptions.RetryPolicy, operationContext, cancellationToken))); }
internal ICancellableAsyncResult BeginExecuteQuerySegmentedInternal(TableContinuationToken token, CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); IQueryExecutor <TElement, TElement> queryExecutor = GetExecutor <TElement>(client); return(queryExecutor.BeginExecuteQuerySegmented(this, token, client, table, modifiedOptions, operationContext, callback, state)); }
internal ICancellableAsyncResult BeginExecute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); IOperationExecutor <TableResult, TableOperation> operationExecutor = GetExecutor(client); return(operationExecutor.BeginExecute(this, client, table, modifiedOptions, operationContext, callback, state)); }
public virtual Task <ServiceStats> GetServiceStatsAsync(TableRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(options, this); operationContext = operationContext ?? new OperationContext(); return(Executor.ExecuteAsync( this.GetServiceStatsImpl(modifiedOptions), modifiedOptions.RetryPolicy, operationContext, cancellationToken)); }
public IAsyncOperation <ServiceStats> GetServiceStatsAsync(TableRequestOptions options, OperationContext operationContext) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(options, this); operationContext = operationContext ?? new OperationContext(); return(AsyncInfo.Run( async(token) => await Executor.ExecuteAsync( this.GetServiceStatsImpl(modifiedOptions), modifiedOptions.RetryPolicy, operationContext, token))); }
/// <summary> /// Deletes the Table. /// </summary> /// <param name="requestOptions">A <see cref="TableRequestOptions"/> object that specifies execution options, such as retry policy and timeout settings, for the operation.</param> /// <param name="operationContext">An <see cref="OperationContext"/> object for tracking the current operation.</param> /// <returns>An <see cref="IAsyncAction"/> that represents an asynchronous action.</returns> public IAsyncAction DeleteAsync(TableRequestOptions requestOptions, OperationContext operationContext) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this.ServiceClient); operationContext = operationContext ?? new OperationContext(); DynamicTableEntity tblEntity = new DynamicTableEntity(); tblEntity.Properties.Add(TableConstants.TableName, new EntityProperty(this.Name)); TableOperation operation = new TableOperation(tblEntity, TableOperationType.Delete); operation.IsTableEntity = true; return(this.ServiceClient.ExecuteAsync(TableConstants.TableServiceTablesName, operation, requestOptions, operationContext).AsTask().AsAsyncAction()); }
public virtual async Task <TableResultSegment> ListTablesSegmentedAsync(string prefix, int?maxResults, TableContinuationToken currentToken, TableRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); TableQuery query = this.GenerateListTablesQuery(prefix, maxResults); TableQuerySegment seg = await this.ExecuteQuerySegmentedAsync(TableConstants.TableServiceTablesName, query, currentToken, requestOptions, operationContext, cancellationToken).ConfigureAwait(false); TableResultSegment retSegment = new TableResultSegment(seg.Results.Select(tbl => new CloudTable(tbl.Properties[TableConstants.TableName].StringValue, this)).ToList()); retSegment.ContinuationToken = seg.ContinuationToken; return(retSegment); }
public ICancellableAsyncResult BeginListTablesSegmented(string prefix, int?maxResults, TableContinuationToken currentToken, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); return(CloudTableClient.GenerateListTablesQuery(prefix, maxResults).BeginExecuteQuerySegmentedInternal( currentToken, this, TableConstants.TableServiceTablesName, requestOptions, operationContext, callback, state)); }
internal IList <TableResult> Execute(CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtils.AssertNotNullOrEmpty("tableName", tableName); if (this.operations.Count == 0) { throw new ArgumentOutOfRangeException(SR.EmptyBatchOperation); } return(Executor.ExecuteSync(BatchImpl(this, client, tableName, modifiedOptions), modifiedOptions.RetryPolicy, operationContext)); }
internal Task <TableQuerySegment <TResult> > ExecuteQuerySegmentedAsync <TResult>(TableContinuationToken continuationToken, CloudTableClient client, string tableName, EntityResolver <TResult> resolver, TableRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken) { CommonUtility.AssertNotNullOrEmpty("tableName", tableName); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment <TResult> > cmdToExecute = this.QueryImpl <TResult>(continuationToken, client, tableName, resolver, modifiedOptions); return(Task.Run(async() => await Executor.ExecuteAsync( cmdToExecute, modifiedOptions.RetryPolicy, operationContext, cancellationToken), cancellationToken)); }
internal ICancellableAsyncResult BeginExecuteQuerySegmented <TResult>(TableContinuationToken token, CloudTableClient client, CloudTable table, EntityResolver <TResult> resolver, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { CommonUtility.AssertNotNullOrEmpty("tableName", table.Name); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); return(Executor.BeginExecuteAsync( QueryImpl(this, token, client, table, resolver, modifiedOptions), modifiedOptions.RetryPolicy, operationContext, callback, state)); }
internal IAsyncOperation <TableQuerySegment> ExecuteQuerySegmentedAsync(TableContinuationToken continuationToken, CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext) { CommonUtils.AssertNotNullOrEmpty("tableName", tableName); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment> cmdToExecute = QueryImpl(this, continuationToken, client, tableName, modifiedOptions); return(AsyncInfo.Run(async(cancellationToken) => await Executor.ExecuteAsync( cmdToExecute, modifiedOptions.RetryPolicy, operationContext, cancellationToken))); }
internal Task <TableQuerySegment> ExecuteQuerySegmentedAsync(TableContinuationToken continuationToken, CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext, CancellationToken cancellationToken) { CommonUtility.AssertNotNullOrEmpty("tableName", tableName); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment> cmdToExecute = QueryImpl(this, continuationToken, client, tableName, EntityUtilities.ResolveEntityByType <DynamicTableEntity>, modifiedOptions); return(Executor.ExecuteAsync( cmdToExecute, modifiedOptions.RetryPolicy, operationContext, cancellationToken)); }
internal ICancellableAsyncResult BeginExecute(CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtils.AssertNotNullOrEmpty("tableName", tableName); return(Executor.BeginExecuteAsync( this.GenerateCMDForOperation(client, tableName, modifiedOptions), modifiedOptions.RetryPolicy, operationContext, callback, state)); }
/// <summary> /// Returns a result segment containing a collection of tables beginning with the specified prefix. /// </summary> /// <param name="prefix">The table name prefix.</param> /// <param name="maxResults">A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the /// per-operation limit of 5000. If this value is <c>null</c> the maximum possible number of results will be returned, up to 5000.</param> /// <param name="currentToken">A <see cref="TableContinuationToken"/> token returned by a previous listing operation.</param> /// <param name="requestOptions">A <see cref="TableRequestOptions"/> object that specifies additional options for the request.</param> /// <param name="operationContext">An <see cref="OperationContext"/> object that provides information on how the operation executed.</param> /// <returns>The result segment containing the collection of tables.</returns> public IAsyncOperation <TableResultSegment> ListTablesSegmentedAsync(string prefix, int?maxResults, TableContinuationToken currentToken, TableRequestOptions requestOptions, OperationContext operationContext) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); TableQuery query = this.GenerateListTablesQuery(prefix, maxResults); return(AsyncInfo.Run(async(cancellationToken) => { TableQuerySegment seg = await this.ExecuteQuerySegmentedAsync(TableConstants.TableServiceTablesName, query, currentToken, requestOptions, operationContext).AsTask(cancellationToken); TableResultSegment retSegment = new TableResultSegment(seg.Results.Select(tbl => new CloudTable(tbl.Properties[TableConstants.TableName].StringValue, this)).ToList()); retSegment.ContinuationToken = seg.ContinuationToken; return retSegment; })); }
internal IAsyncOperation <TableQuerySegment <TResult> > ExecuteQuerySegmentedAsync <TResult>(TableContinuationToken token, CloudTableClient client, string tableName, EntityResolver <TResult> resolver, TableRequestOptions requestOptions, OperationContext operationContext) { CommonUtility.AssertNotNullOrEmpty("tableName", tableName); CommonUtility.AssertNotNull("resolver", resolver); TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); RESTCommand <TableQuerySegment <TResult> > cmdToExecute = QueryImpl(this, token, client, tableName, resolver, modifiedOptions); return(AsyncInfo.Run((cancellationToken) => Executor.ExecuteAsync( cmdToExecute, modifiedOptions.RetryPolicy, operationContext, cancellationToken))); }
public TableResultSegment ListTablesSegmented(string prefix, int?maxResults, TableContinuationToken currentToken, TableRequestOptions requestOptions = null, OperationContext operationContext = null) { requestOptions = TableRequestOptions.ApplyDefaults(requestOptions, this); operationContext = operationContext ?? new OperationContext(); TableQuerySegment <DynamicTableEntity> res = CloudTableClient.GenerateListTablesQuery(prefix, maxResults).ExecuteQuerySegmentedInternal(currentToken, this, TableConstants.TableServiceTablesName, requestOptions, operationContext); List <CloudTable> tables = res.Results.Select(tbl => new CloudTable( tbl.Properties[TableConstants.TableName].StringValue, this)).ToList(); TableResultSegment retSeg = new TableResultSegment(tables) { ContinuationToken = res.ContinuationToken as TableContinuationToken }; return(retSeg); }
internal ICancellableAsyncResult BeginExecute(CloudTableClient client, string tableName, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, object state) { TableRequestOptions modifiedOptions = TableRequestOptions.ApplyDefaults(requestOptions, client); operationContext = operationContext ?? new OperationContext(); CommonUtils.AssertNotNullOrEmpty("tableName", tableName); if (this.operations.Count == 0) { throw new ArgumentOutOfRangeException(SR.EmptyBatchOperation); } return(Executor.BeginExecuteAsync( BatchImpl(this, client, tableName, modifiedOptions), modifiedOptions.RetryPolicy, operationContext, callback, state)); }