dbXML API

com.dbxml.db.core.adapter
Class SimpleAdapter

java.lang.Object
  extended bycom.dbxml.db.core.adapter.SimpleAdapter
All Implemented Interfaces:
Adapter
Direct Known Subclasses:
DOMAdapter, JAXBElementAdapter, SAXAdapter, XMLSerializableAdapter

public class SimpleAdapter
extends java.lang.Object
implements Adapter

SimpleAdapter is a base class for implementing custom Adapters.


Constructor Summary
SimpleAdapter(Collection col)
           
 
Method Summary
 java.lang.String getCanonicalName()
          getCanonicalName returns the canonical name for the underlying Collection.
 Collection getCollection()
          getCollection returns a reference to the underlying Collection.
 long getKeyCount(Transaction tx)
          getKeyCount returns the count of objects being maintained by this Adapter.
 java.lang.String getName()
          getName returns the name for the underlying Collection.
 Key[] listKeys(Transaction tx)
          listKeys returns a list of object keys stored managed by the Adapter.
 ResultSet queryCollection(Transaction tx, java.lang.String style, java.lang.String query, NamespaceMap nsMap)
          queryCollection performs a query against the current collection using the specified style and query String.
 ResultSet queryDocument(Transaction tx, java.lang.String style, java.lang.String query, NamespaceMap nsMap, java.lang.Object key)
          queryDocument performs a query against a single Document using the specified style, query string, and Document ID.
 void remove(Transaction tx, java.lang.Object key)
          remove removes an object from the Adapter based on its Key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAdapter

public SimpleAdapter(Collection col)
Method Detail

getCollection

public Collection getCollection()
Description copied from interface: Adapter
getCollection returns a reference to the underlying Collection.

Specified by:
getCollection in interface Adapter
Returns:
The underlying Collection

getName

public java.lang.String getName()
Description copied from interface: Adapter
getName returns the name for the underlying Collection.
ex: ocs

Specified by:
getName in interface Adapter
Returns:
The name

getCanonicalName

public java.lang.String getCanonicalName()
Description copied from interface: Adapter
getCanonicalName returns the canonical name for the underlying Collection.
ex: /local/test/ocs

Specified by:
getCanonicalName in interface Adapter
Returns:
The canonical name

getKeyCount

public long getKeyCount(Transaction tx)
                 throws DBException
Description copied from interface: Adapter
getKeyCount returns the count of objects being maintained by this Adapter.

Specified by:
getKeyCount in interface Adapter
Parameters:
tx - The controlling Transaction
Returns:
The object count
Throws:
DBException - If a Database Exception occurs

remove

public void remove(Transaction tx,
                   java.lang.Object key)
            throws DBException
Description copied from interface: Adapter
remove removes an object from the Adapter based on its Key.

Specified by:
remove in interface Adapter
Parameters:
tx - The controlling Transaction
key - The Object's Key
Throws:
DBException - If a Database Exception occurs

listKeys

public Key[] listKeys(Transaction tx)
               throws DBException
Description copied from interface: Adapter
listKeys returns a list of object keys stored managed by the Adapter.

Specified by:
listKeys in interface Adapter
Parameters:
tx - The controlling Transaction
Returns:
the list of object keys
Throws:
DBException - If a Database Exception occurs

queryCollection

public ResultSet queryCollection(Transaction tx,
                                 java.lang.String style,
                                 java.lang.String query,
                                 NamespaceMap nsMap)
                          throws DBException
Description copied from interface: Adapter
queryCollection performs a query against the current collection using the specified style and query String.

Specified by:
queryCollection in interface Adapter
Parameters:
tx - The controlling Transaction
style - The query style to use (ex: XPath)
query - The query to execute
nsMap - The namespace Map (if any)
Returns:
The resulting ResultSet
Throws:
DBException - If a Database Exception occurs

queryDocument

public ResultSet queryDocument(Transaction tx,
                               java.lang.String style,
                               java.lang.String query,
                               NamespaceMap nsMap,
                               java.lang.Object key)
                        throws DBException
Description copied from interface: Adapter
queryDocument performs a query against a single Document using the specified style, query string, and Document ID.

Specified by:
queryDocument in interface Adapter
Parameters:
tx - The controlling Transaction
style - The query style to use (ex: XPath)
query - The query to execute
nsMap - The namespace Map (if any)
key - The Document to query
Returns:
The resulting ResultSet
Throws:
DBException - If a Database Exception occurs

dbXML API

Copyright (c) 2004 The dbXML Group