Class FHIRBucketClient


  • public class FHIRBucketClient
    extends java.lang.Object
    Handles pooled HTTP/S connections to a FHIR server. Derived from the former High Volume Ingestion Tool (HVIT) which is known to scale to a large number of client connections.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String key, java.lang.String value)
      Add the given key/value as a header
      FhirServerResponse delete​(java.lang.String url)
      Issue a DELETE for the given url
      FhirServerResponse get​(java.lang.String url)
      Issue a GET request without request-specific headers
      FhirServerResponse get​(java.lang.String url, RequestOptions requestOptions)
      Issue a GET request with request-specific headers
      java.lang.String getBaseUrl()  
      org.apache.http.pool.PoolStats getPoolInformation()
      Get statistics from the internal HTTP connection manager
      void init​(java.lang.String tenantName)
      Initialize the SSL connection pool after all the required field values have been injected
      protected org.apache.http.impl.client.CloseableHttpClient obtainCloseableHttpClient​(org.apache.http.conn.ConnectionKeepAliveStrategy connKeepAliveStrategy, ClientPropertyAdapter propertyAdapter)
      Overridden by child classes for specialized behavior.
      FhirServerResponse post​(java.lang.String url, java.lang.String body)
      Issue a POST request at the given url without any request-specific headers
      FhirServerResponse post​(java.lang.String url, RequestOptions requestOptions, java.lang.String body)
      Issue a POST request at the given url with request-specific headers
      protected void processOperationalOutcome​(FhirServerResponse sr, org.apache.http.HttpEntity entity)
      Extract the operational outcome message from the response entity
      FhirServerResponse put​(java.lang.String url, java.lang.String body)
      Issue a PUT request without request-specific headers
      FhirServerResponse put​(java.lang.String url, RequestOptions requestOptions, java.lang.String body)
      Issue a PUT request with request-specific headers
      void shutdown()
      Shut down the pools associated with this client
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FHIRBucketClient

        public FHIRBucketClient​(ClientPropertyAdapter cpa)
        Public constructor
        Parameters:
        cpa -
    • Method Detail

      • addHeader

        public void addHeader​(java.lang.String key,
                              java.lang.String value)
        Add the given key/value as a header
        Parameters:
        key -
        value -
      • init

        public void init​(java.lang.String tenantName)
        Initialize the SSL connection pool after all the required field values have been injected
      • get

        public FhirServerResponse get​(java.lang.String url)
        Issue a GET request without request-specific headers
        Parameters:
        url -
        Returns:
      • get

        public FhirServerResponse get​(java.lang.String url,
                                      RequestOptions requestOptions)
        Issue a GET request with request-specific headers
        Parameters:
        url -
        requestOptions - request-specific headers; can be null
        Returns:
      • post

        public FhirServerResponse post​(java.lang.String url,
                                       java.lang.String body)
        Issue a POST request at the given url without any request-specific headers
        Parameters:
        url -
        body -
        Returns:
      • post

        public FhirServerResponse post​(java.lang.String url,
                                       RequestOptions requestOptions,
                                       java.lang.String body)
        Issue a POST request at the given url with request-specific headers
        Parameters:
        url -
        requestOptions - request-specific headers; can be null
        body -
        Returns:
      • put

        public FhirServerResponse put​(java.lang.String url,
                                      java.lang.String body)
        Issue a PUT request without request-specific headers
        Parameters:
        url -
        body -
        Returns:
      • put

        public FhirServerResponse put​(java.lang.String url,
                                      RequestOptions requestOptions,
                                      java.lang.String body)
        Issue a PUT request with request-specific headers
        Parameters:
        url -
        requestOptions -
        body -
        Returns:
      • delete

        public FhirServerResponse delete​(java.lang.String url)
        Issue a DELETE for the given url
        Parameters:
        url -
        Returns:
      • shutdown

        public void shutdown()
        Shut down the pools associated with this client
      • getPoolInformation

        public org.apache.http.pool.PoolStats getPoolInformation()
        Get statistics from the internal HTTP connection manager
        Returns:
      • processOperationalOutcome

        protected void processOperationalOutcome​(FhirServerResponse sr,
                                                 org.apache.http.HttpEntity entity)
        Extract the operational outcome message from the response entity
        Parameters:
        sr -
        entity -
      • obtainCloseableHttpClient

        protected org.apache.http.impl.client.CloseableHttpClient obtainCloseableHttpClient​(org.apache.http.conn.ConnectionKeepAliveStrategy connKeepAliveStrategy,
                                                                                            ClientPropertyAdapter propertyAdapter)
        Overridden by child classes for specialized behavior.
        Parameters:
        connKeepAliveStrategy -
      • getBaseUrl

        public java.lang.String getBaseUrl()
        Returns:
        the URL to the base of the FHIR server