public abstract 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.
|
FhirContext |
getFhirContext()
Return the fhir context
|
protected abstract IHttpClient |
getHttpClient(String theServerBase)
Get the http client for the given server base
|
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.
|
protected String |
getProxyPassword()
Return the proxy password to authenticate with the HTTP proxy
|
protected String |
getProxyUsername()
Return the proxy username to authenticate with the HTTP proxy
|
ServerValidationModeEnum |
getServerValidationMode()
Gets the server validation mode for any clients created from this factory.
|
ServerValidationModeEnum |
getServerValidationModeEnum()
Deprecated.
|
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
|
protected abstract void |
resetHttpClient()
Reset the http client.
|
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 |
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 |
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)
Deprecated.
|
void |
setSocketTimeout(int theSocketTimeout)
Sets the socket timeout, in milliseconds.
|
protected void |
validateConfigured()
Called automatically before the first use of this factory to ensure that
the configuration is sane.
|
void |
validateServerBase(String theServerBase,
IHttpClient theHttpClient,
BaseClient theClient) |
void |
validateServerBaseIfConfiguredToDoSo(String theServerBase,
IHttpClient theHttpClient,
BaseClient theClient)
This method is internal to HAPI - It may change in future versions, use with caution.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHttpClient, setHttpClient, setProxypublic 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 IRestfulClientFactoryprotected String getProxyUsername()
The - proxy usernameprotected String getProxyPassword()
The - proxy passwordpublic 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 interfaceprotected void validateConfigured()
super.validateConfigured()public 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, IHttpClient theHttpClient, BaseClient theClient)
IRestfulClientFactoryvalidateServerBaseIfConfiguredToDoSo in interface IRestfulClientFactorypublic 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 FhirContext getFhirContext()
public void setServerValidationMode(ServerValidationModeEnum theServerValidationMode)
IRestfulClientFactoryThis check is primarily to validate that the server supports an appropriate version of FHIR
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 void validateServerBase(String theServerBase, IHttpClient theHttpClient, BaseClient theClient)
validateServerBase in interface IRestfulClientFactory@Deprecated public ServerValidationModeEnum getServerValidationModeEnum()
getServerValidationModeEnum in interface IRestfulClientFactory@Deprecated public void setServerValidationModeEnum(ServerValidationModeEnum theServerValidationMode)
setServerValidationModeEnum in interface IRestfulClientFactoryprotected abstract IHttpClient getHttpClient(String theServerBase)
theServerBase - the server baseprotected abstract void resetHttpClient()
Copyright © 2014–2017 University Health Network. All rights reserved.