org.sixdml.query
Interface SixdmlQueryService

All Superinterfaces:
Configurable, Service
All Known Implementing Classes:
xlnSixdmlQueryService

public interface SixdmlQueryService
extends Service

 SixdmlQueryService.java
 
 This is a Service that enables the execution of XPath queries within the context of a 
 Collection or against the documents stored in the Collection.
 
 Created: Fri Jan 11 11:55:20 2002
 

Version:
1.0
Author:
Dare Obasanjo

Method Summary
 void addNamespaceMapping(String prefix, URI namespaceURI)
          Add a mapping between a given prefix and a namespace to the service's internal namespace map.
 void clearNamespaceMappings()
          Clear all namespace mappings in the service's internal namespace map.
 org.sixdml.query.SixdmlQueryResultsMap executeQuery(String query, org.sixdml.SixdmlCollection collection)
          Executes an XPath query against the specified collection.
 org.sixdml.query.SixdmlXpathObject executeQuery(String query, org.sixdml.SixdmlResource resource)
          Executes an XPath query against the specified collection.
 URI getNamespaceMapping(String prefix)
          Obtain the namespace URI mapped to a particular prefix.
 void removeNamespaceMapping(String prefix)
          Remove a mapping between a given prefix and a namespace to the service's internal namespace map.
 void setNamespaceMap(org.sixdml.SixdmlNamespaceMap nsMap)
          Set the SixdmlNamespaceMap used by this class to map prefixes to namespace URIs used in XPath queries.
 
Methods inherited from interface org.xmldb.api.base.Service
getName, getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Method Detail

setNamespaceMap

public void setNamespaceMap(org.sixdml.SixdmlNamespaceMap nsMap)
                     throws XMLDBException
Set the SixdmlNamespaceMap used by this class to map prefixes to namespace URIs used in XPath queries.

Parameters:
nsMap - the new namespace map to use.
Throws:
XMLDBException - if anything goes wrong.

addNamespaceMapping

public void addNamespaceMapping(String prefix,
                                URI namespaceURI)
                         throws XMLDBException
Add a mapping between a given prefix and a namespace to the service's internal namespace map.

Parameters:
prefix - key with which the specified namespace URI is associated.
namespaceURI - value to be associated with the specified prefix.
Throws:
XMLDBException - if anything goes wrong.

removeNamespaceMapping

public void removeNamespaceMapping(String prefix)
                            throws XMLDBException
Remove a mapping between a given prefix and a namespace to the service's internal namespace map.

Parameters:
prefix - key with which the specified namespace URI is associated.
Throws:
XMLDBException - if anything goes wrong.

clearNamespaceMappings

public void clearNamespaceMappings()
                            throws XMLDBException
Clear all namespace mappings in the service's internal namespace map.

Throws:
XMLDBException - if anything goes wrong.

getNamespaceMapping

public URI getNamespaceMapping(String prefix)
                        throws XMLDBException
Obtain the namespace URI mapped to a particular prefix.

Parameters:
prefix - the prefix whose namespace is being sought.
Returns:
the namespace URI mapped to the prefix or null if the map contains no mapping for this prefix.
XMLDBException

executeQuery

public org.sixdml.query.SixdmlQueryResultsMap executeQuery(String query,
                                                           org.sixdml.SixdmlCollection collection)
                                                    throws InvalidQueryException,
                                                           XMLDBException
Executes an XPath query against the specified collection.

Parameters:
query - the XPath query.
collection - the collection to execute the query against.
Returns:
the results of the query as a pairing of SixdmlResources and SixdmlXpathObjects.
Throws:
InvalidQueryException - if the query is not valid XPath.
XMLDBException - if a database error occurs
See Also:
SixdmlXpathObject

executeQuery

public org.sixdml.query.SixdmlXpathObject executeQuery(String query,
                                                       org.sixdml.SixdmlResource resource)
                                                throws InvalidQueryException,
                                                       XMLDBException
Executes an XPath query against the specified collection.

Parameters:
query - the XPath query.
Returns:
the results of the query as a SixdmlXpathObject.
Throws:
InvalidQueryException - if the query is not valid XPath.
XMLDBException - if a database error occurs
See Also:
SixdmlXpathObject