Class NativeHTTPDataLoaderCall

java.lang.Object
eu.europa.esig.dss.spi.client.http.NativeHTTPDataLoaderCall
All Implemented Interfaces:
Callable<ResponseEnvelope>

public class NativeHTTPDataLoaderCall extends Object implements 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 Details

    • NativeHTTPDataLoaderCall

      public NativeHTTPDataLoaderCall(String url)
      Constructor for a GET call instantiation
      Parameters:
      url - String
    • NativeHTTPDataLoaderCall

      public NativeHTTPDataLoaderCall(String url, byte[] content)
      Constructor for a POST call instantiation
      Parameters:
      url - String
      content - byte array
  • 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

      public ResponseEnvelope call()
      Specified by:
      call in interface Callable<ResponseEnvelope>
    • createConnection

      protected URLConnection createConnection() throws IOException
      Creates connection
      Returns:
      URLConnection
      Throws:
      IOException - if IOException occurred