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
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Fields inherited from interface ca.uhn.fhir.rest.client.api.IRestfulClientFactory
DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_REQUEST_TIMEOUT, DEFAULT_POOL_MAX, DEFAULT_POOL_MAX_PER_ROUTE, DEFAULT_SERVER_VALIDATION_MODE, DEFAULT_SOCKET_TIMEOUT
-
Constructor Summary
ConstructorDescriptionSslAwareMethanolRestfulClientFactory
(FhirContext theFhirContext) SslAwareMethanolRestfulClientFactory
(FhirContext fhirContext, com.github.mizosoft.methanol.Methanol.Builder httpClientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprotected IHttpClient
getHttpClient
(String theServerBase) getHttpClient
(StringBuilder url, Map<String, List<String>> ifNoneExistParams, String ifNoneExistString, RequestTypeEnum requestType, List<Header> headers) protected com.github.mizosoft.methanol.Methanol
FhirSecurityInformation<com.github.mizosoft.methanol.Methanol.Builder>
initializeSecurityInformation
(boolean enabled, SSLContext sslContext, HostnameVerifier hostnameVerifier, String userName, String password) protected com.github.mizosoft.methanol.Methanol.Builder
protected void
void
setAsync
(boolean async) Whether to use a thread pool to send the requestsvoid
setExecutor
(Executor executor) Define an executor to be used for asynchronous request processingvoid
setHttpClient
(Object httpClient) Sets a completely configured Http Client to be used.void
setPoolMaxTotal
(int poolMaxTotal) void
Methods inherited from class org.openehealth.ipf.commons.ihe.fhir.SslAwareAbstractRestfulClientFactory
customizeHttpClientBuilder, getSecurityInformation, httpClientBuilder, setSecurityInformation
Methods inherited from class ca.uhn.fhir.rest.client.impl.RestfulClientFactory
getConnectionRequestTimeout, getConnectTimeout, getFhirContext, getPoolMaxPerRoute, getPoolMaxTotal, getProxyPassword, getProxyUsername, getServerValidationMode, getServerValidationModeEnum, getSocketTimeout, newClient, newGenericClient, setConnectionRequestTimeout, 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:
getHttpClient
in classca.uhn.fhir.rest.client.impl.RestfulClientFactory
-
resetHttpClient
protected void resetHttpClient()- Specified by:
resetHttpClient
in classca.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
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:
newHttpClientBuilder
in classSslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
-
getNativeHttpClient
protected com.github.mizosoft.methanol.Methanol getNativeHttpClient() -
setPoolMaxTotal
public void setPoolMaxTotal(int poolMaxTotal) - Specified by:
setPoolMaxTotal
in interfaceIRestfulClientFactory
- Overrides:
setPoolMaxTotal
in classca.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 classSslAwareAbstractRestfulClientFactory<com.github.mizosoft.methanol.Methanol.Builder>
-