Пример #1
0
        /// <summary>
        ///     Get a segmented list of orchestration states from the instance storage table which match the specified
        ///     orchestration state query.
        /// </summary>
        /// <param name="stateQuery">Orchestration state query to execute</param>
        /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
        /// <param name="count">Count of elements to return. Service will decide how many to return if set to -1.</param>
        /// <returns></returns>
        public async Task <OrchestrationStateQuerySegment> QueryOrchestrationStatesSegmentedAsync(
            OrchestrationStateQuery stateQuery, string continuationToken, int count)
        {
            ThrowIfInstanceStoreNotConfigured();

            TableContinuationToken tokenObj = null;

            if (continuationToken != null)
            {
                tokenObj = DeserializeTableContinuationToken(continuationToken);
            }

            TableQuerySegment <OrchestrationStateEntity> results =
                await
                tableClient.QueryOrchestrationStatesSegmentedAsync(stateQuery, tokenObj, count)
                .ConfigureAwait(false);

            return(new OrchestrationStateQuerySegment
            {
                Results = results.Results.Select(s => s.State),
                ContinuationToken = results.ContinuationToken == null
                    ? null
                    : SerializeTableContinuationToken(results.ContinuationToken)
            });
        }
Пример #2
0
 /// <summary>
 ///     Get a segmented list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
 /// <param name="count">Count of elements to return. Service will decide how many to return if set to -1.</param>
 /// <returns></returns>
 public OrchestrationStateQuerySegment QueryOrchestrationStatesSegmented(OrchestrationStateQuery stateQuery,
                                                                         string continuationToken, int count)
 {
     return
         (Utils.AsyncExceptionWrapper(
              () => QueryOrchestrationStatesSegmentedAsync(stateQuery, continuationToken, count).Result));
 }
Пример #3
0
        /// <summary>
        ///     Get a list of orchestration states from the instance storage table which match the specified
        ///     orchestration state query.
        /// </summary>
        /// <param name="stateQuery">Orchestration state query to execute</param>
        /// <returns></returns>
        public async Task <IEnumerable <OrchestrationState> > QueryOrchestrationStatesAsync(
            OrchestrationStateQuery stateQuery)
        {
            ThrowIfInstanceStoreNotConfigured();
            IEnumerable <OrchestrationStateEntity> result =
                await tableClient.QueryOrchestrationStatesAsync(stateQuery).ConfigureAwait(false);

            return(new List <OrchestrationState>(result.Select(stateEntity => stateEntity.State)));
        }
Пример #4
0
 /// <summary>
 ///     Get a segmented list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query. Segment size is controlled by the service.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
 /// <returns></returns>
 public Task <OrchestrationStateQuerySegment> QueryOrchestrationStatesSegmentedAsync(
     OrchestrationStateQuery stateQuery, string continuationToken)
 {
     return(QueryOrchestrationStatesSegmentedAsync(stateQuery, continuationToken, -1));
 }
Пример #5
0
 /// <summary>
 ///     Get a list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <returns></returns>
 public IEnumerable <OrchestrationState> QueryOrchestrationStates(OrchestrationStateQuery stateQuery)
 {
     return(Utils.AsyncExceptionWrapper(() => QueryOrchestrationStatesAsync(stateQuery).Result));
 }
Пример #6
0
        /// <summary>
        ///     Get a segmented list of orchestration states from the instance storage table which match the specified
        ///     orchestration state query.
        /// </summary>
        /// <param name="stateQuery">Orchestration state query to execute</param>
        /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
        /// <param name="count">Count of elements to return. Service will decide how many to return if set to -1.</param>
        /// <returns></returns>
        public async Task<OrchestrationStateQuerySegment> QueryOrchestrationStatesSegmentedAsync(
            OrchestrationStateQuery stateQuery, string continuationToken, int count)
        {
            ThrowIfInstanceStoreNotConfigured();

            TableContinuationToken tokenObj = null;

            if (continuationToken != null)
            {
                tokenObj = DeserializeTableContinuationToken(continuationToken);
            }

            TableQuerySegment<OrchestrationStateEntity> results =
                await
                    tableClient.QueryOrchestrationStatesSegmentedAsync(stateQuery, tokenObj, count)
                        .ConfigureAwait(false);

            return new OrchestrationStateQuerySegment
            {
                Results = results.Results.Select(s => s.State),
                ContinuationToken = results.ContinuationToken == null
                    ? null
                    : SerializeTableContinuationToken(results.ContinuationToken)
            };
        }
Пример #7
0
 /// <summary>
 ///     Get a segmented list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
 /// <param name="count">Count of elements to return. Service will decide how many to return if set to -1.</param>
 /// <returns></returns>
 public OrchestrationStateQuerySegment QueryOrchestrationStatesSegmented(OrchestrationStateQuery stateQuery,
     string continuationToken, int count)
 {
     return
         Utils.AsyncExceptionWrapper(
             () => QueryOrchestrationStatesSegmentedAsync(stateQuery, continuationToken, count).Result);
 }
Пример #8
0
 /// <summary>
 ///     Get a segmented list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query. Segment size is controlled by the service.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <param name="continuationToken">The token returned from the last query execution. Can be null for the first time.</param>
 /// <returns></returns>
 public Task<OrchestrationStateQuerySegment> QueryOrchestrationStatesSegmentedAsync(
     OrchestrationStateQuery stateQuery, string continuationToken)
 {
     return QueryOrchestrationStatesSegmentedAsync(stateQuery, continuationToken, -1);
 }
Пример #9
0
 /// <summary>
 ///     Get a list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <returns></returns>
 public async Task<IEnumerable<OrchestrationState>> QueryOrchestrationStatesAsync(
     OrchestrationStateQuery stateQuery)
 {
     ThrowIfInstanceStoreNotConfigured();
     IEnumerable<OrchestrationStateEntity> result =
         await tableClient.QueryOrchestrationStatesAsync(stateQuery).ConfigureAwait(false);
     return new List<OrchestrationState>(result.Select(stateEntity => stateEntity.State));
 }
Пример #10
0
 /// <summary>
 ///     Get a list of orchestration states from the instance storage table which match the specified
 ///     orchestration state query.
 /// </summary>
 /// <param name="stateQuery">Orchestration state query to execute</param>
 /// <returns></returns>
 public IEnumerable<OrchestrationState> QueryOrchestrationStates(OrchestrationStateQuery stateQuery)
 {
     return Utils.AsyncExceptionWrapper(() => QueryOrchestrationStatesAsync(stateQuery).Result);
 }