org.xquark.xml.xdbc
Interface XMLDataSourceMetaData


public interface XMLDataSourceMetaData

This interface provides comprehensive information about the "data source". Since this interface accesses all sorts of data sources, the term data source is loosely applied. Information provided depend on driver vendors implementation.
An XMLDBCNotSupportedException will be thrown if a driver does not support a metadata method.


Nested Class Summary
static interface XMLDataSourceMetaData.Entry
          Inner interface of XMLDataSourceMetaData interface.
 
Method Summary
 java.util.Set getCapabilities()
          To get the set of capabilities of the data source.
 java.util.List getCollectionNames()
          Retrieves the name of all XML collections in this data source.
 XMLConnection getConnection()
          To get the XMLConnection object that produced this XMLDataSourceMetaData object.
 XMLDocument getMetaData()
          Retrieves the XML document describing the complete metadata of the data source.
 XMLDocument getPathSet(java.lang.String colName)
          Retrieves the XML document describing all existing paths in all documents of the specified XML collection.
 java.lang.Object getProperty(java.lang.String propertyId)
          Get the property with the specified name
 java.lang.String[] getPropertyList()
          Get the properties that describe this data source.
 XMLDocument getSchema(java.lang.String targetNamespace)
          Retrieves the XML document describing the XML schema for the given namespace.
 java.util.List getSchemaNamespaces()
          Retrieves the available schema namespaces in the data source.
 

Method Detail

getPropertyList

public java.lang.String[] getPropertyList()
Get the properties that describe this data source.

Valid properties are listed in the table.
The type "int" means the property value string is a valid integer.
The type "string" means the property value is a string.
The type "boolean" means the property value is "true" or "false".

PropertyDefinitionType
xmldbc.maxConnections Maximum active connections int
xmldbc.maxStatementLength Maximum length for a statement int
xmldbc.maxActiveStatements Maximum number of active statements int
xmldbc.maxResultSetLength Maximum length of a result set int
xmldbc.maxUserNameLength Maximum length of a user name int
xmldbc.dataSourceVersion Version number of the data source string
xmldbc.vendor.name Name of vendor of underlying source string
xmldbc.vendor.product Product name of vendor of underlying source string
xmldbc.vendor.version Version string of vendor of underlying source string
xmldbc.driver.version Version string of this XMLDBC driver string
xmldbc.driver.product Product name of this XMLDBC driver string
xmldbc.xpath Supports XPath boolean
xmldbc.xpath.version Version of XPath supported string
xmldbc.xquery Supports XQuery boolean
xmldbc.xquery.version Version of XQuery supported string
xmldbc.xquery.outerJoin Supports XQuery outer join boolean
xmldbc.twoPhaseCommit Supports two phase commit boolean
xmldbc.xquery.equality Supports equality operator in WHERE clause boolean
xmldbc.xquery.result Supports construction in RESULT clause boolean
xmldbc.xmlCollection Supports at least part of XMLCollection boolean
xmldbc.xmlCollection.id Supports methods that use XML ID String boolean
xmldbc.xmlCollection.iterator Supports iterator() method boolean
xmldbc.xquery.multiCollection An XQUERY expression may reference multiple XMLCollections boolean

For example, a data source that supports all of XQuery without restriction would define true for the xmldb.xquery property. This property implies all other xmldbc.xquery.* properties are supported. A data source that provided no query functionality at all and simply dumped its contents (e.g. an XML file), would not provide any properties at all. A data source may return other properties not listed. For developers, note that no set of capabilities can completely describe all data sources, so a particular data source may throw XMLDBCNotSupportedException in rare circumstances.

Returns:
the property set describing this data source

getProperty

public java.lang.Object getProperty(java.lang.String propertyId)
                             throws XMLDBCNotRecognizedException
Get the property with the specified name

Returns:
the value of the property
Throws:
XMLDBCNotRecognizedException - if the property is not known

getConnection

public XMLConnection getConnection()
                            throws XMLDBCException
To get the XMLConnection object that produced this XMLDataSourceMetaData object.

Returns:
the XMLConnection object that produced this object.
Throws:
XMLDBCException - if a data source access error occurs.

getCollectionNames

public java.util.List getCollectionNames()
                                  throws XMLDBCException,
                                         XMLDBCNotSupportedException
Retrieves the name of all XML collections in this data source.

Returns:
a list of all XML collection names as String objects.
Throws:
XMLDBCException - if a data source access error occurs.
XMLDBCNotSupportedException - if the data source does not support this operation (typically, when the data source is read-only)

getSchemaNamespaces

public java.util.List getSchemaNamespaces()
                                   throws XMLDBCException
Retrieves the available schema namespaces in the data source.

Returns:
the target namespaces of all schemas available in the data source in a list of String objects.
Throws:
XMLDBCException - if a data source access error occurs.

getPathSet

public XMLDocument getPathSet(java.lang.String colName)
                       throws XMLDBCException
Retrieves the XML document describing all existing paths in all documents of the specified XML collection.

Parameters:
colName - the name of the XML collection.
Returns:
an XML document containing the path set.
Throws:
XMLDBCException - if a data source access error occurs.

getSchema

public XMLDocument getSchema(java.lang.String targetNamespace)
                      throws XMLDBCException
Retrieves the XML document describing the XML schema for the given namespace.

Parameters:
targetNamespace - the target namespace of the schema.
Returns:
an XML document containing the XML schema.
Throws:
XMLDBCException - if a data source access error occurs.

getMetaData

public XMLDocument getMetaData()
                        throws XMLDBCException
Retrieves the XML document describing the complete metadata of the data source. This includes all available schemas and the path set of all available XML collections.

Returns:
an XML document containing the data source metadata.
Throws:
XMLDBCException - if a data source access error occurs.

getCapabilities

public java.util.Set getCapabilities()
To get the set of capabilities of the data source. Each element is a DataSourceMetaData.Entry object. The input is an XPath expression that requires a value in the WHERE clause. The output is an XPath expression describing the output. An empty set indicates no retrictions on the queries.



Copyright © 2004 Université de Versailles Saint-Quentin, XQuark Group. All rights reserved.