wiki:ApertureDataSource

Version 20 (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 {
 

        /**
         * Method added from Gnowsis
         *
         *
         *
         * get the configuration of this datasource.
         * The configuration is always passed to the constructor.
         * @return the configuration
         */
        public DataSourceConfig getDSConfig();
 
        /**
         * Method added from Gnowsis
         *
         * The Aduna Interface identifies DataSources by ID and Name.
         * Gnowsis uses Uris 
         *
         * return the uri identifying this datasource inside gnowsis.
         * The uri is usually the uri of the resource in the DSConfig.
         * The uri is unique inside one gnowsis installation.
         * @return the uri of this datasource
         */
         public String getUri();

        /**
         * 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;
}