All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.solr.handler.dataimport.DataSource Maven / Gradle / Ivy

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.solr.handler.dataimport;

import java.util.Properties;

/**
 * 

* Provides data from a source with a given query. *

*

*

* Implementation of this abstract class must provide a default no-arg constructor *

*

*

* Refer to http://wiki.apache.org/solr/DataImportHandler * for more details. *

*

* This API is experimental and may change in the future. * * @version $Id: DataSource.java 684025 2008-08-08 17:50:11Z shalin $ * @since solr 1.3 */ public abstract class DataSource { /** * Initializes the DataSource with the Context and * initialization properties. *

* This is invoked by the DataImporter after creating an * instance of this class. * * @param context * @param initProps */ public abstract void init(Context context, Properties initProps); /** * Get records for the given query.The return type depends on the * implementation . * * @param 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. * @return Depends on the implementation. For instance JdbcDataSource returns * an Iterator> */ public abstract T getData(String query); /** * Cleans up resources of this DataSource after use. */ public abstract void close(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy