Class SslAwareApacheRestfulClient5Factory
java.lang.Object
ca.uhn.fhir.rest.client.impl.RestfulClientFactory
org.openehealth.ipf.commons.ihe.fhir.SslAwareAbstractRestfulClientFactory<HttpClient5Builder>
org.openehealth.ipf.commons.ihe.fhir.SslAwareApacheRestfulClient5Factory
- All Implemented Interfaces:
IRestfulClientFactory
public class SslAwareApacheRestfulClient5Factory
extends SslAwareAbstractRestfulClientFactory<HttpClient5Builder>
RestfulClientFactory based on Apache HttpClient5 that is aware of SSL context parameters. Note that with
Spring 6, its RestTemplate also works with HttpClient5, so this is an option to reduce the number of
HTTP client libraries.
- Author:
- Christian Ohr
-
Field Summary
Fields inherited from interface ca.uhn.fhir.rest.client.api.IRestfulClientFactory
DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_REQUEST_TIMEOUT, DEFAULT_CONNECTION_TTL, DEFAULT_POOL_MAX, DEFAULT_POOL_MAX_PER_ROUTE, DEFAULT_SERVER_VALIDATION_MODE, DEFAULT_SOCKET_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionSslAwareApacheRestfulClient5Factory(FhirContext theFhirContext) SslAwareApacheRestfulClient5Factory(FhirContext fhirContext, HttpClient5Builder httpClientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprotected IHttpClientgetHttpClient(String serverBase) getHttpClient(StringBuilder url, Map<String, List<String>> ifNoneExistParams, String ifNoneExistString, RequestTypeEnum requestType, List<Header> headers) protected org.apache.hc.client5.http.impl.classic.CloseableHttpClientinitializeSecurityInformation(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password) protected HttpClient5Builderprotected voidvoidsetHttpClient(Object httpClient) Sets a completely configured HttpClient to be used.voidMethods inherited from class org.openehealth.ipf.commons.ihe.fhir.SslAwareAbstractRestfulClientFactory
customizeHttpClientBuilder, getSecurityInformation, httpClientBuilder, setSecurityInformationMethods inherited from class ca.uhn.fhir.rest.client.impl.RestfulClientFactory
getConnectionRequestTimeout, getConnectionTimeToLive, getConnectTimeout, getFhirContext, getPoolMaxPerRoute, getPoolMaxTotal, getProxyPassword, getProxyUsername, getServerValidationMode, getServerValidationModeEnum, getSocketTimeout, newClient, newGenericClient, setConnectionRequestTimeout, setConnectionTimeToLive, setConnectTimeout, setFhirContext, setPoolMaxPerRoute, setPoolMaxTotal, setProxyCredentials, setServerValidationMode, setServerValidationModeEnum, setSocketTimeout, validateConfigured, validateServerBase, validateServerBaseIfConfiguredToDoSo
-
Constructor Details
-
SslAwareApacheRestfulClient5Factory
-
SslAwareApacheRestfulClient5Factory
public SslAwareApacheRestfulClient5Factory(FhirContext fhirContext, HttpClient5Builder httpClientBuilder)
-
-
Method Details
-
getHttpClient
- Specified by:
getHttpClientin classRestfulClientFactory
-
resetHttpClient
protected void resetHttpClient()- Specified by:
resetHttpClientin classRestfulClientFactory
-
getHttpClient
public IHttpClient getHttpClient(StringBuilder url, Map<String, List<String>> ifNoneExistParams, String ifNoneExistString, RequestTypeEnum requestType, List<Header> headers) -
setHttpClient
Sets a completely configured HttpClient to be used. No further configuration is done (timeouts, security etc.) before it is used.- Parameters:
httpClient- Http client instance
-
setProxy
-
newHttpClientBuilder
- Specified by:
newHttpClientBuilderin classSslAwareAbstractRestfulClientFactory<HttpClient5Builder>
-
getNativeHttpClient
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient getNativeHttpClient() -
initializeSecurityInformation
public FhirSecurityInformation<HttpClient5Builder> initializeSecurityInformation(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password) - Specified by:
initializeSecurityInformationin classSslAwareAbstractRestfulClientFactory<HttpClient5Builder>
-