Interface DataLoader

All Superinterfaces:
Serializable
All Known Implementing Classes:
IgnoreDataLoader, MemoryDataLoader, NativeHTTPDataLoader

public interface DataLoader
extends Serializable
Component that allows to retrieve the data using any protocol: HTTP, HTTPS, FTP, LDAP.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  DataLoader.DataAndUrl
    This is an internal class used to model the couple data and url used to obtain this data.
  • Method Summary

    Modifier and Type Method Description
    byte[] get​(String url)
    Execute a HTTP GET operation.
    byte[] get​(String url, boolean refresh)
    Execute a HTTP GET operation with indication concerning the mandatory nature of the operation.
    DataLoader.DataAndUrl get​(List<String> urlStrings)
    Execute a HTTP GET operation.
    byte[] post​(String url, byte[] content)
    Executes a HTTP POST operation
    void setContentType​(String contentType)
    This allows to set the content type.
  • Method Details

    • get

      byte[] get​(String url) throws DSSException
      Execute a HTTP GET operation.
      Parameters:
      url - the url to access
      Returns:
      byte array of obtained data or null
      Throws:
      DSSException - in case of DataLoader error
    • get

      DataLoader.DataAndUrl get​(List<String> urlStrings) throws DSSException
      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.
      Parameters:
      urlStrings - List of Strings 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
      Throws:
      DSSException - in case of DataLoader error
    • get

      byte[] get​(String url, boolean refresh) throws DSSException
      Execute a HTTP GET operation with indication concerning the mandatory nature of the operation.
      Parameters:
      url - to access
      refresh - if true indicates that the cached data should be refreshed
      Returns:
      byte array of obtained data or null
      Throws:
      DSSException - in case of DataLoader error
    • post

      byte[] post​(String url, byte[] content) throws DSSException
      Executes a HTTP POST operation
      Parameters:
      url - to access
      content - the content to post
      Returns:
      byte array of obtained data
      Throws:
      DSSException - in case of DataLoader error
    • setContentType

      void setContentType​(String contentType)
      This allows to set the content type. Example: Content-Type "application/ocsp-request"
      Parameters:
      contentType - to set the Content-Type