Interface Importer

All Known Implementing Classes:
HCImporter, HttpImporter

public interface Importer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the service property defining the scheme supported by the importer (value is "importer.scheme").
    static final String
    Service name under which Importer services are to be registered (value is "com.day.cq.polling.importer.Importer").
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    importData(String scheme, String dataSource, Resource target)
    This method is called to poll for data to be imported at the given called dataSource location and to import the result into the target Resource.
    void
    importData(String scheme, String dataSource, Resource target, String login, String password)
    This method is called to poll for data to be imported at the given called dataSource location and to import the result into the target Resource.
  • Field Details

    • SERVICE_NAME

      static final String SERVICE_NAME
      Service name under which Importer services are to be registered (value is "com.day.cq.polling.importer.Importer").
      See Also:
    • SCHEME_PROPERTY

      static final String SCHEME_PROPERTY
      The name of the service property defining the scheme supported by the importer (value is "importer.scheme").

      This service property may a single string value or an array or collection of String values. The service is registered for all schemes provided by this property.

      If this service property is missing, empty or not one of the listed types, the service cannot be used and is therefore ignored.

      See Also:
  • Method Details

    • importData

      void importData(String scheme, String dataSource, Resource target) throws ImportException
      This method is called to poll for data to be imported at the given called dataSource location and to import the result into the target Resource.
      Parameters:
      scheme - The actual scheme of the data source. If an Importer is registered for multiple schemes, this scheme may for example be used to decide on which data represenation can be expected. This value is one of the schemes with which the Importer service has been configured in the importer.scheme service property.
      dataSource - The scheme specific string (generally an URI) describing the location at which the data is to be polled. The format of this string is specific to the actual scheme used. For example, this may be a plain HTTP URL of the form http://host/some/data.xml.
      target - The target resource into which the data has to be imported
      Throws:
      ImportException - may be thrown in case of problems accessing, transferring or actually importing the data. If the failure is caused by an exception, this exception ( Throwable) should be made available as the cause of this exception.
    • importData

      void importData(String scheme, String dataSource, Resource target, String login, String password) throws ImportException
      This method is called to poll for data to be imported at the given called dataSource location and to import the result into the target Resource.
      Parameters:
      scheme - The actual scheme of the data source. If an Importer is registered for multiple schemes, this scheme may for example be used to decide on which data represenation can be expected. This value is one of the schemes with which the Importer service has been configured in the importer.scheme service property.
      dataSource - The scheme specific string (generally an URI) describing the location at which the data is to be polled. The format of this string is specific to the actual scheme used. For example, this may be a plain HTTP URL of the form http://host/some/data.xml.
      target - The target resource into which the data has to be imported
      login - The login for basic authentication.
      password - The password for basic authentication.
      Throws:
      ImportException - may be thrown in case of problems accessing, transferring or actually importing the data. If the failure is caused by an exception, this exception ( Throwable) should be made available as the cause of this exception.