Class SslAwareMethanolRestfulClientFactory

java.lang.Object
ca.uhn.fhir.rest.client.impl.RestfulClientFactory
org.openehealth.ipf.commons.ihe.fhir.SslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
org.openehealth.ipf.commons.ihe.fhir.SslAwareMethanolRestfulClientFactory
All Implemented Interfaces:
IRestfulClientFactory

public class SslAwareMethanolRestfulClientFactory extends SslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
RestfulClientFactory that is aware of SSL context parameters and uses the HTTP Client built in JDK 11 with some added functionality provided by the lightweight Methanol library.
Author:
Christian Ohr
See Also:
  • Constructor Details

    • SslAwareMethanolRestfulClientFactory

      public SslAwareMethanolRestfulClientFactory(FhirContext theFhirContext)
    • SslAwareMethanolRestfulClientFactory

      public SslAwareMethanolRestfulClientFactory(FhirContext fhirContext, com.github.mizosoft.methanol.Methanol.Builder httpClientBuilder)
  • Method Details

    • getHttpClient

      protected IHttpClient getHttpClient(String theServerBase)
      Specified by:
      getHttpClient in class ca.uhn.fhir.rest.client.impl.RestfulClientFactory
    • resetHttpClient

      protected void resetHttpClient()
      Specified by:
      resetHttpClient in class ca.uhn.fhir.rest.client.impl.RestfulClientFactory
    • getHttpClient

      public IHttpClient getHttpClient(StringBuilder url, Map<String,List<String>> ifNoneExistParams, String ifNoneExistString, RequestTypeEnum requestType, List<Header> headers)
    • setHttpClient

      public void setHttpClient(Object httpClient)
      Sets a completely configured Http Client to be used. No further configuration is done before it is used.
      Parameters:
      httpClient - Http client instance
    • setProxy

      public void setProxy(String host, Integer port)
    • setAsync

      public void setAsync(boolean async)
      Whether to use a thread pool to send the requests
      Parameters:
      async - true to send the requests asynchronosly, false otherwise
    • setExecutor

      public void setExecutor(Executor executor)
      Define an executor to be used for asynchronous request processing
      Parameters:
      executor - executor to be used for asynchronous request processing
    • newHttpClientBuilder

      protected com.github.mizosoft.methanol.Methanol.Builder newHttpClientBuilder()
      Specified by:
      newHttpClientBuilder in class SslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
    • getNativeHttpClient

      protected com.github.mizosoft.methanol.Methanol getNativeHttpClient()
    • setPoolMaxTotal

      public void setPoolMaxTotal(int poolMaxTotal)
      Specified by:
      setPoolMaxTotal in interface IRestfulClientFactory
      Overrides:
      setPoolMaxTotal in class ca.uhn.fhir.rest.client.impl.RestfulClientFactory
    • initializeSecurityInformation

      public FhirSecurityInformation<com.github.mizosoft.methanol.Methanol.Builder> initializeSecurityInformation(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password)
      Specified by:
      initializeSecurityInformation in class SslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>