org.sixdml.query
Interface SixdmlQueryService

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

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, String 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.
 SixdmlQueryResultsMap executeQuery(String query, SixdmlCollection collection)
          Executes an XPath query against the specified collection.
 SixdmlQueryResultsMap executeQuery(String query, SixdmlCollection collection, String predicate)
          Executes an XPath query against the specified collection only returning results from documents that satisfy the given predicate.
 SixdmlXpathObject executeQuery(String query, SixdmlResource resource)
          Executes an XPath query against the specified collection.
 String 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(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(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,
                                String 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 String 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.

executeQuery

public SixdmlQueryResultsMap executeQuery(String query,
                                          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 SixdmlQueryResultsMap executeQuery(String query,
                                          SixdmlCollection collection,
                                          String predicate)
                                   throws InvalidQueryException,
                                          XMLDBException
Executes an XPath query against the specified collection only returning results from documents that satisfy the given predicate.
Parameters:
query - the XPath query.
collection - the collection to execute the query against.
predicate - an XPath query used to filter which documents the main query is run 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 SixdmlXpathObject executeQuery(String query,
                                      SixdmlResource resource)
                               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 SixdmlXpathObject.
Throws:
InvalidQueryException - if the query is not valid XPath.
XMLDBException - if a database error occurs
See Also:
SixdmlXpathObject