org.sixdml.xindice
Class xiSixdmlQueryService

java.lang.Object
  |
  +--org.sixdml.xindice.xiServiceBase
        |
        +--org.sixdml.xindice.xiNamespaceAwareService
              |
              +--org.sixdml.xindice.xiSixdmlQueryService
All Implemented Interfaces:
Configurable, Service, SixdmlConstants, SixdmlQueryService

class xiSixdmlQueryService
extends xiNamespaceAwareService
implements SixdmlQueryService, SixdmlConstants

 xiSixdmlQueryService.java

 An implementation of the SixdmlQueryService interface which enables the execution of 
 XPath queries within the context of a collection or against the documents stored in the Collection.
 

Version:
1.0

Fields inherited from class org.sixdml.xindice.xiNamespaceAwareService
namespaceMap
 
Fields inherited from class org.sixdml.xindice.xiServiceBase
collection, properties
 
Fields inherited from interface org.sixdml.SixdmlConstants
SIXDML_NS, SIXDML_VERSION
 
Constructor Summary
(package private) xiSixdmlQueryService()
          Default constructor initializes service.
 
Method Summary
 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 getName()
          Gets the name of the service.
static void main(String[] args)
          Main used for testing class.
 
Methods inherited from class org.sixdml.xindice.xiNamespaceAwareService
addNamespaceMapping, clearNamespaceMappings, getNamespaceMapping, getNamespaceNode, removeNamespaceMapping, setNamespaceMap
 
Methods inherited from class org.sixdml.xindice.xiServiceBase
getProperty, getVersion, setCollection, setProperty
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface org.sixdml.query.SixdmlQueryService
addNamespaceMapping, clearNamespaceMappings, getNamespaceMapping, removeNamespaceMapping, setNamespaceMap
 
Methods inherited from interface org.xmldb.api.base.Service
getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Constructor Detail

xiSixdmlQueryService

xiSixdmlQueryService()
Default constructor initializes service.
Method Detail

getName

public String getName()
Gets the name of the service.
Specified by:
getName in interface Service
Overrides:
getName in class xiServiceBase
Returns:
the name of the service.

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.
Specified by:
executeQuery in interface SixdmlQueryService
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 SixdmlQueryResultsMap executeQuery(String query,
                                          SixdmlCollection collection)
                                   throws InvalidQueryException,
                                          XMLDBException
Executes an XPath query against the specified collection.
Specified by:
executeQuery in interface SixdmlQueryService
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 SixdmlXpathObject executeQuery(String query,
                                      SixdmlResource resource)
                               throws InvalidQueryException,
                                      XMLDBException
Executes an XPath query against the specified collection.
Specified by:
executeQuery in interface SixdmlQueryService
Parameters:
query - the XPath query.
collection - the collection to execute the query against.
Returns:
the results of the query as a SixdmlXpathObject.
Throws:
XMLDBException - if a database error occurs
InvalidQueryException - if the query is not valid XPath.

main

public static void main(String[] args)
                 throws Exception
Main used for testing class.
Parameters:
args - IGNORED