Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CosmosQueryFactory"/> class.
        /// </summary>
        /// <param name="cosmosResponseProcessor">The cosmos response processor</param>
        /// <param name="logger">The logger.</param>
        public CosmosQueryFactory(ICosmosResponseProcessor cosmosResponseProcessor, ICosmosQueryLogger logger)
        {
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(cosmosResponseProcessor, nameof(cosmosResponseProcessor));

            _cosmosResponseProcessor = cosmosResponseProcessor;
            _logger = logger;
        }
Beispiel #2
0
        public FhirDocumentClient(IDocumentClient inner, IFhirRequestContextAccessor fhirRequestContextAccessor, int?continuationTokenSizeLimitInKb, ICosmosResponseProcessor cosmosResponseProcessor)
            : this(inner)
        {
            EnsureArg.IsNotNull(fhirRequestContextAccessor, nameof(fhirRequestContextAccessor));
            EnsureArg.IsNotNull(cosmosResponseProcessor, nameof(cosmosResponseProcessor));

            _fhirRequestContextAccessor     = fhirRequestContextAccessor;
            _continuationTokenSizeLimitInKb = continuationTokenSizeLimitInKb;
            _cosmosResponseProcessor        = cosmosResponseProcessor;
        }
        public FhirDocumentClientTests()
        {
            _innerClient = Substitute.For <IDocumentClient>();
            _fhirRequestContextAccessor = Substitute.For <IFhirRequestContextAccessor>();
            _fhirRequestContextAccessor.FhirRequestContext.RequestHeaders.Returns(_requestHeaders);
            _fhirRequestContextAccessor.FhirRequestContext.ResponseHeaders.Returns(_responseHeaders);

            _cosmosResponseProcessor = Substitute.For <ICosmosResponseProcessor>();

            _fhirClient = new FhirDocumentClient(_innerClient, _fhirRequestContextAccessor, null, _cosmosResponseProcessor);
        }
 public FhirCosmosResponseHandler(
     Func <IScoped <Container> > client,
     CosmosDataStoreConfiguration cosmosDataStoreConfiguration,
     IFhirRequestContextAccessor fhirRequestContextAccessor,
     ICosmosResponseProcessor cosmosResponseProcessor)
 {
     _client = client;
     _cosmosDataStoreConfiguration = cosmosDataStoreConfiguration;
     _fhirRequestContextAccessor   = fhirRequestContextAccessor;
     _cosmosResponseProcessor      = cosmosResponseProcessor;
 }
Beispiel #5
0
        public FhirDocumentClientInitializer(IDocumentClientTestProvider testProvider, IFhirRequestContextAccessor fhirRequestContextAccessor, ICosmosResponseProcessor cosmosResponseProcessor, ILogger <FhirDocumentClientInitializer> logger)
        {
            EnsureArg.IsNotNull(testProvider, nameof(testProvider));
            EnsureArg.IsNotNull(fhirRequestContextAccessor, nameof(fhirRequestContextAccessor));
            EnsureArg.IsNotNull(cosmosResponseProcessor, nameof(cosmosResponseProcessor));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _testProvider = testProvider;
            _fhirRequestContextAccessor = fhirRequestContextAccessor;
            _cosmosResponseProcessor    = cosmosResponseProcessor;
            _logger = logger;
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CosmosQuery{T}"/> class.
        /// </summary>
        /// <param name="queryContext">The query context.</param>
        /// <param name="feedIterator">The feed iterator to enumerate.</param>
        /// <param name="processor">Response processor</param>
        /// <param name="logger">The logger.</param>
        public CosmosQuery(
            ICosmosQueryContext queryContext,
            FeedIterator <T> feedIterator,
            ICosmosResponseProcessor processor,
            ICosmosQueryLogger logger)
        {
            EnsureArg.IsNotNull(queryContext, nameof(queryContext));
            EnsureArg.IsNotNull(feedIterator, nameof(feedIterator));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _queryContext = queryContext;
            _feedIterator = feedIterator;
            _processor    = processor;
            _logger       = logger;

            _continuationToken = _queryContext.ContinuationToken;
        }
Beispiel #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FhirDocumentQuery{T}"/> class.
        /// </summary>
        /// <param name="queryContext">The query context.</param>
        /// <param name="documentQuery">The document query to execute.</param>
        /// <param name="cosmosResponseProcessor">The cosmos response processor.</param>
        /// <param name="logger">The logger.</param>
        public FhirDocumentQuery(
            ICosmosQueryContext queryContext,
            IDocumentQuery <T> documentQuery,
            ICosmosResponseProcessor cosmosResponseProcessor,
            IFhirDocumentQueryLogger logger)
        {
            EnsureArg.IsNotNull(queryContext, nameof(queryContext));
            EnsureArg.IsNotNull(documentQuery, nameof(documentQuery));
            EnsureArg.IsNotNull(cosmosResponseProcessor, nameof(cosmosResponseProcessor));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _queryContext            = queryContext;
            _documentQuery           = documentQuery;
            _cosmosResponseProcessor = cosmosResponseProcessor;
            _logger = logger;

            _continuationToken = _queryContext.FeedOptions?.RequestContinuation;
        }