Package com.ibm.fhir.bucket.client
Class FHIRBucketClient
- java.lang.Object
 - 
- com.ibm.fhir.bucket.client.FHIRBucketClient
 
 
- 
public class FHIRBucketClient extends 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. 
- 
- 
Constructor Summary
Constructors Constructor Description FHIRBucketClient(ClientPropertyAdapter cpa)Public constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String key, String value)Add the given key/value as a headerFhirServerResponseget(String url, Function<Reader,Resource> fn)StringgetBaseUrl()org.apache.http.pool.PoolStatsgetPoolInformation()Get statistics from the internal HTTP connection managervoidinit(String tenantName)Initialize the SSL connection pool after all the required field values have been injectedprotected org.apache.http.impl.client.CloseableHttpClientobtainCloseableHttpClient(org.apache.http.conn.ConnectionKeepAliveStrategy connKeepAliveStrategy, ClientPropertyAdapter propertyAdapter)Overridden by child classes for specialized behavior.FhirServerResponsepost(String url, String body)Issue a POST request at the given urlprotected voidprocessOperationalOutcome(FhirServerResponse sr, org.apache.http.HttpEntity entity)Extract the operational outcome message from the response entityFhirServerResponseput(String url, Map<String,String> headers, String body)voidshutdown() 
 - 
 
- 
- 
Constructor Detail
- 
FHIRBucketClient
public FHIRBucketClient(ClientPropertyAdapter cpa)
Public constructor- Parameters:
 cpa-
 
 - 
 
- 
Method Detail
- 
addHeader
public void addHeader(String key, String value)
Add the given key/value as a header- Parameters:
 key-value-
 
- 
init
public void init(String tenantName)
Initialize the SSL connection pool after all the required field values have been injected 
- 
get
public FhirServerResponse get(String url, Function<Reader,Resource> fn)
 
- 
post
public FhirServerResponse post(String url, String body)
Issue a POST request at the given url- Parameters:
 sUrl-body-- Returns:
 
 
- 
shutdown
public void shutdown()
 
- 
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 String getBaseUrl()
- Returns:
 - the URL to the base of the FHIR server
 
 
 - 
 
 -