Package com.day.cq.polling.importer
Class HttpImporter
- java.lang.Object
-
- com.day.cq.polling.importer.HttpImporter
-
- All Implemented Interfaces:
Importer
@Service(Importer.class) @Properties(@Property(name="service.description",value="Abstract HTTP based Importer")) @Deprecated public abstract class HttpImporter extends java.lang.Object implements Importer
Deprecated.Please useHCImporter
instead.TheHttpImporter
is an abstract implementation of theImporter
service interface supporting access to data using the HTTP protocol.Extensions of this base class must implement the
importData(String, InputStream, String, Resource)
method to actuall import the retrieved data.Instanes of this base class must be initialized before being used and be destroyed when not used any more. If the extesion is registered as an Declarative Services Component, this initialization and destroyal is being taken care of. Otherwise, the extension class must explicitly call the
init()
anddestroy()
methods respectively.The
activate(ComponentContext)
anddeactivate(ComponentContext)
methods may be overwritten by extension classes but the base class implementation must called in this case to ensure proper initialization and destroyal.
-
-
Field Summary
-
Fields inherited from interface com.day.cq.polling.importer.Importer
SCHEME_PROPERTY, SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description HttpImporter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
importData(java.lang.String scheme, java.lang.String dataSource, Resource target)
Deprecated.Imports data from the givensource
which is expected to be an HTTP URL.void
importData(java.lang.String scheme, java.lang.String dataSource, Resource target, java.lang.String login, java.lang.String password)
Deprecated.Imports data from the givensource
which is expected to be an HTTP URL.
-
-
-
Method Detail
-
importData
public void importData(java.lang.String scheme, java.lang.String dataSource, Resource target)
Deprecated.Imports data from the givensource
which is expected to be an HTTP URL. This method uses the Apache Commons Http Client library to request the source with a method provided bynewHttpMethod(String)
the response stream is then provided to theimportData(String, InputStream, String, Resource)
method, which must be implemented by the extension.- Specified by:
importData
in interfaceImporter
- Parameters:
scheme
- The scheme of the data source. This parameter is handed over to theimportData(String, InputStream, String, Resource)
method.dataSource
- The HTTP URL to the data to be imported.target
- TheResource
into which the data is to be imported.- Throws:
ImportException
- If an error occurrs while accessing the source or if this class has not beenn initialized or if an error occurs while importing the actual data throughimportData(String, InputStream, String, Resource)
.
-
importData
public void importData(java.lang.String scheme, java.lang.String dataSource, Resource target, java.lang.String login, java.lang.String password)
Deprecated.Imports data from the givensource
which is expected to be an HTTP URL. This method uses the Apache Commons Http Client library to request the source with a method provided bynewHttpMethod(String)
the response stream is then provided to theimportData(String, InputStream, String, Resource)
method, which must be implemented by the extension.- Specified by:
importData
in interfaceImporter
- Parameters:
scheme
- The scheme of the data source. This parameter is handed over to theimportData(String, InputStream, String, Resource)
method.dataSource
- The HTTP URL to the data to be imported.target
- TheResource
into which the data is to be imported.login
- The login to authenticate the request.password
- The password to authenticate the request.- Throws:
ImportException
- If an error occurrs while accessing the source or if this class has not beenn initialized or if an error occurs while importing the actual data throughimportData(String, InputStream, String, Resource)
.
-
-