uk.co.lakesidetech.springxmldb.spring
Class CachingXMLDBFacade

java.lang.Object
  extended byuk.co.lakesidetech.springxmldb.spring.SimpleXMLDBFacade
      extended byuk.co.lakesidetech.springxmldb.spring.CachingXMLDBFacade
All Implemented Interfaces:
IXMLDBFacade

public class CachingXMLDBFacade
extends SimpleXMLDBFacade
implements IXMLDBFacade

Implementation example of facade that uses results caching with source attribute wangy cache and oscache. This is an example of how caching of results can be used in the facade retrieval of content

Author:
Stuart Eccles

Constructor Summary
CachingXMLDBFacade()
           
 
Method Summary
 java.lang.String insertUpdateXMLDocument(java.lang.String xmlDocument, java.lang.String docID, java.lang.String collectionPath)
          insert or update a String xml document
 org.w3c.dom.Node queryResourceWithXPathCollectionAsString(java.lang.String resourceId, java.lang.String xPathQuery, java.lang.String collectionPath)
          (non-Javadoc)
 org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery, java.lang.String collectionPath)
          (non-Javadoc)
 org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery, java.lang.String collectionPath, int noResults)
          query a collection with xpath and limit the number of results obtained
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath)
          (non-Javadoc)
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, int noResults)
          query a collection with XQuery and limit to a number of results to return
 org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery, java.lang.String collectionPath, java.util.Map variables)
          (non-Javadoc)
 boolean removeDocument(java.lang.String docID, java.lang.String collectionPath)
          remove a document from the xml database
 org.xmldb.api.base.Resource retrieveDocumentAsResource(java.lang.String docID, java.lang.String collectionPath)
          (non-Javadoc)
 java.lang.String retrieveDocumentAsString(java.lang.String docID, java.lang.String collectionPath)
          (non-Javadoc)
 void setManageDao(IResourceManageXMLDBDao manageDao)
           
 void setXpathDao(IXPathXMLDBDao xpathDao)
           
 void setXqueryDao(IXQueryXMLDBDao xqueryDao)
           
 
Methods inherited from class uk.co.lakesidetech.springxmldb.spring.SimpleXMLDBFacade
addXMLDocsToNode, convertResultMapToXML, produceLimitedMap, queryWithXQueryCollectionAsString, setXupdateDao, xupdateCollection, xupdateXMLDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.lakesidetech.springxmldb.spring.IXMLDBFacade
queryWithXQueryCollectionAsString, xupdateCollection, xupdateXMLDocument
 

Constructor Detail

CachingXMLDBFacade

public CachingXMLDBFacade()
Method Detail

setManageDao

public void setManageDao(IResourceManageXMLDBDao manageDao)
Overrides:
setManageDao in class SimpleXMLDBFacade
Parameters:
manageDao - The manageDao to set.

setXpathDao

public void setXpathDao(IXPathXMLDBDao xpathDao)
Overrides:
setXpathDao in class SimpleXMLDBFacade
Parameters:
xpathDao - The xpathDao to set.

setXqueryDao

public void setXqueryDao(IXQueryXMLDBDao xqueryDao)
Overrides:
setXqueryDao in class SimpleXMLDBFacade
Parameters:
xqueryDao - The xqueryDao to set.

insertUpdateXMLDocument

public java.lang.String insertUpdateXMLDocument(java.lang.String xmlDocument,
                                                java.lang.String docID,
                                                java.lang.String collectionPath)
Description copied from interface: IXMLDBFacade
insert or update a String xml document

Specified by:
insertUpdateXMLDocument in interface IXMLDBFacade
Overrides:
insertUpdateXMLDocument in class SimpleXMLDBFacade
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#insertUpdateXMLDocument(java.lang.String, java.lang.String, java.lang.String)

removeDocument

public boolean removeDocument(java.lang.String docID,
                              java.lang.String collectionPath)
Description copied from interface: IXMLDBFacade
remove a document from the xml database

Specified by:
removeDocument in interface IXMLDBFacade
Overrides:
removeDocument in class SimpleXMLDBFacade
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#insertUpdateXMLDocument(java.lang.String, java.lang.String, java.lang.String)

retrieveDocumentAsString

public java.lang.String retrieveDocumentAsString(java.lang.String docID,
                                                 java.lang.String collectionPath)
(non-Javadoc)

Specified by:
retrieveDocumentAsString in interface IXMLDBFacade
Overrides:
retrieveDocumentAsString in class SimpleXMLDBFacade
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#retrieveDocumentRaw(java.lang.String, java.lang.String)

retrieveDocumentAsResource

public org.xmldb.api.base.Resource retrieveDocumentAsResource(java.lang.String docID,
                                                              java.lang.String collectionPath)
(non-Javadoc)

Specified by:
retrieveDocumentAsResource in interface IXMLDBFacade
Overrides:
retrieveDocumentAsResource in class SimpleXMLDBFacade
See Also:
IXMLDBFacade.retrieveDocumentAsResource(java.lang.String, java.lang.String)

queryWithXPathCollectionAsString

public org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery,
                                                         java.lang.String collectionPath)
                                                  throws XMLDBDataAccessException,
                                                         XMLParsingException
(non-Javadoc)

Specified by:
queryWithXPathCollectionAsString in interface IXMLDBFacade
Overrides:
queryWithXPathCollectionAsString in class SimpleXMLDBFacade
Throws:
XMLParsingException
XMLDBDataAccessException
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#queryWithXPathCollectionRaw(java.lang.String, java.lang.String)

queryResourceWithXPathCollectionAsString

public org.w3c.dom.Node queryResourceWithXPathCollectionAsString(java.lang.String resourceId,
                                                                 java.lang.String xPathQuery,
                                                                 java.lang.String collectionPath)
                                                          throws XMLDBDataAccessException,
                                                                 XMLParsingException
(non-Javadoc)

Specified by:
queryResourceWithXPathCollectionAsString in interface IXMLDBFacade
Overrides:
queryResourceWithXPathCollectionAsString in class SimpleXMLDBFacade
Throws:
XMLParsingException
XMLDBDataAccessException
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#queryResourceWithXPathCollectionRaw(java.lang.String, java.lang.String, java.lang.String)

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath)
                                                   throws XMLDBDataAccessException,
                                                          XMLParsingException
(non-Javadoc)

Specified by:
queryWithXQueryCollectionAsString in interface IXMLDBFacade
Overrides:
queryWithXQueryCollectionAsString in class SimpleXMLDBFacade
Throws:
XMLParsingException
XMLDBDataAccessException
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#queryWithXQueryCollectionRaw(java.lang.String, java.lang.String)

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath,
                                                          java.util.Map variables)
                                                   throws XMLDBDataAccessException,
                                                          XMLParsingException
(non-Javadoc)

Specified by:
queryWithXQueryCollectionAsString in interface IXMLDBFacade
Overrides:
queryWithXQueryCollectionAsString in class SimpleXMLDBFacade
Throws:
XMLParsingException
XMLDBDataAccessException
See Also:
uk.co.lakesidetech.springxmldb.spring.ISimpleXMLDBFacade#queryWithXQueryCollectionRaw(java.lang.String, java.lang.String, java.util.Map)

queryWithXPathCollectionAsString

public org.w3c.dom.Node queryWithXPathCollectionAsString(java.lang.String xPathQuery,
                                                         java.lang.String collectionPath,
                                                         int noResults)
                                                  throws XMLParsingException
Description copied from interface: IXMLDBFacade
query a collection with xpath and limit the number of results obtained

Specified by:
queryWithXPathCollectionAsString in interface IXMLDBFacade
Overrides:
queryWithXPathCollectionAsString in class SimpleXMLDBFacade
Parameters:
xPathQuery -
collectionPath -
noResults -
Returns:
Throws:
XMLParsingException
See Also:
IXMLDBFacade.queryWithXPathCollectionAsString(java.lang.String, java.lang.String, int)

queryWithXQueryCollectionAsString

public org.w3c.dom.Node queryWithXQueryCollectionAsString(java.lang.String xQuery,
                                                          java.lang.String collectionPath,
                                                          int noResults)
                                                   throws XMLParsingException
Description copied from interface: IXMLDBFacade
query a collection with XQuery and limit to a number of results to return

Specified by:
queryWithXQueryCollectionAsString in interface IXMLDBFacade
Overrides:
queryWithXQueryCollectionAsString in class SimpleXMLDBFacade
Parameters:
xQuery -
collectionPath -
noResults -
Returns:
Throws:
XMLParsingException
See Also:
IXMLDBFacade.queryWithXQueryCollectionAsString(java.lang.String, java.lang.String, int)