| Version 25 (modified by Leo Sauermann <leo.sauermann@…>, 20 years ago) (diff) |
|---|
ApertureDataSource
Java Interface
Probably equal to source:trunk/gnowsis/src/org/gnowsis/data/datasource/DataSource.java
Changelog:
- removed setConfigAttribute and writeConfigAttributes: the choice to store DataSource configuration and the way to do that is probably an application decision. This functionality should be moved to a utility class.
/**
* A DataSource defines the characteristics of a source from which DataObjects
* can be extracted. A Datasource contains all information necessary to realize
* these objects, such as paths, usernames, passwords, etc.
*/
public interface DataSource {
/**
* get the configuration of this datasource.
* @return the configuration
*/
public Map getConfiguration();
/**
* Initialize the datasource using the passed configuration map.
* each parameter relevant to the datasource (data path, passwords, usernames, timeouts, rules, etc) is passed
* this method must only be called once.
* TODO: should it check the configuration (passwords allright, etc) now or when the crawler starts?
* @throws InitializationException when the configuration contains syntactically wrong parameters
* or does not function correctly. The InitializationException should contain a user-friendly
* message that explains why this datasource does not work. If a password is wrong, the exception
* should say so.
*/
public void initConfiguration(Map configuration) throws InitializationException;
/**
* Gets the id of this data source.
* The Aduna Interface identifies DataSources by ID and Name.
* Gnowsis uses Uris. This ID SHOULD conform to the URI scheme norm!
* TODO: should it be a URI or not? for future's sake: yes!
* @return A URI identifier for the data source.
*/
public String getID();
/**
* Set the ID of this data source.
*
* @param id the new ID
*/
public void setID(String id);
/**
* Gets the name of this data source.
*
* @return A descriptive name for the data source.
*/
public String getName();
/**
* Sets the name of this data source.
*
* @param name A descriptive name for the data source.
*/
public void setName(String name);
}
