Ejemplo n.º 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)
            });
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)
            };
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }