
Interface IRestfulClientFactory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault value forgetConnectTimeout()static final intDefault value forgetConnectionRequestTimeout()static final intDefault value forgetConnectionTimeToLive()static final intDefault value for()static final intDefault value forgetPoolMaxPerRoute()static final ServerValidationModeEnumDefault value forgetServerValidationModeEnum()static final intDefault value forgetSocketTimeout()
- 
Method SummaryModifier and TypeMethodDescriptionintGets the connection request timeout, in milliseconds.default intGets the connection time to live, in milliseconds.intGets the connect timeout, in milliseconds.getHttpClient(StringBuilder theUrl, Map<String, List<String>> theIfNoneExistParams, String theIfNoneExistString, RequestTypeEnum theRequestType, List<Header> theHeaders) Returns the HTTP client instance.intGets the maximum number of connections per route allowed in the pool.intGets the maximum number of connections allowed in the pool.Gets the server validation mode for any clients created from this factory.Deprecated.intGets the socket timeout, in milliseconds.<T extends IRestfulClient>
 TInstantiates a new client instancenewGenericClient(String theServerBase) Instantiates a new generic client instancevoidsetConnectionRequestTimeout(int theConnectionRequestTimeout) Sets the connection request timeout, in milliseconds.default voidsetConnectionTimeToLive(int theConnectionTimeToLive) Sets the connection time to live, in milliseconds.voidsetConnectTimeout(int theConnectTimeout) Sets the connect timeout, in milliseconds.<T> voidsetHttpClient(T theHttpClient) Sets the Apache HTTP client instance to be used by any new restful clients created by this factory.voidsetPoolMaxPerRoute(int thePoolMaxPerRoute) Sets the maximum number of connections per route allowed in the pool.voidsetPoolMaxTotal(int thePoolMaxTotal) Sets the maximum number of connections allowed in the pool.voidSets the HTTP proxy to use for outgoing connectionsvoidsetProxyCredentials(String theUsername, String thePassword) Sets the credentials to use to authenticate with the HTTP proxy, if one is defined.voidsetServerValidationMode(ServerValidationModeEnum theServerValidationMode) Sets the server validation mode for any clients created from this factory.voidsetServerValidationModeEnum(ServerValidationModeEnum theServerValidationMode) Deprecated.UsesetServerValidationMode(ServerValidationModeEnum)instead.voidsetSocketTimeout(int theSocketTimeout) Sets the socket timeout, in milliseconds.voidvalidateServerBase(String theServerBase, IHttpClient theHttpClient, IRestfulClient theClient) voidvalidateServerBaseIfConfiguredToDoSo(String theServerBase, IHttpClient theHttpClient, IRestfulClient theClient) This method is internal to HAPI - It may change in future versions, use with caution.
- 
Field Details- 
DEFAULT_CONNECT_TIMEOUTDefault value forgetConnectTimeout()- See Also:
 
- 
DEFAULT_CONNECTION_REQUEST_TIMEOUTDefault value forgetConnectionRequestTimeout()- See Also:
 
- 
DEFAULT_CONNECTION_TTLDefault value forgetConnectionTimeToLive()- See Also:
 
- 
DEFAULT_SERVER_VALIDATION_MODEDefault value forgetServerValidationModeEnum()
- 
DEFAULT_SOCKET_TIMEOUTDefault value forgetSocketTimeout()- See Also:
 
- 
DEFAULT_POOL_MAXDefault value for()- See Also:
 
- 
DEFAULT_POOL_MAX_PER_ROUTEDefault value forgetPoolMaxPerRoute()- See Also:
 
 
- 
- 
Method Details- 
getConnectionRequestTimeoutGets the connection request timeout, in milliseconds. This is the amount of time that the HTTPClient connection pool may wait for an available connection before failing. This setting typically does not need to be adjusted.The default value for this setting is defined by DEFAULT_CONNECTION_REQUEST_TIMEOUT
- 
getConnectTimeoutint getConnectTimeout()Gets the connect timeout, in milliseconds. This is the amount of time that the initial connection attempt network operation may block without failing.The default value for this setting is defined by DEFAULT_CONNECT_TIMEOUT
- 
getConnectionTimeToLiveGets the connection time to live, in milliseconds. This is the amount of time to keep connections alive for reuse.The default value for this setting is defined by DEFAULT_CONNECTION_TTL
- 
getHttpClientIHttpClient getHttpClient(StringBuilder theUrl, Map<String, List<String>> theIfNoneExistParams, String theIfNoneExistString, RequestTypeEnum theRequestType, List<Header> theHeaders) Returns the HTTP client instance. This method will not return null.- Parameters:
- theUrl- The complete FHIR url to which the http request will be sent
- theIfNoneExistParams- The params for header "If-None-Exist" as a hashmap
- theIfNoneExistString- The param for header "If-None-Exist" as a string
- theRequestType- the type of HTTP request (GET, DELETE, ..)
- theHeaders- the headers to be sent together with the http request
- Returns:
- the HTTP client instance
 
- 
getServerValidationModeEnumDeprecated.UsegetServerValidationMode()instead (this method is a synonym for that method, but this method is poorly named and will be removed at some point)
- 
getServerValidationModeGets the server validation mode for any clients created from this factory. Server validation involves the client requesting the server's conformance statement to determine whether the server is appropriate for the given client.The default value for this setting is defined by DEFAULT_SERVER_VALIDATION_MODE- Since:
- 1.0
 
- 
getSocketTimeoutint getSocketTimeout()Gets the socket timeout, in milliseconds. This is the SO_TIMEOUT time, which is the amount of time that a read/write network operation may block without failing.The default value for this setting is defined by DEFAULT_SOCKET_TIMEOUT
- 
getPoolMaxTotalint getPoolMaxTotal()Gets the maximum number of connections allowed in the pool.The default value for this setting is defined by DEFAULT_POOL_MAX
- 
getPoolMaxPerRouteint getPoolMaxPerRoute()Gets the maximum number of connections per route allowed in the pool.The default value for this setting is defined by DEFAULT_POOL_MAX_PER_ROUTE
- 
newClientInstantiates a new client instance- Parameters:
- theClientType- The client type, which is an interface type to be instantiated
- theServerBase- The URL of the base for the restful FHIR server to connect to
- Returns:
- A newly created client
- Throws:
- ConfigurationException- If the interface type is not an interface
 
- 
newGenericClientInstantiates a new generic client instance- Parameters:
- theServerBase- The URL of the base for the restful FHIR server to connect to
- Returns:
- A newly created client
 
- 
setConnectionRequestTimeoutSets the connection request timeout, in milliseconds. This is the amount of time that the HTTPClient connection pool may wait for an available connection before failing. This setting typically does not need to be adjusted.The default value for this setting is defined by DEFAULT_CONNECTION_REQUEST_TIMEOUT
- 
setConnectTimeoutSets the connect timeout, in milliseconds. This is the amount of time that the initial connection attempt network operation may block without failing.The default value for this setting is defined by DEFAULT_CONNECT_TIMEOUT
- 
setConnectionTimeToLiveSets the connection time to live, in milliseconds. This is the amount of time to keep connections alive for reuse.The default value for this setting is defined by DEFAULT_CONNECTION_TTL
- 
setHttpClientSets the Apache HTTP client instance to be used by any new restful clients created by this factory. If set tonull, a new HTTP client with default settings will be created.- Parameters:
- theHttpClient- An HTTP client instance to use, or- null
 
- 
setProxySets the HTTP proxy to use for outgoing connections- Parameters:
- theHost- The host (or null to disable proxying, as is the default)
- thePort- The port (or null to disable proxying, as is the default)
 
- 
setProxyCredentialsSets the credentials to use to authenticate with the HTTP proxy, if one is defined. Set to null to use no authentication with the proxy.- Parameters:
- theUsername- The username
- thePassword- The password
 
- 
setServerValidationModeEnumDeprecated.UsesetServerValidationMode(ServerValidationModeEnum)instead. This method was incorrectly named.
- 
setServerValidationModeSets the server validation mode for any clients created from this factory. Server validation involves the client requesting the server's conformance statement to determine whether the server is appropriate for the given client.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- Since:
- 1.0
 
- 
setSocketTimeoutSets the socket timeout, in milliseconds. This is the SO_TIMEOUT time, which is the amount of time that a read/write network operation may block without failing.The default value for this setting is defined by DEFAULT_SOCKET_TIMEOUT
- 
setPoolMaxTotalSets the maximum number of connections allowed in the pool.The default value for this setting is defined by DEFAULT_POOL_MAX
- 
setPoolMaxPerRouteSets the maximum number of connections per route allowed in the pool.The default value for this setting is defined by DEFAULT_POOL_MAX_PER_ROUTE
- 
validateServerBase
- 
validateServerBaseIfConfiguredToDoSovoid validateServerBaseIfConfiguredToDoSo(String theServerBase, IHttpClient theHttpClient, IRestfulClient theClient) This method is internal to HAPI - It may change in future versions, use with caution.
 
- 
getServerValidationMode()instead (this method is a synonym for that method, but this method is poorly named and will be removed at some point)