Class ScimHttpClient
java.lang.Object
de.captaingoldfish.scim.sdk.client.http.ScimHttpClient
- All Implemented Interfaces:
Closeable,AutoCloseable
author: Pascal Knueppel
created at: 09.12.2019 - 12:26
will provide a service for creating pre-configured apache
the configuration added to the created clients are the following
created at: 09.12.2019 - 12:26
will provide a service for creating pre-configured apache
CloseableHttpClientsthe configuration added to the created clients are the following
- proxy authentication for a configured proxy (see
ProxyHelper) - a pre-configured
SSLContext. Depends on the specific declarated bean provided by the developer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()will close the apache http clientorg.apache.http.impl.client.CloseableHttpClientthis method generates a http-client instance and will set the ssl-contextorg.apache.http.client.config.RequestConfigwill configure the apache http-clientreads the timeout in seconds for setting up a connection
default: 3static intNumber by which timeout variables are multiplied.sendRequest(org.apache.http.client.methods.HttpUriRequest uriRequest) this method will send the request with the apache http client and will also handleIOExceptions and wrap them intoIORuntimeExceptions
-
Constructor Details
-
ScimHttpClient
-
-
Method Details
-
getHttpClient
public org.apache.http.impl.client.CloseableHttpClient getHttpClient()this method generates a http-client instance and will set the ssl-context- Returns:
- a http-client instance
-
getRequestConfig
public org.apache.http.client.config.RequestConfig getRequestConfig()will configure the apache http-client- Returns:
- the original request with an extended configuration
-
sendRequest
this method will send the request with the apache http client and will also handleIOExceptions and wrap them intoIORuntimeExceptions- Parameters:
uriRequest- the request that should be send- Returns:
- the response of the server
- Throws:
SSLHandshakeRuntimeException- in case that the server represented a certificate that is not trustedConnectRuntimeException- happens if the server does not respond (wrong URL wrong port or something else)ConnectTimeoutRuntimeException- if the server took too long to establish a connectionSocketTimeoutRuntimeException- if the server took too long to send the responseIORuntimeException- base exception that represents all previous mentioned exceptions
-
close
public void close()will close the apache http client- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getTIMEOUT_MILLIS
public static int getTIMEOUT_MILLIS()Number by which timeout variables are multiplied. -
getScimClientConfig
reads the timeout in seconds for setting up a connection
default: 3
-