org.exist.xmldb
Class LocalXPathQueryService

java.lang.Object
  extended byorg.exist.xmldb.LocalXPathQueryService
All Implemented Interfaces:
Configurable, Service, XPathQueryService, XPathQueryServiceImpl

public class LocalXPathQueryService
extends java.lang.Object
implements XPathQueryServiceImpl


Field Summary
protected  BrokerPool brokerPool
           
protected  LocalCollection collection
           
protected  java.util.Map properties
           
protected  User user
           
 
Constructor Summary
LocalXPathQueryService(User user, BrokerPool pool, LocalCollection collection)
           
 
Method Summary
 void clearNamespaces()
          Removes all namespace mappings stored in the internal namespace map.
protected  ResourceSet doQuery(java.lang.String query, DocumentSet docs, NodeSet context, java.lang.String sortExpr)
           
 java.lang.String getName()
          Returns the name associated with the Service instance.
 java.lang.String getNamespace(java.lang.String prefix)
          Returns the URI string associated with prefix from the internal namespace map.
 java.lang.String getProperty(java.lang.String property)
          Returns the value of the property identified by name.
 java.lang.String getVersion()
          Gets the Version attribute of the Service object
 ResourceSet query(java.lang.String query)
          Run an XPath query against the Collection.
 ResourceSet query(java.lang.String query, java.lang.String sortBy)
           
 ResourceSet query(XMLResource res, java.lang.String query)
          Process an XPath query based on the result of a previous query.
 ResourceSet query(XMLResource res, java.lang.String query, java.lang.String sortBy)
           
 ResourceSet queryResource(java.lang.String resource, java.lang.String query)
          Description of the Method
 void removeNamespace(java.lang.String ns)
          Description of the Method
 void setCollection(Collection col)
          Sets the collection attribute of the LocalXPathQueryService object
 void setNamespace(java.lang.String prefix, java.lang.String namespace)
          Sets the namespace attribute of the LocalXPathQueryService object
 void setProperty(java.lang.String property, java.lang.String value)
          Sets the property attribute of the LocalXPathQueryService object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Map properties

brokerPool

protected BrokerPool brokerPool

collection

protected LocalCollection collection

user

protected User user
Constructor Detail

LocalXPathQueryService

public LocalXPathQueryService(User user,
                              BrokerPool pool,
                              LocalCollection collection)
Method Detail

clearNamespaces

public void clearNamespaces()
                     throws XMLDBException
Description copied from interface: XPathQueryService
Removes all namespace mappings stored in the internal namespace map.

Specified by:
clearNamespaces in interface XPathQueryService
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getName

public java.lang.String getName()
                         throws XMLDBException
Description copied from interface: Service
Returns the name associated with the Service instance.

Specified by:
getName in interface Service
Returns:
the name of the object.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getNamespace

public java.lang.String getNamespace(java.lang.String prefix)
                              throws XMLDBException
Description copied from interface: XPathQueryService
Returns the URI string associated with prefix from the internal namespace map. If prefix is null or empty the URI for the default namespace will be returned. If a mapping for the prefix can not be found null is returned.

Specified by:
getNamespace in interface XPathQueryService
Parameters:
prefix - The prefix to retrieve from the namespace map.
Returns:
The URI associated with prefix
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getProperty

public java.lang.String getProperty(java.lang.String property)
                             throws XMLDBException
Description copied from interface: Configurable
Returns the value of the property identified by name.

Specified by:
getProperty in interface Configurable
Parameters:
property - the name of the property to retrieve.
Returns:
the property value or null if no property exists.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

getVersion

public java.lang.String getVersion()
                            throws XMLDBException
Description copied from interface: Service
Gets the Version attribute of the Service object

Specified by:
getVersion in interface Service
Returns:
The Version value
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

query

public ResourceSet query(java.lang.String query)
                  throws XMLDBException
Description copied from interface: XPathQueryService
Run an XPath query against the Collection. The XPath will be applied to all XML resources stored in the Collection. The result is a ResourceSet containing the results of the query. Any namespaces used in the query string will be evaluated using the mappings setup using setNamespace.

Specified by:
query in interface XPathQueryService
Parameters:
query - The XPath query string to use.
Returns:
A ResourceSet containing the results of the query.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

query

public ResourceSet query(XMLResource res,
                         java.lang.String query)
                  throws XMLDBException
Description copied from interface: XPathQueryServiceImpl
Process an XPath query based on the result of a previous query. The XMLResource contains the result received from a previous query.

Specified by:
query in interface XPathQueryServiceImpl
Throws:
XMLDBException

query

public ResourceSet query(java.lang.String query,
                         java.lang.String sortBy)
                  throws XMLDBException
Specified by:
query in interface XPathQueryServiceImpl
Throws:
XMLDBException

query

public ResourceSet query(XMLResource res,
                         java.lang.String query,
                         java.lang.String sortBy)
                  throws XMLDBException
Specified by:
query in interface XPathQueryServiceImpl
Throws:
XMLDBException

doQuery

protected ResourceSet doQuery(java.lang.String query,
                              DocumentSet docs,
                              NodeSet context,
                              java.lang.String sortExpr)
                       throws XMLDBException
Throws:
XMLDBException

queryResource

public ResourceSet queryResource(java.lang.String resource,
                                 java.lang.String query)
                          throws XMLDBException
Description of the Method

Specified by:
queryResource in interface XPathQueryService
Parameters:
resource - Description of the Parameter
query - Description of the Parameter
Returns:
Description of the Return Value
Throws:
XMLDBException - Description of the Exception

removeNamespace

public void removeNamespace(java.lang.String ns)
                     throws XMLDBException
Description of the Method

Specified by:
removeNamespace in interface XPathQueryService
Parameters:
ns - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

setCollection

public void setCollection(Collection col)
                   throws XMLDBException
Sets the collection attribute of the LocalXPathQueryService object

Specified by:
setCollection in interface Service
Parameters:
col - The new collection value
Throws:
XMLDBException - Description of the Exception

setNamespace

public void setNamespace(java.lang.String prefix,
                         java.lang.String namespace)
                  throws XMLDBException
Sets the namespace attribute of the LocalXPathQueryService object

Specified by:
setNamespace in interface XPathQueryService
Parameters:
prefix - The new namespace value
namespace - The new namespace value
Throws:
XMLDBException - Description of the Exception

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
                 throws XMLDBException
Sets the property attribute of the LocalXPathQueryService object

Specified by:
setProperty in interface Configurable
Parameters:
property - The new property value
value - The new property value
Throws:
XMLDBException - Description of the Exception


Copyright (C) Wolfgang Meier. All rights reserved.