Beispiel #1
0
        internal FeedIterator GetDataEncryptionKeyStreamIterator(
            string startId                     = null,
            string endId                       = null,
            bool isDescending                  = false,
            string continuationToken           = null,
            QueryRequestOptions requestOptions = null)
        {
            if (startId != null || endId != null)
            {
                if (requestOptions == null)
                {
                    requestOptions = new QueryRequestOptions();
                }

                requestOptions.StartId = startId;
                requestOptions.EndId   = endId;
                requestOptions.EnumerationDirection = isDescending ? EnumerationDirection.Reverse : EnumerationDirection.Forward;
            }

            return(FeedIteratorCore.CreateForNonPartitionedResource(
                       clientContext: this.ClientContext,
                       resourceLink: this.LinkUri,
                       resourceType: ResourceType.ClientEncryptionKey,
                       queryDefinition: null,
                       continuationToken: continuationToken,
                       options: requestOptions));
        }
 internal FeedResponse <T> CreateResultSetQueryResponse <T>(
     CosmosResponseMessage cosmosResponseMessage)
 {
     return(FeedIteratorCore <T> .CreateCosmosQueryResponse(
                cosmosResponseMessage,
                this.cosmosSerializer));
 }
Beispiel #3
0
 public FeedIterator GetPermissionQueryStreamIterator(QueryDefinition queryDefinition,
                                                      string continuationToken           = null,
                                                      QueryRequestOptions requestOptions = null)
 {
     return(FeedIteratorCore.CreateForNonPartitionedResource(
                clientContext: this.ClientContext,
                this.LinkUri,
                resourceType: ResourceType.Permission,
                queryDefinition: queryDefinition,
                continuationToken: continuationToken,
                options: requestOptions));
 }
 public override FeedIterator GetConflictQueryStreamIterator(
     QueryDefinition queryDefinition,
     string continuationToken           = null,
     QueryRequestOptions requestOptions = null)
 {
     return(FeedIteratorCore.CreateForNonPartitionedResource(
                clientContext: this.clientContext,
                this.container.LinkUri,
                resourceType: ResourceType.Conflict,
                queryDefinition: queryDefinition,
                continuationToken: continuationToken,
                options: requestOptions));
 }
 private FeedIteratorInternal GetDatabaseQueryStreamIteratorHelper(
     QueryDefinition queryDefinition,
     string continuationToken           = null,
     QueryRequestOptions requestOptions = null)
 {
     return(FeedIteratorCore.CreateForNonPartitionedResource(
                clientContext: this.ClientContext,
                resourceLink: this.DatabaseRootUri,
                resourceType: ResourceType.Database,
                queryDefinition: queryDefinition,
                continuationToken: continuationToken,
                options: requestOptions));
 }
Beispiel #6
0
 internal virtual FeedIterator GetOfferQueryStreamIterator(
     QueryDefinition queryDefinition,
     string continuationToken            = null,
     QueryRequestOptions requestOptions  = null,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(FeedIteratorCore.CreateForNonPartitionedResource(
                clientContext: this.ClientContext,
                resourceLink: this.OfferRootUri,
                resourceType: ResourceType.Offer,
                queryDefinition: queryDefinition,
                continuationToken: continuationToken,
                options: requestOptions));
 }
        /// <summary>
        /// Helper method to create a stream feed iterator.
        /// It decides if it is a query or read feed and create
        /// the correct instance.
        /// </summary>
        internal FeedIteratorInternal GetItemQueryStreamIteratorInternal(
            SqlQuerySpec sqlQuerySpec,
            bool isContinuationExcpected,
            string continuationToken,
            FeedTokenInternal feedToken,
            QueryRequestOptions requestOptions)
        {
            requestOptions = requestOptions ?? new QueryRequestOptions();

            if (requestOptions.IsEffectivePartitionKeyRouting)
            {
                if (feedToken != null)
                {
                    throw new ArgumentException(nameof(feedToken), ClientResources.FeedToken_EffectivePartitionKeyRouting);
                }

                requestOptions.PartitionKey = null;
            }

            if (sqlQuerySpec == null)
            {
                return(FeedIteratorCore.CreateForPartitionedResource(
                           this,
                           this.LinkUri,
                           resourceType: ResourceType.Document,
                           queryDefinition: null,
                           continuationToken: continuationToken,
                           feedTokenInternal: feedToken,
                           options: requestOptions));
            }

            return(QueryIterator.Create(
                       client: this.queryClient,
                       clientContext: this.ClientContext,
                       sqlQuerySpec: sqlQuerySpec,
                       continuationToken: continuationToken,
                       queryRequestOptions: requestOptions,
                       resourceLink: this.LinkUri,
                       isContinuationExpected: isContinuationExcpected,
                       allowNonValueAggregateQuery: true,
                       partitionedQueryExecutionInfo: null));
        }