本文整理汇总了C#中QueueListingDetails类的典型用法代码示例。如果您正苦于以下问题:C# QueueListingDetails类的具体用法?C# QueueListingDetails怎么用?C# QueueListingDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueueListingDetails类属于命名空间,在下文中一共展示了QueueListingDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListQueues
/// <summary>
/// Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="queueListingDetails">An enumeration value that indicates which details to include in the listing.</param>
/// <param name="options">An object that specifies any additional options for the request.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.</param>
/// <returns>An enumerable collection of objects that implement <see cref="CloudQueue"/> and are retrieved lazily.</returns>
public IEnumerable<CloudQueue> ListQueues(string prefix, QueueListingDetails queueListingDetails = QueueListingDetails.None, QueueRequestOptions options = null, OperationContext operationContext = null)
{
QueueRequestOptions modifiedOptions = QueueRequestOptions.ApplyDefaults(options, this);
operationContext = operationContext ?? new OperationContext();
return General.LazyEnumerable((token) => this.ListQueuesSegmentedCore(prefix, queueListingDetails, 0, token as QueueContinuationToken, modifiedOptions, operationContext), long.MaxValue, operationContext);
}
示例2: ListQueues
/// <summary>
/// List storage queues
/// </summary>
/// <param name="prefix">Queue name prefix</param>
/// <param name="queueListingDetails">Queue listing details</param>
/// <param name="options">Queue request options</param>
/// <param name="operationContext">Operation context</param>
/// <returns>An enumerable collection of the queues in the storage account.</returns>
public IEnumerable<CloudQueue> ListQueues(string prefix, QueueListingDetails queueListingDetails, QueueRequestOptions options, OperationContext operationContext)
{
if(string.IsNullOrEmpty(prefix))
{
return queueList;
}
else
{
List<CloudQueue> prefixQueues = new List<CloudQueue>();
foreach(CloudQueue queue in queueList)
{
if(queue.Name.StartsWith(prefix))
{
prefixQueues.Add(queue);
}
}
return prefixQueues;
}
}
示例3: ListQueuesSegmented
/// <summary>
/// Returns a result segment containing a collection of queues in the storage account.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="queueListingDetails">A <see cref="QueueListingDetails"/> enumeration describing which items to include in the listing.</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="QueueContinuationToken"/> returned by a previous listing operation.</param>
/// <param name="options">An object that specifies additional options for the request.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.</param>
/// <returns>A result segment containing objects that implement <see cref="CloudQueue"/>.</returns>
public QueueResultSegment ListQueuesSegmented(string prefix, QueueListingDetails queueListingDetails, int? maxResults, QueueContinuationToken currentToken, QueueRequestOptions options = null, OperationContext operationContext = null)
{
QueueRequestOptions modifiedOptions = QueueRequestOptions.ApplyDefaults(options, this);
operationContext = operationContext ?? new OperationContext();
ResultSegment<CloudQueue> resultSegment = this.ListQueuesSegmentedCore(prefix, queueListingDetails, maxResults, currentToken, modifiedOptions, operationContext);
return new QueueResultSegment(resultSegment.Results, (QueueContinuationToken)resultSegment.ContinuationToken);
}
示例4: ListQueuesImpl
/// <summary>
/// Core implementation for the ListQueues method.
/// </summary>
/// <param name="prefix">The queue prefix.</param>
/// <param name="detailsIncluded">The details included.</param>
/// <param name="currentToken">The continuation token.</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>
/// <returns>A <see cref="TaskSequence"/> that lists the queues.</returns>
private RESTCommand<ResultSegment<CloudQueue>> ListQueuesImpl(string prefix, QueueListingDetails detailsIncluded, QueueContinuationToken currentToken, int? maxResults)
{
ListingContext listingContext = new ListingContext(prefix, maxResults)
{
Marker = currentToken != null ? currentToken.NextMarker : null
};
RESTCommand<ResultSegment<CloudQueue>> getCmd = new RESTCommand<ResultSegment<CloudQueue>>(this.Credentials, this.BaseUri);
getCmd.RetrieveResponseStream = true;
getCmd.Handler = this.AuthenticationHandler;
getCmd.BuildClient = HttpClientFactory.BuildHttpClient;
getCmd.BuildRequest = (cmd, cnt, ctx) => QueueHttpRequestMessageFactory.List(cmd.Uri, cmd.ServerTimeoutInSeconds, listingContext, detailsIncluded, cnt, ctx);
getCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex, ctx);
getCmd.PostProcessResponse = (cmd, resp, ex, ctx) =>
{
return Task.Factory.StartNew(() =>
{
ListQueuesResponse listQueuesResponse = new ListQueuesResponse(cmd.ResponseStream);
List<CloudQueue> queuesList = new List<CloudQueue>(
listQueuesResponse.Queues.Select(item => new CloudQueue(item.Name, this)));
QueueContinuationToken continuationToken = null;
if (listQueuesResponse.NextMarker != null)
{
continuationToken = new QueueContinuationToken()
{
NextMarker = listQueuesResponse.NextMarker,
};
}
return new ResultSegment<CloudQueue>(queuesList)
{
ContinuationToken = continuationToken,
};
});
};
return getCmd;
}
示例5: ListQueuesImpl
/// <summary>
/// Core implementation of the ListQueues method.
/// </summary>
/// <param name="prefix">The queue 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="queueListingDetails">A <see cref="QueueListingDetails"/> enumeration describing which items to include in the listing.</param>
/// <param name="options">An object that specifies additional options for the request.</param>
/// <param name="currentToken">The continuation token.</param>
/// <returns>A <see cref="RESTCommand{T}"/> that lists the queues.</returns>
private RESTCommand<ResultSegment<CloudQueue>> ListQueuesImpl(string prefix, int? maxResults, QueueListingDetails queueListingDetails, QueueRequestOptions options, QueueContinuationToken currentToken)
{
QueueListingContext listingContext = new QueueListingContext(prefix, maxResults, queueListingDetails)
{
Marker = currentToken != null ? currentToken.NextMarker : null
};
RESTCommand<ResultSegment<CloudQueue>> getCmd = new RESTCommand<ResultSegment<CloudQueue>>(this.Credentials, this.BaseUri);
getCmd.ApplyRequestOptions(options);
getCmd.RetrieveResponseStream = true;
getCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => QueueHttpWebRequestFactory.List(uri, serverTimeout, listingContext, queueListingDetails, ctx);
getCmd.SignRequest = this.AuthenticationHandler.SignRequest;
getCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex);
getCmd.PostProcessResponse = (cmd, resp, ctx) =>
{
ListQueuesResponse listQueuesResponse = new ListQueuesResponse(cmd.ResponseStream);
List<CloudQueue> queuesList = new List<CloudQueue>(
listQueuesResponse.Queues.Select(item => new CloudQueue(item.Name, this)));
QueueContinuationToken continuationToken = null;
if (listQueuesResponse.NextMarker != null)
{
continuationToken = new QueueContinuationToken()
{
NextMarker = listQueuesResponse.NextMarker,
};
}
return new ResultSegment<CloudQueue>(queuesList)
{
ContinuationToken = continuationToken,
};
};
return getCmd;
}
示例6: List
/// <summary>
/// Constructs a web request to return a listing of all queues in this storage account.
/// </summary>
/// <param name="uri">A <see cref="System.Uri"/> specifying the Queue service endpoint.</param>
/// <param name="timeout">An integer specifying the server timeout interval.</param>
/// <param name="listingContext">A <see cref="ListingContext"/> object.</param>
/// <param name="detailsIncluded">A <see cref="QueueListingDetails"/> enumeration value that indicates whether to return queue metadata with the listing.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation.</param>
/// <returns>A <see cref="System.Net.HttpWebRequest"/> object.</returns>
public static HttpWebRequest List(Uri uri, int? timeout, ListingContext listingContext, QueueListingDetails detailsIncluded, OperationContext operationContext)
{
return QueueHttpWebRequestFactory.List(uri, timeout, listingContext, detailsIncluded, true /* useVersionHeader */, operationContext);
}
示例7: ListQueuesSegmented
/// <summary>
/// Returns a result segment containing a collection of queues
/// whose names begin with the specified prefix.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="detailsIncluded">One of the enumeration values that indicates which details to include in the listing.</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 zero, the maximum possible number of results will be returned, up to 5000.</param>
/// <param name="continuationToken">A continuation token returned by a previous listing operation.</param>
/// <returns>A result segment containing a collection of queues.</returns>
public ResultSegment<CloudQueue> ListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken)
{
return TaskImplHelper.ExecuteImplWithRetry<ResultSegment<CloudQueue>>(
(setResult) => this.ListQueuesImpl(prefix, detailsIncluded, continuationToken, maxResults, setResult),
this.RetryPolicy);
}
示例8: ListQueuesSegmentedAsync
public Task<QueueResultSegment> ListQueuesSegmentedAsync(string prefix, QueueListingDetails queueListingDetails, int? maxResults, QueueContinuationToken currentToken, QueueRequestOptions options, OperationContext operationContext)
{
return this.ListQueuesSegmentedAsync(prefix, queueListingDetails, maxResults, currentToken, options, operationContext, CancellationToken.None);
}
示例9: ListQueues
/// <summary>
/// Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="detailsIncluded">One of the enumeration values that indicates which details to include in the listing.</param>
/// <returns>An enumerable collection of queues that are retrieved lazily.</returns>
public IEnumerable<CloudQueue> ListQueues(string prefix, QueueListingDetails detailsIncluded)
{
return CommonUtils.LazyEnumerateSegmented<CloudQueue>(
(setResult) => this.ListQueuesImpl(prefix, detailsIncluded, null, null, setResult),
this.RetryPolicy);
}
示例10: BeginListQueuesSegmented
/// <summary>
/// Begins an asynchronous operation to return a result segment containing a collection of queues
/// whose names begin with the specified prefix.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="detailsIncluded">One of the enumeration values that indicates which details to include in the listing.</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 zero, the maximum possible number of results will be returned, up to 5000.</param>
/// <param name="continuationToken">A continuation token returned by a previous listing operation.</param>
/// <param name="callback">The callback delegate that will receive notification when the asynchronous operation completes.</param>
/// <param name="state">A user-defined object that will be passed to the callback delegate.</param>
/// <returns>An <see cref="IAsyncResult"/> that references the asynchronous operation.</returns>
public IAsyncResult BeginListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state)
{
return TaskImplHelper.BeginImplWithRetry<ResultSegment<CloudQueue>>(
(setResult) => this.ListQueuesImpl(prefix, detailsIncluded, continuationToken, maxResults, setResult),
this.RetryPolicy,
callback,
state);
}
示例11: ListQueuesImpl
/// <summary>
/// Core implementation for the ListQueues method.
/// </summary>
/// <param name="prefix">The queue prefix.</param>
/// <param name="detailsIncluded">The details included.</param>
/// <param name="currentToken">The continuation token.</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>
/// <returns>A <see cref="TaskSequence"/> that lists the queues.</returns>
private RESTCommand<ResultSegment<CloudQueue>> ListQueuesImpl(string prefix, int? maxResults, QueueListingDetails detailsIncluded, QueueRequestOptions options, QueueContinuationToken currentToken)
{
ListingContext listingContext = new ListingContext(prefix, maxResults)
{
Marker = currentToken != null ? currentToken.NextMarker : null
};
RESTCommand<ResultSegment<CloudQueue>> getCmd = new RESTCommand<ResultSegment<CloudQueue>>(this.Credentials, this.StorageUri);
options.ApplyToStorageCommand(getCmd);
getCmd.CommandLocationMode = CommonUtility.GetListingLocationMode(currentToken);
getCmd.RetrieveResponseStream = true;
getCmd.BuildRequest = (cmd, uri, builder, cnt, serverTimeout, ctx) => QueueHttpRequestMessageFactory.List(uri, serverTimeout, listingContext, detailsIncluded, cnt, ctx, this.GetCanonicalizer(), this.Credentials);
getCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex);
getCmd.PostProcessResponse = (cmd, resp, ctx) =>
{
return Task.Factory.StartNew(() =>
{
ListQueuesResponse listQueuesResponse = new ListQueuesResponse(cmd.ResponseStream);
List<CloudQueue> queuesList = listQueuesResponse.Queues.Select(item => new CloudQueue(item.Metadata, item.Name, this)).ToList();
QueueContinuationToken continuationToken = null;
if (listQueuesResponse.NextMarker != null)
{
continuationToken = new QueueContinuationToken()
{
NextMarker = listQueuesResponse.NextMarker,
TargetLocation = cmd.CurrentResult.TargetLocation,
};
}
return new ResultSegment<CloudQueue>(queuesList)
{
ContinuationToken = continuationToken,
};
});
};
return getCmd;
}
示例12: ListQueuesSegmentedCore
/// <summary>
/// Returns a result segment containing a collection of queues in the storage account.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="queueListingDetails">A <see cref="QueueListingDetails"/> enumeration describing which items to include in the listing.</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="QueueContinuationToken"/> returned by a previous listing operation.</param>
/// <param name="options">An object that specifies additional options for the request.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.</param>
/// <returns>A result segment.</returns>
private ResultSegment<CloudQueue> ListQueuesSegmentedCore(string prefix, QueueListingDetails queueListingDetails, int? maxResults, QueueContinuationToken currentToken, QueueRequestOptions options, OperationContext operationContext)
{
return Executor.ExecuteSync(
this.ListQueuesImpl(prefix, maxResults, queueListingDetails, options, currentToken),
options.RetryPolicy,
operationContext);
}
示例13: ListQueuesImpl
/// <summary>
/// Lists the queues impl.
/// </summary>
/// <param name="prefix">The prefix.</param>
/// <param name="detailsIncluded">The details included.</param>
/// <param name="continuationToken">The continuation token.</param>
/// <param name="maxResults">The max results.</param>
/// <param name="setResult">The set result.</param>
/// <returns>A <see cref="TaskSequence"/> for listing the queues.</returns>
private TaskSequence ListQueuesImpl(
string prefix,
QueueListingDetails detailsIncluded,
ResultContinuation continuationToken,
int? maxResults,
Action<ResultSegment<CloudQueue>> setResult)
{
ResultPagination pagination = new ResultPagination(maxResults.GetValueOrDefault());
return this.ListQueuesImplCore(
prefix,
detailsIncluded,
continuationToken,
pagination,
setResult);
}
示例14: BeginListQueuesSegmented
/// <summary>
/// Begins an asynchronous operation to return a result segment containing a collection of queue items.
/// </summary>
/// <param name="prefix">The queue name prefix.</param>
/// <param name="queueListingDetails">A <see cref="QueueListingDetails"/> enumeration describing which items to include in the listing.</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="QueueContinuationToken"/> returned by a previous listing operation.</param>
/// <param name="options">An object that specifies additional options for the request.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.</param>
/// <param name="callback">The callback delegate that will receive notification when the asynchronous operation completes.</param>
/// <param name="state">A user-defined object that will be passed to the callback delegate.</param>
/// <returns>An <see cref="ICancellableAsyncResult"/> that references the asynchronous operation.</returns>
public ICancellableAsyncResult BeginListQueuesSegmented(string prefix, QueueListingDetails queueListingDetails, int? maxResults, QueueContinuationToken currentToken, QueueRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
{
QueueRequestOptions modifiedOptions = QueueRequestOptions.ApplyDefaults(options, this);
operationContext = operationContext ?? new OperationContext();
return Executor.BeginExecuteAsync(
this.ListQueuesImpl(prefix, maxResults, queueListingDetails, modifiedOptions, currentToken),
modifiedOptions.RetryPolicy,
operationContext,
callback,
state);
}
示例15: ListQueuesImplCore
/// <summary>
/// Lists the queues impl core.
/// </summary>
/// <param name="prefix">The prefix.</param>
/// <param name="detailsIncluded">The details included.</param>
/// <param name="continuationToken">The continuation token.</param>
/// <param name="pagination">The pagination.</param>
/// <param name="setResult">The set result.</param>
/// <returns>A <see cref="TaskSequence"/> for listing the queues.</returns>
private TaskSequence ListQueuesImplCore(
string prefix,
QueueListingDetails detailsIncluded,
ResultContinuation continuationToken,
ResultPagination pagination,
Action<ResultSegment<CloudQueue>> setResult)
{
CommonUtils.AssertContinuationType(continuationToken, ResultContinuation.ContinuationType.Queue);
ListingContext listingContext = new ListingContext(prefix, pagination.GetNextRequestPageSize())
{
Marker = continuationToken != null ? continuationToken.NextMarker : null
};
var queueList = new List<CloudQueue>();
var webRequest = QueueRequest.List(this.BaseUri, this.Timeout.RoundUpToSeconds(), listingContext, detailsIncluded);
this.Credentials.SignRequest(webRequest);
var listTask = webRequest.GetResponseAsyncWithTimeout(this, this.Timeout);
yield return listTask;
string nextMarker;
using (var response = listTask.Result as HttpWebResponse)
{
var parsedResponse = QueueResponse.List(response);
// Materialize the results so that we can close the response
queueList.AddRange(parsedResponse.Queues.Select((Func<QueueEntry, CloudQueue>)this.SelectResponse));
nextMarker = parsedResponse.NextMarker;
}
ResultContinuation newContinuationToken = new ResultContinuation() { NextMarker = nextMarker, Type = ResultContinuation.ContinuationType.Queue };
ResultSegment.CreateResultSegment(
setResult,
queueList,
newContinuationToken,
pagination,
this.RetryPolicy,
(paginationArg, continuationArg, resultSegment) =>
this.ListQueuesImplCore(prefix, detailsIncluded, continuationArg, paginationArg, resultSegment));
}