Package ca.uhn.fhir.jaxrs.client
Class JaxRsRestfulClientFactory
java.lang.Object
ca.uhn.fhir.rest.client.impl.RestfulClientFactory
ca.uhn.fhir.jaxrs.client.JaxRsRestfulClientFactory
- All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IRestfulClientFactory
A Restful Client Factory, based on Jax Rs
Default Jax-Rs client is NOT thread safe in static context, you should create a new factory every time or
use a specific Jax-Rs client implementation which managed connection pool.
- Author:
- Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
-
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
ConstructorsConstructorDescriptionConstructor.JaxRsRestfulClientFactory(ca.uhn.fhir.context.FhirContext theFhirContext)Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected JaxRsHttpClientgetHttpClient(String theServerBase)ca.uhn.fhir.rest.client.api.IHttpClientgetHttpClient(StringBuilder url, Map<String,List<String>> theIfNoneExistParams, String theIfNoneExistString, ca.uhn.fhir.rest.api.RequestTypeEnum theRequestType, List<ca.uhn.fhir.rest.client.api.Header> theHeaders)javax.ws.rs.client.ClientvoidRegister a list of Jax-Rs component (provider, filter...)protected voidvoidsetHttpClient(Object theHttpClient)Only accept clients of type javax.ws.rs.client.Client Can be used to set a specific Client implementationvoidNot supported with default Jax-Rs client implementationMethods 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, setPoolMaxTotal, setProxyCredentials, setServerValidationMode, setServerValidationModeEnum, setSocketTimeout, validateConfigured, validateServerBase, validateServerBaseIfConfiguredToDoSo
-
Constructor Details
-
JaxRsRestfulClientFactory
public JaxRsRestfulClientFactory()Constructor. Note that you must set theFhirContextmanually usingRestfulClientFactory.setFhirContext(FhirContext)if this constructor is used! -
JaxRsRestfulClientFactory
Constructor- Parameters:
theFhirContext- The context
-
-
Method Details
-
getNativeClientClient
-
getHttpClient
public ca.uhn.fhir.rest.client.api.IHttpClient getHttpClient(StringBuilder url, Map<String,List<String>> theIfNoneExistParams, String theIfNoneExistString, ca.uhn.fhir.rest.api.RequestTypeEnum theRequestType, List<ca.uhn.fhir.rest.client.api.Header> theHeaders) -
setProxy
Not supported with default Jax-Rs client implementation- Parameters:
theHost- The host (or null to disable proxying, as is the default)thePort-
-
setHttpClient
Only accept clients of type javax.ws.rs.client.Client Can be used to set a specific Client implementation- Parameters:
theHttpClient-
-
register
Register a list of Jax-Rs component (provider, filter...)- Parameters:
components- list of Jax-Rs components to register
-
getHttpClient
- Specified by:
getHttpClientin classca.uhn.fhir.rest.client.impl.RestfulClientFactory
-
resetHttpClient
- Specified by:
resetHttpClientin classca.uhn.fhir.rest.client.impl.RestfulClientFactory
-