Interface Importer

    • Field Summary

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void importData​(java.lang.String scheme, java.lang.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​(java.lang.String scheme, java.lang.String dataSource, Resource target, java.lang.String login, java.lang.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 Detail

      • SERVICE_NAME

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

        static final java.lang.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:
        Constant Field Values
    • Method Detail

      • importData

        void importData​(java.lang.String scheme,
                        java.lang.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​(java.lang.String scheme,
                        java.lang.String dataSource,
                        Resource target,
                        java.lang.String login,
                        java.lang.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.