Class URLDataSource
- java.lang.Object
-
- org.apache.solr.handler.dataimport.DataSource<Reader>
-
- org.apache.solr.handler.dataimport.URLDataSource
-
public class URLDataSource extends DataSource<Reader>
A data source implementation which can be used to read character files using HTTP.
Refer to http://wiki.apache.org/solr/DataImportHandler for more details.
This API is experimental and may change in the future.
- Since:
- solr 1.4
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASE_URLstatic intCONNECTION_TIMEOUTstatic StringCONNECTION_TIMEOUT_FIELD_NAMEstatic StringENCODINGstatic intREAD_TIMEOUTstatic StringREAD_TIMEOUT_FIELD_NAMEstatic StringUTF_8
-
Constructor Summary
Constructors Constructor Description URLDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Cleans up resources of this DataSource after use.StringgetBaseUrl()ReadergetData(String query)Get records for the given query.The return type depends on the implementation .voidinit(Context context, Properties initProps)Initializes the DataSource with theContextand initialization properties.
-
-
-
Field Detail
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
BASE_URL
public static final String BASE_URL
- See Also:
- Constant Field Values
-
UTF_8
public static final String UTF_8
-
CONNECTION_TIMEOUT_FIELD_NAME
public static final String CONNECTION_TIMEOUT_FIELD_NAME
- See Also:
- Constant Field Values
-
READ_TIMEOUT_FIELD_NAME
public static final String READ_TIMEOUT_FIELD_NAME
- See Also:
- Constant Field Values
-
CONNECTION_TIMEOUT
public static final int CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
-
READ_TIMEOUT
public static final int READ_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(Context context, Properties initProps)
Description copied from class:DataSourceInitializes the DataSource with theContextand initialization properties.This is invoked by the
DataImporterafter creating an instance of this class.- Specified by:
initin classDataSource<Reader>
-
getData
public Reader getData(String query)
Description copied from class:DataSourceGet records for the given query.The return type depends on the implementation .- Specified by:
getDatain classDataSource<Reader>- Parameters:
query- The query string. It can be a SQL for JdbcDataSource or a URL for HttpDataSource or a file location for FileDataSource or a custom format for your own custom DataSource.- Returns:
- Depends on the implementation. For instance JdbcDataSource returns an Iterator<Map <String,Object>>
-
close
public void close()
Description copied from class:DataSourceCleans up resources of this DataSource after use.- Specified by:
closein classDataSource<Reader>
-
getBaseUrl
public String getBaseUrl()
-
-