public class RestfulClientFactory extends Object implements IRestfulClientFactory
DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_REQUEST_TIMEOUT, DEFAULT_POOL_MAX, DEFAULT_POOL_MAX_PER_ROUTE, DEFAULT_SERVER_VALIDATION_MODE, DEFAULT_SOCKET_TIMEOUT| Constructor and Description |
|---|
RestfulClientFactory()
Constructor
|
RestfulClientFactory(FhirContext theFhirContext)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getConnectionRequestTimeout()
Gets the connection request timeout, in milliseconds.
|
int |
getConnectTimeout()
Gets the connect timeout, in milliseconds.
|
org.apache.http.client.HttpClient |
getHttpClient()
Returns the Apache HTTP client instance.
|
int |
getPoolMaxPerRoute()
Gets the maximum number of connections per route allowed in the pool.
|
int |
getPoolMaxTotal()
Gets the maximum number of connections allowed in the pool.
|
ServerValidationModeEnum |
getServerValidationMode()
Gets the server validation mode for any clients created from this factory.
|
ServerValidationModeEnum |
getServerValidationModeEnum() |
int |
getSocketTimeout()
Gets the socket timeout, in milliseconds.
|
<T extends IRestfulClient> |
newClient(Class<T> theClientType,
String theServerBase)
Instantiates a new client instance
|
IGenericClient |
newGenericClient(String theServerBase)
Instantiates a new generic client instance
|
void |
setConnectionRequestTimeout(int theConnectionRequestTimeout)
Sets the connection request timeout, in milliseconds.
|
void |
setConnectTimeout(int theConnectTimeout)
Sets the connect timeout, in milliseconds.
|
void |
setFhirContext(FhirContext theContext)
Sets the context associated with this client factory.
|
void |
setHttpClient(org.apache.http.client.HttpClient theHttpClient)
Sets the Apache HTTP client instance to be used by any new restful clients created by this factory.
|
void |
setPoolMaxPerRoute(int thePoolMaxPerRoute)
Sets the maximum number of connections per route allowed in the pool.
|
void |
setPoolMaxTotal(int thePoolMaxTotal)
Sets the maximum number of connections allowed in the pool.
|
void |
setProxy(String theHost,
Integer thePort)
Sets the HTTP proxy to use for outgoing connections
|
void |
setProxyCredentials(String theUsername,
String thePassword)
Sets the credentials to use to authenticate with the HTTP proxy,
if one is defined.
|
void |
setServerValidationMode(ServerValidationModeEnum theServerValidationMode)
Sets the server validation mode for any clients created from this factory.
|
void |
setServerValidationModeEnum(ServerValidationModeEnum theServerValidationMode) |
void |
setSocketTimeout(int theSocketTimeout)
Sets the socket timeout, in milliseconds.
|
void |
validateServerBaseIfConfiguredToDoSo(String theServerBase,
org.apache.http.client.HttpClient theHttpClient,
BaseClient theClient)
This method is internal to HAPI - It may change in future versions, use with caution.
|
public RestfulClientFactory()
public RestfulClientFactory(FhirContext theFhirContext)
theFhirContext - The contextpublic int getConnectionRequestTimeout()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_CONNECTION_REQUEST_TIMEOUT
getConnectionRequestTimeout in interface IRestfulClientFactorypublic int getConnectTimeout()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_CONNECT_TIMEOUT
getConnectTimeout in interface IRestfulClientFactorypublic org.apache.http.client.HttpClient getHttpClient()
IRestfulClientFactorygetHttpClient in interface IRestfulClientFactoryIRestfulClientFactory.setHttpClient(HttpClient)public void setProxyCredentials(String theUsername, String thePassword)
IRestfulClientFactorysetProxyCredentials in interface IRestfulClientFactorytheUsername - The usernamethePassword - The passwordpublic ServerValidationModeEnum getServerValidationMode()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_SERVER_VALIDATION_MODE
getServerValidationMode in interface IRestfulClientFactorypublic int getSocketTimeout()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_SOCKET_TIMEOUT
getSocketTimeout in interface IRestfulClientFactorypublic int getPoolMaxTotal()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_POOL_MAX
getPoolMaxTotal in interface IRestfulClientFactorypublic int getPoolMaxPerRoute()
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_POOL_MAX_PER_ROUTE
getPoolMaxPerRoute in interface IRestfulClientFactorypublic <T extends IRestfulClient> T newClient(Class<T> theClientType, String theServerBase)
newClient in interface IRestfulClientFactorytheClientType - The client type, which is an interface type to be instantiatedtheServerBase - The URL of the base for the restful FHIR server to connect toConfigurationException - If the interface type is not an interfacepublic IGenericClient newGenericClient(String theServerBase)
IRestfulClientFactorynewGenericClient in interface IRestfulClientFactorytheServerBase - The URL of the base for the restful FHIR server to connect topublic void validateServerBaseIfConfiguredToDoSo(String theServerBase, org.apache.http.client.HttpClient theHttpClient, BaseClient theClient)
public void setConnectionRequestTimeout(int theConnectionRequestTimeout)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_CONNECTION_REQUEST_TIMEOUT
setConnectionRequestTimeout in interface IRestfulClientFactorypublic void setConnectTimeout(int theConnectTimeout)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_CONNECT_TIMEOUT
setConnectTimeout in interface IRestfulClientFactorypublic void setFhirContext(FhirContext theContext)
public void setHttpClient(org.apache.http.client.HttpClient theHttpClient)
null, which is the default, a new HTTP client with default settings will be created.setHttpClient in interface IRestfulClientFactorytheHttpClient - An HTTP client instance to use, or nullpublic void setProxy(String theHost, Integer thePort)
IRestfulClientFactorysetProxy in interface IRestfulClientFactorytheHost - The host (or null to disable proxying, as is the default)thePort - The port (or null to disable proxying, as is the default)public void setServerValidationMode(ServerValidationModeEnum theServerValidationMode)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_SERVER_VALIDATION_MODE
setServerValidationMode in interface IRestfulClientFactorypublic void setSocketTimeout(int theSocketTimeout)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_SOCKET_TIMEOUT
setSocketTimeout in interface IRestfulClientFactorypublic void setPoolMaxTotal(int thePoolMaxTotal)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_POOL_MAX
setPoolMaxTotal in interface IRestfulClientFactorypublic void setPoolMaxPerRoute(int thePoolMaxPerRoute)
IRestfulClientFactory
The default value for this setting is defined by IRestfulClientFactory.DEFAULT_POOL_MAX_PER_ROUTE
setPoolMaxPerRoute in interface IRestfulClientFactorypublic ServerValidationModeEnum getServerValidationModeEnum()
getServerValidationModeEnum in interface IRestfulClientFactorypublic void setServerValidationModeEnum(ServerValidationModeEnum theServerValidationMode)
setServerValidationModeEnum in interface IRestfulClientFactoryCopyright © 2014–2016 University Health Network. All rights reserved.