Class NativeHTTPDataLoaderCall
java.lang.Object
eu.europa.esig.dss.spi.client.http.NativeHTTPDataLoaderCall
- All Implemented Interfaces:
Callable<ResponseEnvelope>
The call of native java DataLoader using the java.net.URL class.
This class returns an instance of
eu.europa.esig.dss.model.http.HTTPResponse object.
Please set the variable includeHttpContent should you need an extended HTTP content data
(HTTP headers, SSL session parameters, etc.). If not set, only the response message body is to be returned.-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a GET call instantiationNativeHTTPDataLoaderCall(String url, byte[] content) Constructor for a POST call instantiation -
Method Summary
Modifier and TypeMethodDescriptioncall()protected URLConnectionCreates connectionvoidsetConnectTimeout(int connectTimeout) Sets a connection timeoutvoidsetIncludeResponseBody(boolean includeResponseBody) Sets whether the response message body is to be included in the final response object.voidsetIncludeResponseDetails(boolean includeResponseDetails) Sets whether additional HTTP response content is to be included in the final object (e.g.voidsetMaxInputSize(int maxInputSize) Sets the limit size of the HTTP response body.voidsetReadTimeout(int readTimeout) Sets a read timeoutvoidsetUseCaches(boolean useCaches) Sets whether the caches shall be used.
-
Constructor Details
-
NativeHTTPDataLoaderCall
-
NativeHTTPDataLoaderCall
-
-
Method Details
-
setUseCaches
public void setUseCaches(boolean useCaches) Sets whether the caches shall be used.- Parameters:
useCaches- whether the caches shall be used
-
setMaxInputSize
public void setMaxInputSize(int maxInputSize) Sets the limit size of the HTTP response body. If the HTTP response exceeds the given value, an exception will be thrown. For 0 or negative value, no limit will be exposed.- Parameters:
maxInputSize- limit size of the HTTP response body
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Sets a connection timeout- Parameters:
connectTimeout- timeout value in milliseconds
-
setReadTimeout
public void setReadTimeout(int readTimeout) Sets a read timeout- Parameters:
readTimeout- timeout value in milliseconds
-
setIncludeResponseBody
public void setIncludeResponseBody(boolean includeResponseBody) Sets whether the response message body is to be included in the final response object. Default : TRUE (the final ResponseEnvelope contains the response body)- Parameters:
includeResponseBody- whether the response message body is to be included in the final response object
-
setIncludeResponseDetails
public void setIncludeResponseDetails(boolean includeResponseDetails) Sets whether additional HTTP response content is to be included in the final object (e.g. TLS/SSL certificates, headers, etc.). Default : FALSE (the final ResponseEnvelope does not contain the request metadata and/or context)- Parameters:
includeResponseDetails- whether additional HTTP response content is to be included in the final object
-
call
- Specified by:
callin interfaceCallable<ResponseEnvelope>
-
createConnection
Creates connection- Returns:
URLConnection- Throws:
IOException- if IOException occurred
-