wiki:ApertureDataSource

Version 17 (modified by dburkhar, 19 years ago) (diff)

--

DataSource

Java Interface

Probably equal to source:trunk/gnowsis/src/org/gnowsis/data/datasource/DataSource.java

 /**
  * 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 {

	/**
	 * Gets the id of this data source.
	 * 
	 * @return A 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);

	/**
	 * Set a configuration attribute supported by the specific datasource
	 * implementation class. Unknown elements and incorrectly encoded attributes
         * end element text are silently ignored.
         * 
         * @param attributeName The XML element name used to identify the configuration attribute.
         * @param atts The element's attributes, encoded as a Map of key-value-pairs.
         * @param text the element's textual contents. 
	 */
	public void setConfigAttribute(String attributeName, Map<String, String> atts, String text);

	/**
	 * Writes all config attributes of the datasource to a given XML writer.
         * 
         * @param xmlWriter the XMLWriter to which the config attributes will be written.
         * @throws IOException passed on by the XMLWriter.
	 */
	public void writeConfigAttributes(XmlWriter xmlWriter) throws IOException;
}