uk.co.lakesidetech.springxmldb.dao
Class BaseCollectionManageXMLDBDao

java.lang.Object
  extended byuk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
      extended byuk.co.lakesidetech.springxmldb.dao.BaseCollectionManageXMLDBDao
All Implemented Interfaces:
ICollectionManageXMLDBDao
Direct Known Subclasses:
ExistCollectionManageXMLDBDao, XindiceCollectionManageXMLDBDao

public class BaseCollectionManageXMLDBDao
extends AbstractXMLDBDao
implements ICollectionManageXMLDBDao

Implementation of ICollectionManageXMLDBDao using XML:DB apis to be reusable across any XML database which supports a pure XML:DB api

Author:
Stuart Eccles

Field Summary
protected static java.lang.String COLLECTIONMANAGEMENTSERVICE_NAME
           
protected static java.lang.String COLLECTIONMANAGEMENTSERVICE_VERSION
           
 
Fields inherited from class uk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
dataSource, RESOURCETYPE_XMLRESOURCE, XPATHQUERYSERVICE_NAME, XPATHQUERYSERVICE_VERSION, XUPDATEQUERYSERVICE_NAME, XUPDATEQUERYSERVICE_VERSION
 
Constructor Summary
BaseCollectionManageXMLDBDao()
           
 
Method Summary
 void addCollection(java.lang.String existingCollectionPath, java.lang.String newCollectionName)
          Add a new child collection to an underlying existing collection
 void addCollectionPath(java.lang.String collectionPath)
          Add a new collection path to the XML database.
 boolean doesCollectionExist(java.lang.String collectionPath)
          Evaluate if a specific collection exists at a collection path in the database
 java.util.Collection getCollectionCollectionInfo(java.lang.String collectionPath)
          Get the information on all child collections of a collection given its collection path This method should return a collection (in the java.util sense) of XMLDBCollectionInfo objects
protected  org.xmldb.api.modules.CollectionManagementService getCollectionManagementServiceFromCollection(org.xmldb.api.base.Collection collection)
          Return a CollectionManagementService from the given collection.
 java.util.Collection getCollectionResourceInfo(java.lang.String collectionPath)
          Get the information on all the resources in a collection given the collection path This method should return a collection (in the java.util sense) of XMLDBResourceInfo objects
 void removeCollection(java.lang.String collectionPath)
          Remove a collection from the XML datbase given the full collection path
 
Methods inherited from class uk.co.lakesidetech.springxmldb.dao.AbstractXMLDBDao
getDataSource, getNameSpaces, getXPathQueryServiceFromCollection, getXUpdateServiceFromCollection, processResourceSetToDocuments, processResourceSetToStrings, setDataSource, setNameSpaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLLECTIONMANAGEMENTSERVICE_VERSION

protected static final java.lang.String COLLECTIONMANAGEMENTSERVICE_VERSION
See Also:
Constant Field Values

COLLECTIONMANAGEMENTSERVICE_NAME

protected static final java.lang.String COLLECTIONMANAGEMENTSERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

BaseCollectionManageXMLDBDao

public BaseCollectionManageXMLDBDao()
Method Detail

getCollectionManagementServiceFromCollection

protected org.xmldb.api.modules.CollectionManagementService getCollectionManagementServiceFromCollection(org.xmldb.api.base.Collection collection)
                                                                                                  throws org.xmldb.api.base.XMLDBException
Return a CollectionManagementService from the given collection.

Parameters:
collection - to get service for
Returns:
A CollectionManagementService for the collection
Throws:
org.xmldb.api.base.XMLDBException - if anything goes wrong

addCollection

public void addCollection(java.lang.String existingCollectionPath,
                          java.lang.String newCollectionName)
                   throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Add a new child collection to an underlying existing collection

Specified by:
addCollection in interface ICollectionManageXMLDBDao
Parameters:
existingCollectionPath -
newCollectionName -
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.addCollection(java.lang.String, java.lang.String)

addCollectionPath

public void addCollectionPath(java.lang.String collectionPath)
                       throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Add a new collection path to the XML database. This method should create any non existing collections on the path

Specified by:
addCollectionPath in interface ICollectionManageXMLDBDao
Parameters:
collectionPath -
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.addCollectionPath(java.lang.String)

removeCollection

public void removeCollection(java.lang.String collectionPath)
                      throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Remove a collection from the XML datbase given the full collection path

Specified by:
removeCollection in interface ICollectionManageXMLDBDao
Parameters:
collectionPath -
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.removeCollection(java.lang.String)

doesCollectionExist

public boolean doesCollectionExist(java.lang.String collectionPath)
                            throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Evaluate if a specific collection exists at a collection path in the database

Specified by:
doesCollectionExist in interface ICollectionManageXMLDBDao
Parameters:
collectionPath -
Returns:
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.doesCollectionExist(java.lang.String)

getCollectionResourceInfo

public java.util.Collection getCollectionResourceInfo(java.lang.String collectionPath)
                                               throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Get the information on all the resources in a collection given the collection path This method should return a collection (in the java.util sense) of XMLDBResourceInfo objects

Specified by:
getCollectionResourceInfo in interface ICollectionManageXMLDBDao
Parameters:
collectionPath -
Returns:
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.getCollectionResourceInfo(java.lang.String)

getCollectionCollectionInfo

public java.util.Collection getCollectionCollectionInfo(java.lang.String collectionPath)
                                                 throws XMLDBDataAccessException
Description copied from interface: ICollectionManageXMLDBDao
Get the information on all child collections of a collection given its collection path This method should return a collection (in the java.util sense) of XMLDBCollectionInfo objects

Specified by:
getCollectionCollectionInfo in interface ICollectionManageXMLDBDao
Parameters:
collectionPath -
Returns:
Throws:
XMLDBDataAccessException - problems accessing the XML database
See Also:
ICollectionManageXMLDBDao.getCollectionCollectionInfo(java.lang.String)