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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
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
ConstructorsConstructorDescriptionSslAwareMethanolRestfulClientFactory(FhirContext theFhirContext) SslAwareMethanolRestfulClientFactory(FhirContext fhirContext, com.github.mizosoft.methanol.Methanol.Builder httpClientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprotected IHttpClientgetHttpClient(String theServerBase) getHttpClient(StringBuilder url, Map<String, List<String>> ifNoneExistParams, String ifNoneExistString, RequestTypeEnum requestType, List<Header> headers) protected com.github.mizosoft.methanol.MethanolFhirSecurityInformation<com.github.mizosoft.methanol.Methanol.Builder> initializeSecurityInformation(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password) protected com.github.mizosoft.methanol.Methanol.Builderprotected voidvoidsetAsync(boolean async) Whether to use a thread pool to send the requestsvoidsetExecutor(Executor executor) Define an executor to be used for asynchronous request processingvoidsetHttpClient(Object httpClient) Sets a completely configured Http Client to be used.voidsetPoolMaxTotal(int poolMaxTotal) 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, setProxyCredentials, setServerValidationMode, setServerValidationModeEnum, setSocketTimeout, validateConfigured, validateServerBase, validateServerBaseIfConfiguredToDoSo
-
Constructor Details
-
SslAwareMethanolRestfulClientFactory
-
SslAwareMethanolRestfulClientFactory
public SslAwareMethanolRestfulClientFactory(FhirContext fhirContext, com.github.mizosoft.methanol.Methanol.Builder 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 Http Client to be used. No further configuration is done before it is used.- Parameters:
httpClient- Http client instance
-
setProxy
-
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
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:
newHttpClientBuilderin classSslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
-
getNativeHttpClient
protected com.github.mizosoft.methanol.Methanol getNativeHttpClient() -
setPoolMaxTotal
public void setPoolMaxTotal(int poolMaxTotal) - Specified by:
setPoolMaxTotalin interfaceIRestfulClientFactory- Overrides:
setPoolMaxTotalin classRestfulClientFactory
-
initializeSecurityInformation
public FhirSecurityInformation<com.github.mizosoft.methanol.Methanol.Builder> initializeSecurityInformation(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password) - Specified by:
initializeSecurityInformationin classSslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
-