public interface IRestfulClientFactory
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECT_TIMEOUT
Default value for
getConnectTimeout() |
static int |
DEFAULT_CONNECTION_REQUEST_TIMEOUT
Default value for
getConnectionRequestTimeout() |
static int |
DEFAULT_POOL_MAX
Default value for
() |
static int |
DEFAULT_POOL_MAX_PER_ROUTE
Default value for
getPoolMaxPerRoute() |
static ServerValidationModeEnum |
DEFAULT_SERVER_VALIDATION_MODE
Default value for
getServerValidationModeEnum() |
static int |
DEFAULT_SOCKET_TIMEOUT
Default value for
getSocketTimeout() |
| Modifier and Type | Method and Description |
|---|---|
int |
getConnectionRequestTimeout()
Gets the connection request timeout, in milliseconds.
|
int |
getConnectTimeout()
Gets the connect timeout, in milliseconds.
|
IHttpClient |
getHttpClient(StringBuilder theUrl,
Map<String,List<String>> theIfNoneExistParams,
String theIfNoneExistString,
RequestTypeEnum theRequestType,
List<Header> theHeaders)
Returns the 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()
Deprecated.
Use
getServerValidationMode() instead (this method is a synonym for that method, but this method is poorly named and will be removed at some point) |
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.
|
<T> void |
setHttpClient(T 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)
Deprecated.
Use
setServerValidationMode(ServerValidationModeEnum) instead. This method was incorrectly named. |
void |
setSocketTimeout(int theSocketTimeout)
Sets the socket timeout, in milliseconds.
|
void |
validateServerBase(String theServerBase,
IHttpClient theHttpClient,
IRestfulClient theClient) |
void |
validateServerBaseIfConfiguredToDoSo(String theServerBase,
IHttpClient theHttpClient,
IRestfulClient theClient)
This method is internal to HAPI - It may change in future versions, use with caution.
|
static final int DEFAULT_CONNECT_TIMEOUT
getConnectTimeout()static final int DEFAULT_CONNECTION_REQUEST_TIMEOUT
getConnectionRequestTimeout()static final ServerValidationModeEnum DEFAULT_SERVER_VALIDATION_MODE
getServerValidationModeEnum()static final int DEFAULT_SOCKET_TIMEOUT
getSocketTimeout()static final int DEFAULT_POOL_MAX
()static final int DEFAULT_POOL_MAX_PER_ROUTE
getPoolMaxPerRoute()int getConnectionRequestTimeout()
The default value for this setting is defined by DEFAULT_CONNECTION_REQUEST_TIMEOUT
int getConnectTimeout()
The default value for this setting is defined by DEFAULT_CONNECT_TIMEOUT
IHttpClient getHttpClient(StringBuilder theUrl, Map<String,List<String>> theIfNoneExistParams, String theIfNoneExistString, RequestTypeEnum theRequestType, List<Header> theHeaders)
theUrl - The complete FHIR url to which the http request will be senttheIfNoneExistParams - The params for header "If-None-Exist" as a hashmaptheIfNoneExistString - The param for header "If-None-Exist" as a stringtheRequestType - the type of HTTP request (GET, DELETE, ..)theHeaders - the headers to be sent together with the http request@Deprecated ServerValidationModeEnum getServerValidationModeEnum()
getServerValidationMode() instead (this method is a synonym for that method, but this method is poorly named and will be removed at some point)ServerValidationModeEnum getServerValidationMode()
The default value for this setting is defined by DEFAULT_SERVER_VALIDATION_MODE
int getSocketTimeout()
The default value for this setting is defined by DEFAULT_SOCKET_TIMEOUT
int getPoolMaxTotal()
The default value for this setting is defined by DEFAULT_POOL_MAX
int getPoolMaxPerRoute()
The default value for this setting is defined by DEFAULT_POOL_MAX_PER_ROUTE
<T extends IRestfulClient> T newClient(Class<T> theClientType, String theServerBase)
theClientType - 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 interfaceIGenericClient newGenericClient(String theServerBase)
theServerBase - The URL of the base for the restful FHIR server to connect tovoid setConnectionRequestTimeout(int theConnectionRequestTimeout)
The default value for this setting is defined by DEFAULT_CONNECTION_REQUEST_TIMEOUT
void setConnectTimeout(int theConnectTimeout)
The default value for this setting is defined by DEFAULT_CONNECT_TIMEOUT
<T> void setHttpClient(T theHttpClient)
null, a new HTTP client with default settings will be created.theHttpClient - An HTTP client instance to use, or nullvoid setProxy(String theHost, Integer thePort)
theHost - The host (or null to disable proxying, as is the default)thePort - The port (or null to disable proxying, as is the default)void setProxyCredentials(String theUsername, String thePassword)
theUsername - The usernamethePassword - The password@Deprecated void setServerValidationModeEnum(ServerValidationModeEnum theServerValidationMode)
setServerValidationMode(ServerValidationModeEnum) instead. This method was incorrectly named.void setServerValidationMode(ServerValidationModeEnum theServerValidationMode)
This check is primarily to validate that the server supports an appropriate version of FHIR
The default value for this setting is defined by DEFAULT_SERVER_VALIDATION_MODE
void setSocketTimeout(int theSocketTimeout)
The default value for this setting is defined by DEFAULT_SOCKET_TIMEOUT
void setPoolMaxTotal(int thePoolMaxTotal)
The default value for this setting is defined by DEFAULT_POOL_MAX
void setPoolMaxPerRoute(int thePoolMaxPerRoute)
The default value for this setting is defined by DEFAULT_POOL_MAX_PER_ROUTE
void validateServerBase(String theServerBase, IHttpClient theHttpClient, IRestfulClient theClient)
void validateServerBaseIfConfiguredToDoSo(String theServerBase, IHttpClient theHttpClient, IRestfulClient theClient)
Copyright © 2014–2017 University Health Network. All rights reserved.