Class CommonsDataLoader
java.lang.Object
eu.europa.esig.dss.service.http.commons.CommonsDataLoader
- All Implemented Interfaces:
DataLoader
,Serializable
- Direct Known Subclasses:
OCSPDataLoader
,TimestampDataLoader
Implementation of DataLoader for any protocol.
HTTP and HTTPS: using HttpClient which is more flexible for HTTPS without
having to add the certificate to the JVM TrustStore. It takes into account a
proxy management through ProxyPreferenceManager
. The authentication
is also supported.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.europa.esig.dss.spi.client.http.DataLoader
DataLoader.DataAndUrl
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThe default constructor for CommonsDataLoader.CommonsDataLoader
(String contentType) The constructor for CommonsDataLoader with defined content-type. -
Method Summary
Modifier and TypeMethodDescriptionaddAuthentication
(HostConnection hostConnection, UserCredentials userCredentials) Adds authentication credentials to the existingauthenticationMap
addAuthentication
(String host, int port, String scheme, String login, char[] password) Adds authentication credentials to the existingauthenticationMap
addAuthentication
(String host, int port, String scheme, String login, String password) Deprecated.since DSS 5.12.protected void
closeQuietly
(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpRequest, org.apache.hc.client5.http.impl.classic.CloseableHttpClient client) Closes all the parameters quietlyprotected void
closeQuietly
(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpRequest, org.apache.hc.client5.http.impl.classic.CloseableHttpResponse httpResponse, org.apache.hc.client5.http.impl.classic.CloseableHttpClient client) Deprecated.since DSS 5.12.protected org.apache.hc.client5.http.protocol.HttpClientContext
configurePreemptiveAuthentication
(org.apache.hc.client5.http.protocol.HttpClientContext localContext, org.apache.hc.core5.http.HttpHost httpHost) This method is used to configure preemptive authentication process forHttpClientContext
, when requiredprotected byte[]
execute
(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) ProcesseshttpRequest
and returns the byte array representing the response's contentprotected byte[]
Gets the file content by its URLprotected byte[]
This method retrieves data using FTP protocol .byte[]
Execute a HTTP GET operation.byte[]
Deprecated.since 5.12.Execute a HTTP GET operation.Deprecated.since DSS 5.12.Returns the current instance of the authentication mapint
Gets the connection keep alive timeout.int
Gets the maximum connections number per route.int
Gets the maximum connections number.int
Gets the finite connection time to live.protected byte[]
getContent
(org.apache.hc.core5.http.HttpEntity responseEntity) Deprecated.since DSS 5.12.Gets the content typeprotected org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider
Builds and returns aBasicCredentialsProvider
configured withauthenticationMap
Gets the hostname verifierprotected org.apache.hc.client5.http.impl.classic.CloseableHttpClient
getHttpClient
(String url) Gets the HTTP clientprotected org.apache.hc.client5.http.impl.classic.HttpClientBuilder
Gets theHttpClientBuilder
for the urlorg.apache.hc.core5.http.io.HttpClientResponseHandler<byte[]>
Returns theHttpClientResponseHandler
response handlerprotected org.apache.hc.core5.http.protocol.HttpContext
Deprecated.since DSS 5.12.protected org.apache.hc.core5.http.protocol.HttpContext
getHttpContext
(org.apache.hc.core5.http.HttpHost httpHost) Gets theHttpContext
protected org.apache.hc.core5.http.HttpHost
getHttpHost
(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) Gets theHttpHost
protected org.apache.hc.client5.http.classic.methods.HttpGet
getHttpRequest
(String url) Gets the HTTP requestprotected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse
getHttpResponse
(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) Deprecated.since DSS 5.12.Gets the proxy configurationprotected KeyStore
Gets the SSL KeyStoreprotected KeyStore
Gets the SSL Trusted KeyStoreString[]
Gets supported SSL Cipher SuitesString[]
Gets supported SSL protocolsint
Gets the connection timeout.int
Gets the connection request timeout.int
Gets the server response timeout.int
Gets the socket timeout.org.apache.hc.core5.ssl.TrustStrategy
Gets the TrustStrategyprotected byte[]
This method retrieves data using HTTP or HTTPS protocol and 'get' method.boolean
Gets if redirect is enabled.boolean
Gets if the default system network properties shall be usedprotected byte[]
This method retrieves data using LDAP protocol.byte[]
Executes a HTTP POST operationprotected byte[]
readHttpResponse
(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse httpResponse) Deprecated.since DSS 5.12.void
setAcceptedHttpStatus
(List<Integer> acceptedHttpStatus) Deprecated.since DSS 5.12.void
setAuthenticationMap
(Map<HostConnection, UserCredentials> authenticationMap) Sets the authentication map NOTE: this method overrides the current instance ofauthenticationMap
void
setConnectionKeepAlive
(int connectionKeepAlive) Sets the connection keep alive timeout in milliseconds.void
setConnectionsMaxPerRoute
(int connectionsMaxPerRoute) Sets the maximum connections number per route.void
setConnectionsMaxTotal
(int connectionsMaxTotal) Sets the maximum connections number.void
setConnectionTimeToLive
(int connectionTimeToLive) Sets the finite connection total time to live (TTL) in milliseconds.void
setContentType
(String contentType) This allows to set the content type.void
setHostnameVerifier
(HostnameVerifier hostnameVerifier) Sets a customHostnameVerifier
void
setHttpClientResponseHandler
(org.apache.hc.core5.http.io.HttpClientResponseHandler<byte[]> httpClientResponseHandler) Sets theHttpClientResponseHandler<byte[]>
response handler performing a processing of an HTTP client response and returns a byte array in case of success.void
setKeyStoreAsTrustMaterial
(boolean loadKeyStoreAsTrustMaterial) Sets if the KeyStore shall be considered as a trust material (used for SSL connection)void
setPreemptiveAuthentication
(boolean preemptiveAuthentication) Sets whether the preemptive authentication should be used.void
setProxyConfig
(ProxyConfig proxyConfig) Sets the proxy configurationvoid
setRedirectsEnabled
(boolean redirectsEnabled) Sets if redirect should be enabled.void
setRetryStrategy
(org.apache.hc.client5.http.HttpRequestRetryStrategy retryStrategy) Sets a custom retry strategyvoid
setSslKeystore
(DSSDocument sslKeyStore) Sets the SSL KeyStorevoid
setSslKeystorePassword
(char[] sslKeystorePassword) Sets the KeyStore password.void
setSslKeystorePassword
(String sslKeystorePassword) Deprecated.since DSS 5.12.void
setSslKeystoreType
(String sslKeystoreType) Sets the SSL KeyStore typevoid
setSslProtocol
(String sslProtocol) This method sets the SSL protocol to be usedvoid
setSslTruststore
(DSSDocument sslTrustStore) Sets the SSL trust store NOTE: different from KeyStore!void
setSslTruststorePassword
(char[] sslTruststorePassword) Sets the password for SSL truststorevoid
setSslTruststorePassword
(String sslTruststorePassword) Deprecated.since DSS 5.12.void
setSslTruststoreType
(String sslTruststoreType) Sets the SSL TrustStore typevoid
setSupportedSSLCipherSuites
(String[] supportedSSLCipherSuites) Sets supported SSL Cipher Suitesvoid
setSupportedSSLProtocols
(String[] supportedSSLProtocols) Sets supported SSL protocolsvoid
setTimeoutConnection
(int timeoutConnection) Sets the connection timeout in milliseconds.void
setTimeoutConnectionRequest
(int timeoutConnectionRequest) Sets the connection request in milliseconds.void
setTimeoutResponse
(int timeoutResponse) Sets the server response timeout in milliseconds.void
setTimeoutSocket
(int timeoutSocket) Sets the socket timeout in milliseconds.void
setTrustStrategy
(org.apache.hc.core5.ssl.TrustStrategy trustStrategy) Sets theTrustStrategy
void
setUseSystemProperties
(boolean useSystemProperties) Sets if the default system network properties shall be used Default: FALSE (system properties are not used) NOTE: all other configured property may override the default behavior!
-
Field Details
-
contentType
The content type value
-
-
Constructor Details
-
CommonsDataLoader
public CommonsDataLoader()The default constructor for CommonsDataLoader. -
CommonsDataLoader
The constructor for CommonsDataLoader with defined content-type.- Parameters:
contentType
- The content type of each request
-
-
Method Details
-
getTimeoutConnection
public int getTimeoutConnection()Gets the connection timeout.- Returns:
- the value (millis)
-
setTimeoutConnection
public void setTimeoutConnection(int timeoutConnection) Sets the connection timeout in milliseconds. A negative value is interpreted as undefined (use system default).- Parameters:
timeoutConnection
- the value (millis)
-
getTimeoutConnectionRequest
public int getTimeoutConnectionRequest()Gets the connection request timeout.- Returns:
- the value (millis)
-
setTimeoutConnectionRequest
public void setTimeoutConnectionRequest(int timeoutConnectionRequest) Sets the connection request in milliseconds. A negative value is interpreted as undefined (use system default).- Parameters:
timeoutConnectionRequest
- the value (millis)
-
getTimeoutResponse
public int getTimeoutResponse()Gets the server response timeout.- Returns:
- the value (millis)
-
setTimeoutResponse
public void setTimeoutResponse(int timeoutResponse) Sets the server response timeout in milliseconds. A negative value is interpreted as undefined (use system default).- Parameters:
timeoutResponse
- the value (millis)
-
getTimeoutSocket
public int getTimeoutSocket()Gets the socket timeout.- Returns:
- the value (millis)
-
setTimeoutSocket
public void setTimeoutSocket(int timeoutSocket) Sets the socket timeout in milliseconds. A negative value is interpreted as undefined (use system default).- Parameters:
timeoutSocket
- the value (millis)
-
getConnectionKeepAlive
public int getConnectionKeepAlive()Gets the connection keep alive timeout.- Returns:
- the value (millis)
-
setConnectionKeepAlive
public void setConnectionKeepAlive(int connectionKeepAlive) Sets the connection keep alive timeout in milliseconds.- Parameters:
connectionKeepAlive
- the value (millis)
-
getConnectionsMaxTotal
public int getConnectionsMaxTotal()Gets the maximum connections number.- Returns:
- the value (millis)
-
setConnectionsMaxTotal
public void setConnectionsMaxTotal(int connectionsMaxTotal) Sets the maximum connections number.- Parameters:
connectionsMaxTotal
- maximum number of connections
-
getConnectionsMaxPerRoute
public int getConnectionsMaxPerRoute()Gets the maximum connections number per route.- Returns:
- maximum number of connections per one route
-
setConnectionsMaxPerRoute
public void setConnectionsMaxPerRoute(int connectionsMaxPerRoute) Sets the maximum connections number per route.- Parameters:
connectionsMaxPerRoute
- maximum number of connections per one route
-
getConnectionTimeToLive
public int getConnectionTimeToLive()Gets the finite connection time to live.- Returns:
- connection time to live (millis)
-
setConnectionTimeToLive
public void setConnectionTimeToLive(int connectionTimeToLive) Sets the finite connection total time to live (TTL) in milliseconds.- Parameters:
connectionTimeToLive
- the finite connection time to live (millis)
-
isRedirectsEnabled
public boolean isRedirectsEnabled()Gets if redirect is enabled.- Returns:
- true if http redirects are allowed
-
setRedirectsEnabled
public void setRedirectsEnabled(boolean redirectsEnabled) Sets if redirect should be enabled.- Parameters:
redirectsEnabled
- true if http redirects are allowed
-
isUseSystemProperties
public boolean isUseSystemProperties()Gets if the default system network properties shall be used- Returns:
- TRUE if the default system network properties shall be used, FALSE otherwise
-
setUseSystemProperties
public void setUseSystemProperties(boolean useSystemProperties) Sets if the default system network properties shall be used Default: FALSE (system properties are not used) NOTE: all other configured property may override the default behavior!- Parameters:
useSystemProperties
- if the default system network properties shall be used
-
getContentType
Gets the content type- Returns:
- the contentType
-
setContentType
Description copied from interface:DataLoader
This allows to set the content type. Example: Content-Type "application/ocsp-request"- Specified by:
setContentType
in interfaceDataLoader
- Parameters:
contentType
- to set the Content-Type
-
getAcceptedHttpStatus
Deprecated.since DSS 5.12. UseCommonsHttpClientResponseHandler httpClientResponseHandler = new CommonsHttpClientResponseHandler(); List<Integer> acceptedHttpStatus = httpClientResponseHandler.getAcceptedHttpStatuses();
Returns a list of accepted HTTP status numbers- Returns:
- a list of accepted HTTP status numbers
-
setAcceptedHttpStatus
Deprecated.since DSS 5.12. UseCommonsHttpClientResponseHandler httpClientResponseHandler = new CommonsHttpClientResponseHandler(); httpClientResponseHandler.setAcceptedHttpStatuses(acceptedHttpStatus); commonsDataLoader.setHttpClientResponseHandler(httpClientResponseHandler);
This allows to set a list of accepted http status. Example: 200 (OK)- Parameters:
acceptedHttpStatus
- a list of integer which correspond to the http status code
-
getProxyConfig
Gets the proxy configuration- Returns:
- associated
ProxyConfig
-
setProxyConfig
Sets the proxy configuration- Parameters:
proxyConfig
- the proxyConfig to set
-
setSslProtocol
This method sets the SSL protocol to be used- Parameters:
sslProtocol
- the ssl protocol to be used
-
setSslKeystore
Sets the SSL KeyStore- Parameters:
sslKeyStore
-DSSDocument
-
setKeyStoreAsTrustMaterial
public void setKeyStoreAsTrustMaterial(boolean loadKeyStoreAsTrustMaterial) Sets if the KeyStore shall be considered as a trust material (used for SSL connection)- Parameters:
loadKeyStoreAsTrustMaterial
- if the KeyStore shall be considered as a trust material
-
setSslKeystoreType
Sets the SSL KeyStore type- Parameters:
sslKeystoreType
-String
-
setSslKeystorePassword
Deprecated.since DSS 5.12. Use#setSslKeystorePassword(char[] sslKeystorePassword)
Sets the KeyStore password- Parameters:
sslKeystorePassword
-String
-
setSslKeystorePassword
public void setSslKeystorePassword(char[] sslKeystorePassword) Sets the KeyStore password. Please note that the password shall be the same for the keystore and the extraction of a corresponding key.- Parameters:
sslKeystorePassword
- char array representing the password
-
setSslTruststore
Sets the SSL trust store NOTE: different from KeyStore!- Parameters:
sslTrustStore
-DSSDocument
-
setSslTruststorePassword
Deprecated.since DSS 5.12. Use#setSslTruststorePassword(char[] sslTruststorePassword)
Sets the password for SSL truststore- Parameters:
sslTruststorePassword
-String
-
setSslTruststorePassword
public void setSslTruststorePassword(char[] sslTruststorePassword) Sets the password for SSL truststore- Parameters:
sslTruststorePassword
- char array representing a password string
-
setSslTruststoreType
Sets the SSL TrustStore type- Parameters:
sslTruststoreType
-String
-
getAuthenticationMap
Returns the current instance of the authentication map- Returns:
- a map between
HostConnection
andUserCredentials
-
setAuthenticationMap
Sets the authentication map NOTE: this method overrides the current instance ofauthenticationMap
- Parameters:
authenticationMap
- a map betweenHostConnection
andUserCredentials
-
addAuthentication
public CommonsDataLoader addAuthentication(HostConnection hostConnection, UserCredentials userCredentials) Adds authentication credentials to the existingauthenticationMap
- Parameters:
hostConnection
- host connection detailsuserCredentials
- user login credentials- Returns:
- this (for fluent addAuthentication)
-
setPreemptiveAuthentication
public void setPreemptiveAuthentication(boolean preemptiveAuthentication) Sets whether the preemptive authentication should be used. When set to TRUE, the client sends authentication details (i.e. user credentials) within the initial request to the remote host, instead of sending the credentials only after a request from the host. Please note that the preemptive authentication should not be used over an insecure connection. Default : FALSE (preemptive authentication is not used)- Parameters:
preemptiveAuthentication
- whether the preemptive authentication should be used
-
addAuthentication
@Deprecated public CommonsDataLoader addAuthentication(String host, int port, String scheme, String login, String password) Deprecated.since DSS 5.12. Use#addAuthentication( final String host, final int port, final String scheme, final String login, final char[] password)
Adds authentication credentials to the existingauthenticationMap
- Parameters:
host
- hostport
- portscheme
- schemelogin
- loginpassword
- password- Returns:
- this (for fluent addAuthentication)
-
addAuthentication
public CommonsDataLoader addAuthentication(String host, int port, String scheme, String login, char[] password) Adds authentication credentials to the existingauthenticationMap
- Parameters:
host
- hostport
- portscheme
- schemelogin
- loginpassword
- password- Returns:
- this (for fluent addAuthentication)
-
setRetryStrategy
public void setRetryStrategy(org.apache.hc.client5.http.HttpRequestRetryStrategy retryStrategy) Sets a custom retry strategy- Parameters:
retryStrategy
-HttpRequestRetryStrategy
-
getSupportedSSLProtocols
Gets supported SSL protocols- Returns:
- an array if
String
s
-
setSupportedSSLProtocols
Sets supported SSL protocols- Parameters:
supportedSSLProtocols
- an array ifString
s
-
getSupportedSSLCipherSuites
Gets supported SSL Cipher Suites- Returns:
- an array if
String
s
-
setSupportedSSLCipherSuites
Sets supported SSL Cipher Suites- Parameters:
supportedSSLCipherSuites
- an array ifString
s
-
getHostnameVerifier
Gets the hostname verifier- Returns:
HostnameVerifier
-
setHostnameVerifier
Sets a customHostnameVerifier
- Parameters:
hostnameVerifier
-HostnameVerifier
-
getTrustStrategy
public org.apache.hc.core5.ssl.TrustStrategy getTrustStrategy()Gets the TrustStrategy- Returns:
TrustStrategy
-
setTrustStrategy
public void setTrustStrategy(org.apache.hc.core5.ssl.TrustStrategy trustStrategy) Sets theTrustStrategy
- Parameters:
trustStrategy
-TrustStrategy
-
getHttpClientResponseHandler
public org.apache.hc.core5.http.io.HttpClientResponseHandler<byte[]> getHttpClientResponseHandler()Returns theHttpClientResponseHandler
response handler- Returns:
HttpClientResponseHandler
-
setHttpClientResponseHandler
public void setHttpClientResponseHandler(org.apache.hc.core5.http.io.HttpClientResponseHandler<byte[]> httpClientResponseHandler) Sets theHttpClientResponseHandler<byte[]>
response handler performing a processing of an HTTP client response and returns a byte array in case of success.- Parameters:
httpClientResponseHandler
-HttpClientResponseHandler
-
get
Description copied from interface:DataLoader
Execute a HTTP GET operation.- Specified by:
get
in interfaceDataLoader
- Parameters:
urlString
- the url to access- Returns:
byte
array of obtained data or null
-
get
Description copied from interface:DataLoader
Execute a HTTP GET operation. This method is used when many URls are available to access the same resource. The operation stops after the first successful download.- Specified by:
get
in interfaceDataLoader
- Parameters:
urlStrings
-List
ofString
s representing the URLs to be used in sequential way to obtain the data.- Returns:
DataAndUrl
representing the array of obtained data and used url, or null
-
get
Deprecated.since 5.12. To be removed in DSS 5.13. Use#get(url)
for no cache, or an alternative DataLoader providing caching functionality.This method is useful only with the cache handling implementation of theDataLoader
.- Specified by:
get
in interfaceDataLoader
- Parameters:
url
- to accessrefresh
- if true indicates that the cached data should be refreshed- Returns:
byte
array of obtained data
-
ldapGet
This method retrieves data using LDAP protocol. - CRL from given LDAP url, e.g. ldap://ldap.infonotary.com/dc=identity-ca,dc=infonotary,dc=com - ex URL from AIA ldap://xadessrv.plugtests.net/CN=LevelBCAOK,OU=Plugtests_2015-2016,O=ETSI,C=FR?cACertificate;binary- Parameters:
urlString
-String
- Returns:
- byte array
-
ftpGet
This method retrieves data using FTP protocol .- Parameters:
urlString
-String
url to retrieve data from- Returns:
- byte array
-
fileGet
Gets the file content by its URL- Parameters:
urlString
-String
to the file- Returns:
- byte array of the file content
-
httpGet
This method retrieves data using HTTP or HTTPS protocol and 'get' method.- Parameters:
url
- to access- Returns:
byte
array of obtained data or null
-
post
Description copied from interface:DataLoader
Executes a HTTP POST operation- Specified by:
post
in interfaceDataLoader
- Parameters:
url
- to accesscontent
- the content to post- Returns:
byte
array of obtained data
-
getHttpResponse
@Deprecated protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse getHttpResponse(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) throws IOException Deprecated.since DSS 5.12. Seeexecute(CloseableHttpClient client, HttpUriRequest httpRequest)
ProcesseshttpRequest
and returns theCloseableHttpResponse
- Parameters:
client
-CloseableHttpClient
httpRequest
-HttpUriRequest
- Returns:
CloseableHttpResponse
- Throws:
IOException
- if an exception occurs
-
execute
protected byte[] execute(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) throws IOException ProcesseshttpRequest
and returns the byte array representing the response's content- Parameters:
client
-CloseableHttpClient
httpRequest
-HttpUriRequest
- Returns:
- byte array representing the response's content
- Throws:
IOException
- if an exception occurs
-
getHttpHost
protected org.apache.hc.core5.http.HttpHost getHttpHost(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) Gets theHttpHost
- Parameters:
httpRequest
-HttpUriRequest
- Returns:
HttpHost
-
getHttpContext
Deprecated.since DSS 5.12. UsegetHttpContext(httpHost)
method insteadGets theHttpContext
- Returns:
HttpContext
-
getHttpContext
protected org.apache.hc.core5.http.protocol.HttpContext getHttpContext(org.apache.hc.core5.http.HttpHost httpHost) Gets theHttpContext
- Parameters:
httpHost
-HttpHost
- Returns:
HttpContext
-
configurePreemptiveAuthentication
protected org.apache.hc.client5.http.protocol.HttpClientContext configurePreemptiveAuthentication(org.apache.hc.client5.http.protocol.HttpClientContext localContext, org.apache.hc.core5.http.HttpHost httpHost) This method is used to configure preemptive authentication process forHttpClientContext
, when required- Parameters:
localContext
-HttpClientContext
httpHost
-HttpHost
- Returns:
HttpClientContext
-
readHttpResponse
@Deprecated protected byte[] readHttpResponse(org.apache.hc.client5.http.impl.classic.CloseableHttpResponse httpResponse) throws IOException Deprecated.since DSS 5.12. UseCommonsHttpClientResponseHandler.handleResponse(CloseableHttpResponse httpResponse)
Reads the HTTP response- Parameters:
httpResponse
-CloseableHttpResponse
- Returns:
- the response's content
- Throws:
IOException
- if an exception occurs
-
getContent
@Deprecated protected byte[] getContent(org.apache.hc.core5.http.HttpEntity responseEntity) throws IOException Deprecated.since DSS 5.12. UseCommonsHttpClientResponseHandler.getContent(HttpEntity responseEntity)
Gets content of the response- Parameters:
responseEntity
-HttpEntity
- Returns:
- byte array
- Throws:
IOException
- if an exception occurs
-
closeQuietly
@Deprecated protected void closeQuietly(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpRequest, org.apache.hc.client5.http.impl.classic.CloseableHttpResponse httpResponse, org.apache.hc.client5.http.impl.classic.CloseableHttpClient client) Deprecated.since DSS 5.12. See#closeQuietly(HttpUriRequestBase httpRequest, CloseableHttpClient client)
Closes all the parameters quietly- Parameters:
httpRequest
-HttpUriRequestBase
httpResponse
-CloseableHttpResponse
client
-CloseableHttpClient
-
closeQuietly
protected void closeQuietly(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpRequest, org.apache.hc.client5.http.impl.classic.CloseableHttpClient client) Closes all the parameters quietly- Parameters:
httpRequest
-HttpUriRequestBase
client
-CloseableHttpClient
-
getSSLKeyStore
Gets the SSL KeyStore- Returns:
KeyStore
- Throws:
IOException
- if IOException occursGeneralSecurityException
- if GeneralSecurityException occurs
-
getSSLTrustStore
Gets the SSL Trusted KeyStore- Returns:
KeyStore
- Throws:
IOException
- if IOException occursGeneralSecurityException
- if GeneralSecurityException occurs
-
getHttpRequest
protected org.apache.hc.client5.http.classic.methods.HttpGet getHttpRequest(String url) throws URISyntaxException Gets the HTTP request- Parameters:
url
-String
request url- Returns:
HttpGet
- Throws:
URISyntaxException
- if an exception occurs
-
getHttpClientBuilder
protected org.apache.hc.client5.http.impl.classic.HttpClientBuilder getHttpClientBuilder(String url) Gets theHttpClientBuilder
for the url- Parameters:
url
-String
request url- Returns:
HttpClientBuilder
-
getHttpClient
Gets the HTTP client- Parameters:
url
-String
request url- Returns:
CloseableHttpClient
-
getCredentialsProvider
protected org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider getCredentialsProvider()Builds and returns aBasicCredentialsProvider
configured withauthenticationMap
- Returns:
BasicCredentialsProvider
-