no.sintef.xmldb
Class XmlDbHandler

java.lang.Object
  extended byno.sintef.xmldb.XmlDbHandler

public final class XmlDbHandler
extends java.lang.Object

XML:DB database handler.

Author:
Fredrik Vraalsen

Method Summary
 org.xmldb.api.modules.XMLResource createXmlResource(java.lang.String parent)
          Create XMLResource in specified collection.
 void deleteResource(org.xmldb.api.modules.XMLResource resource)
          Delete XMLResource.
static XmlDbHandler getHandler()
          Gets the XmlDbHandler instance.
 org.xmldb.api.modules.XMLResource getSingleXmlResource(java.lang.String parent, java.lang.String query, java.util.Map namespaceMappings)
          Get first XMLResource in collection matching specified query.
 org.xmldb.api.modules.XMLResource[] getXmlResources(java.lang.String parent, java.lang.String query, java.util.Map namespaceMappings)
          Get XMLResources in collection matching specified query.
 void storeResource(org.xmldb.api.modules.XMLResource resource)
          Store an XMLResource in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandler

public static XmlDbHandler getHandler()
Gets the XmlDbHandler instance.

Returns:
the XmlDbHandler

getSingleXmlResource

public org.xmldb.api.modules.XMLResource getSingleXmlResource(java.lang.String parent,
                                                              java.lang.String query,
                                                              java.util.Map namespaceMappings)
Get first XMLResource in collection matching specified query. TODO includes subcollections?

Parameters:
parent - full path of parent collection, using '/' as path separator
query - XPath query string
namespaceMappings - prefix -> namespace URI mappings
Returns:
first XMLResource matching query, or null if none is found or error occurs

getXmlResources

public org.xmldb.api.modules.XMLResource[] getXmlResources(java.lang.String parent,
                                                           java.lang.String query,
                                                           java.util.Map namespaceMappings)
Get XMLResources in collection matching specified query. Resources which could not be loaded from database because of errors are not included in result. TODO includes subcollections?

Parameters:
parent - full path of parent collection, using '/' as path separator
query - XPath query
namespaceMappings - prefix -> namespace URI mappings
Returns:
array of XMLResources matching query, possibly empty (never null)

createXmlResource

public org.xmldb.api.modules.XMLResource createXmlResource(java.lang.String parent)
Create XMLResource in specified collection.

Parameters:
parent - full path of parent collection to create resource in, using '/' as path separator
Returns:
the created XMLResource, or null if error occured

deleteResource

public void deleteResource(org.xmldb.api.modules.XMLResource resource)
                    throws org.xmldb.api.base.XMLDBException
Delete XMLResource.

Parameters:
resource - resource to delete
Throws:
org.xmldb.api.base.XMLDBException - if resource cannot be deleted from database

storeResource

public void storeResource(org.xmldb.api.modules.XMLResource resource)
                   throws org.xmldb.api.base.XMLDBException
Store an XMLResource in the database.

Parameters:
resource - the XMLResource to store
Throws:
org.xmldb.api.base.XMLDBException - if error occurs when storing resource in database


Copyright © 2003-2005 SINTEF. All Rights Reserved.