Class GenericHttpConnector

java.lang.Object
se.swedenconnect.sigval.cert.validity.http.GenericHttpConnector
Direct Known Subclasses:
DefaultRevocationDataConnector

public class GenericHttpConnector extends Object
Generic implementation of HTTP GET and POST to support download of revocation data
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • GenericHttpConnector

      public GenericHttpConnector()
  • Method Details

    • getResource

      public HttpResponse getResource(URL requestUrl, int connectTimeout, int readTimeout)
      Get resource from URL using HTTP GET
      Parameters:
      requestUrl - url for the resource
      connectTimeout - milliseconds allowed to establish an HTTP connection with the resource
      readTimeout - milliseconds allowed to download the resource data
      Returns:
      response data
    • getResource

      public HttpResponse getResource(URL requestUrl, int connectTimeout, int readTimeout, byte[] data, Map<String,String> propertyMap)
      Get resrouce from URL using either GET or POST. POST is automatically selected if some data to be posted is included as an argument
      Parameters:
      requestUrl - url for the resource
      connectTimeout - milliseconds allowed to establish an HTTP connection with the resource
      readTimeout - milliseconds allowed to download the resource data
      data - data to be posted or null to select HTTP GET
      propertyMap - map of HTTP connect properties to add to the HTTP connection. The map key is the property name and the map value is the property value
      Returns:
      response data