uk.org.ogsadai.dataresource.conx
Class XMLDBConnectionManager

java.lang.Object
  |
  +--uk.org.ogsadai.dataresource.conx.ConnectionManager
        |
        +--uk.org.ogsadai.dataresource.conx.XMLDBConnectionManager

public class XMLDBConnectionManager
extends ConnectionManager

This implementation of the ConnectionManager abstract class represents an XMLDB data resource and provides access to a specified collection and its sub-collections.

Author:
The OGSA-DAI Project Team

Field Summary
 
Fields inherited from class uk.org.ogsadai.dataresource.conx.ConnectionManager
mDriverClass, mLog, mRoleMapClass, mRoleMapper, mURI
 
Constructor Summary
XMLDBConnectionManager(ConnectionConfig config)
           
 
Method Summary
 org.xmldb.api.base.Collection getCollection(java.lang.String userCredentials)
          Returns an open collection for the base collection of the data resource.
 org.xmldb.api.base.Collection getCollection(java.lang.String subCollection, java.lang.String userCredentials)
          Returns an open collection for the specified sub-collection of the data resource.
 void returnCollection(org.xmldb.api.base.Collection collection)
          Returns a collection to the connection manager.
 
Methods inherited from class uk.org.ogsadai.dataresource.conx.ConnectionManager
mapCertificate, setRoleMapsFile, setupRoleMapping, updateRoleMaps
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDBConnectionManager

public XMLDBConnectionManager(ConnectionConfig config)
                       throws CoreSystemException,
                              CoreUserException
See Also:
ConnectionManager
Method Detail

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String userCredentials)
                                            throws CoreSystemException,
                                                   CoreUserException,
                                                   AuthorisationException
Returns an open collection for the base collection of the data resource.

Parameters:
userCredentials - The user credentials foraccessing the database.
Throws:
CoreSystemException - If there is a problem retrieving the open collection.
CoreUserException - If the specified sub-collection does not exist.
AuthorisationException - if the user is not permitted to access the database.

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String subCollection,
                                                   java.lang.String userCredentials)
                                            throws CoreSystemException,
                                                   CoreUserException,
                                                   AuthorisationException
Returns an open collection for the specified sub-collection of the data resource.

Parameters:
subCollection - The path to the sub-collection relative to the base collection for this data resource. This should not begin with a "/". The "/" is added automatically to the base collection uri when the full collection URI is composed. For example, if the base collection is "db" and the sub-collection is "test/addresses" then an open collection for "/db/test/addresses" will be returned. If this is null then the base collection is returned.
userCredentials - The user credentials for accessing the database.
Returns:
A reference to an open Collection object.
Throws:
CoreSystemException - If there is a problem retrieving the open collection.
CoreUserException - If the specified sub-collection does not exist.
AuthorisationException - if the user is not permitted to access the database.

returnCollection

public final void returnCollection(org.xmldb.api.base.Collection collection)
                            throws CoreSystemException
Returns a collection to the connection manager. Once a collection is finished with it should be passed back to this method. This allows collection pooling to be performed under the surface.

Parameters:
collection - The collection to close. If this is null or already closed then nothing is done with it.
Throws:
CoreSystemException - If there is a problem closing the collection.