dbXML API

com.dbxml.db.client.local
Class CollectionClientImpl

java.lang.Object
  extended bycom.dbxml.db.client.local.CollectionClientImpl
All Implemented Interfaces:
CollectionClient

public class CollectionClientImpl
extends java.lang.Object
implements CollectionClient

CollectionClientImpl


Field Summary
 
Fields inherited from interface com.dbxml.db.client.CollectionClient
TYPE_DOCUMENTS, TYPE_VALUES
 
Constructor Summary
CollectionClientImpl(dbXMLClient client, Collection col)
           
 
Method Summary
 CollectionClient createCollection(java.lang.String path, org.w3c.dom.Document configuration)
          createCollection creates a new Collection object and any associated system resources that the Collection will need.
 java.lang.String createExtension(org.w3c.dom.Document configuration)
          createExtension creates a new Extension object and any associated system resources that the Extension will need.
 java.lang.String createIndexer(org.w3c.dom.Document configuration)
          createIndexer creates a new Indexer object and any associated system resources that the Indexer will need.
 java.lang.String createKey()
          createKey creates a new Collection unique Key.
 java.lang.String createTrigger(org.w3c.dom.Document configuration)
          createTrigger creates a new Trigger object and any associated system resources that the Trigger will need.
 boolean dropCollection(java.lang.String name)
          dropCollection physically removes the specified Collection and any associated system resources that the Collection uses.
 boolean dropExtension(java.lang.String name)
          dropExtension physically removes the specified Extension and any associated system resources that the Extension uses.
 boolean dropIndexer(java.lang.String name)
          dropIndexer physically removes the specified Indexer and any associated system resources that the Indexer uses.
 boolean dropTrigger(java.lang.String name)
          dropTrigger physically removes the specified Trigger and any associated system resources that the Trigger uses.
 java.lang.String getCanonicalName()
          getCanonicalName returns the canonical name for this Object.
 dbXMLClient getClient()
          getClient returns the dbXMLClient instance for this CollectionClient.
 CollectionClient getCollection(java.lang.String name)
          getCollection retrieves a Collection by name.
 int getCollectionType()
          getCollectionType returns the type of Objects that the Collection is allowed to store.
 ContentClient getContent(java.lang.String key)
          getContent returns a ContentClient instance by Key.
 CollectionClient getDatabase()
          getDatabase returns the Database owner for this Collection.
 org.w3c.dom.Document getDocument(java.lang.String docKey)
          getDocument retrieves a Document by Key.
 java.lang.String getDocumentAsText(java.lang.String docKey)
          getDocumentAsText retrieves a Document by Key.
 java.lang.String getExtension(java.lang.String name)
          getExtension retrieves an Extension by name.
 Collection getInternalCollection()
           
 long getKeyCount()
          getKeyCount returns the count of Objects being maintained by this Collection.
 java.lang.String getName()
          getName returns the name for this Object.
 CollectionClient getParentCollection()
          getParentCollection returns the parent Collection of this Collection.
 CollectionClient getSystemCollection()
          getSystemCollection returns the System Collection.
 byte[] getValue(java.lang.String key)
          getValue retrieves a binary Record from the Collection.
 java.lang.String insertDocument(org.w3c.dom.Document document)
          insertDocument inserts a new Document into a dbXML Collection.
 java.lang.String insertDocumentAsText(java.lang.String document)
          insertDocumentAsText inserts a new Document into a dbXML Collection.
 java.lang.String insertValue(byte[] value)
          insertValue stores a binary Record in the Collection and returns a newly generated Key.
 java.lang.String[] listCollections()
          listCollections retrieves a list of Collections as an array of Strings.
 java.lang.String[] listExtensions()
          listExtensions returns a list of the currently registered Extensions as an array of String.
 java.lang.String[] listIndexers()
          listIndexers returns a list of the currently registered Indexers as an array of String.
 java.lang.String[] listKeys()
          listKeys returns a list of all Object keys stored by this collection.
 java.lang.String[] listTriggers()
          listTriggers returns a list of the currently registered Triggers as an array of String.
 ResultSetClient queryCollection(java.lang.String style, java.lang.String query, java.util.Map nsMap)
          queryCollection performs a query against the current Collection using the specified style and query String.
 ResultSetClient queryDocument(java.lang.String style, java.lang.String query, java.util.Map nsMap, java.lang.String key)
          queryDocument performs a query against a single Document using the specified style, query string, and Document ID.
 void remove(java.lang.String docKey)
          remove removes an object from the Collection based on its Key, regardless of its type.
 void setDocument(java.lang.String docKey, org.w3c.dom.Document document)
          setDocument overwrites/updates an existing Document in a dbXML Collection.
 void setDocumentAsText(java.lang.String docKey, java.lang.String document)
          setDocumentAsText overwrites/updates an existing Document in a dbXML Collection.
 void setValue(java.lang.String key, byte[] value)
          setValue stores a binary Record in the Collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionClientImpl

public CollectionClientImpl(dbXMLClient client,
                            Collection col)
Method Detail

getClient

public dbXMLClient getClient()
Description copied from interface: CollectionClient
getClient returns the dbXMLClient instance for this CollectionClient.

Specified by:
getClient in interface CollectionClient
Returns:
The dbXMLClient instance

getInternalCollection

public Collection getInternalCollection()

getCanonicalName

public java.lang.String getCanonicalName()
                                  throws dbXMLException
Description copied from interface: CollectionClient
getCanonicalName returns the canonical name for this Object.
ex: /local/test/ocs

Specified by:
getCanonicalName in interface CollectionClient
Returns:
The canonical name
Throws:
dbXMLException

getName

public java.lang.String getName()
                         throws dbXMLException
Description copied from interface: CollectionClient
getName returns the name for this Object.

Specified by:
getName in interface CollectionClient
Returns:
The name
Throws:
dbXMLException

getCollectionType

public int getCollectionType()
                      throws dbXMLException
Description copied from interface: CollectionClient
getCollectionType returns the type of Objects that the Collection is allowed to store. Currently this value can either be TYPE_DOCUMENTS or TYPE_VALUES.

Specified by:
getCollectionType in interface CollectionClient
Returns:
The Collection type
Throws:
dbXMLException

getParentCollection

public CollectionClient getParentCollection()
                                     throws dbXMLException
Description copied from interface: CollectionClient
getParentCollection returns the parent Collection of this Collection.

Specified by:
getParentCollection in interface CollectionClient
Returns:
The parent CollectionClient
Throws:
dbXMLException

getDatabase

public CollectionClient getDatabase()
                             throws dbXMLException
Description copied from interface: CollectionClient
getDatabase returns the Database owner for this Collection.

Specified by:
getDatabase in interface CollectionClient
Returns:
The Database CollectionClient
Throws:
dbXMLException

getSystemCollection

public CollectionClient getSystemCollection()
                                     throws dbXMLException
Description copied from interface: CollectionClient
getSystemCollection returns the System Collection.

Specified by:
getSystemCollection in interface CollectionClient
Returns:
The System CollectionClient
Throws:
dbXMLException

getCollection

public CollectionClient getCollection(java.lang.String name)
                               throws dbXMLException
Description copied from interface: CollectionClient
getCollection retrieves a Collection by name.

Specified by:
getCollection in interface CollectionClient
Returns:
The CollectionClient
Throws:
dbXMLException

createCollection

public CollectionClient createCollection(java.lang.String path,
                                         org.w3c.dom.Document configuration)
                                  throws dbXMLException
Description copied from interface: CollectionClient
createCollection creates a new Collection object and any associated system resources that the Collection will need.

Specified by:
createCollection in interface CollectionClient
Parameters:
path - The relative path of the Collection
configuration - The Collection's configuration
Returns:
The newly created CollectionClient
Throws:
dbXMLException

listCollections

public java.lang.String[] listCollections()
                                   throws dbXMLException
Description copied from interface: CollectionClient
listCollections retrieves a list of Collections as an array of Strings.

Specified by:
listCollections in interface CollectionClient
Returns:
The Collection list
Throws:
dbXMLException

dropCollection

public boolean dropCollection(java.lang.String name)
                       throws dbXMLException
Description copied from interface: CollectionClient
dropCollection physically removes the specified Collection and any associated system resources that the Collection uses.

Specified by:
dropCollection in interface CollectionClient
Returns:
Whether or not the Collection was dropped
Throws:
dbXMLException

createTrigger

public java.lang.String createTrigger(org.w3c.dom.Document configuration)
                               throws dbXMLException
Description copied from interface: CollectionClient
createTrigger creates a new Trigger object and any associated system resources that the Trigger will need.

Specified by:
createTrigger in interface CollectionClient
Parameters:
configuration - The Trigger's configuration
Returns:
The newly created Trigger
Throws:
dbXMLException

dropTrigger

public boolean dropTrigger(java.lang.String name)
                    throws dbXMLException
Description copied from interface: CollectionClient
dropTrigger physically removes the specified Trigger and any associated system resources that the Trigger uses.

Specified by:
dropTrigger in interface CollectionClient
Parameters:
name - The Trigger to drop
Returns:
Whether or not the Trigger was dropped
Throws:
dbXMLException

listTriggers

public java.lang.String[] listTriggers()
                                throws dbXMLException
Description copied from interface: CollectionClient
listTriggers returns a list of the currently registered Triggers as an array of String.

Specified by:
listTriggers in interface CollectionClient
Returns:
The Trigger list
Throws:
dbXMLException

createIndexer

public java.lang.String createIndexer(org.w3c.dom.Document configuration)
                               throws dbXMLException
Description copied from interface: CollectionClient
createIndexer creates a new Indexer object and any associated system resources that the Indexer will need.

Specified by:
createIndexer in interface CollectionClient
Parameters:
configuration - The Indexer's configuration
Returns:
The newly created Indexer
Throws:
dbXMLException

dropIndexer

public boolean dropIndexer(java.lang.String name)
                    throws dbXMLException
Description copied from interface: CollectionClient
dropIndexer physically removes the specified Indexer and any associated system resources that the Indexer uses.

Specified by:
dropIndexer in interface CollectionClient
Parameters:
name - The Indexer to drop
Returns:
Whether or not the Indexer was dropped
Throws:
dbXMLException

listIndexers

public java.lang.String[] listIndexers()
                                throws dbXMLException
Description copied from interface: CollectionClient
listIndexers returns a list of the currently registered Indexers as an array of String.

Specified by:
listIndexers in interface CollectionClient
Returns:
The Indexer list
Throws:
dbXMLException

getExtension

public java.lang.String getExtension(java.lang.String name)
                              throws dbXMLException
Description copied from interface: CollectionClient
getExtension retrieves an Extension by name.

Specified by:
getExtension in interface CollectionClient
Parameters:
name - The Extension's name
Returns:
The Extension
Throws:
dbXMLException

createExtension

public java.lang.String createExtension(org.w3c.dom.Document configuration)
                                 throws dbXMLException
Description copied from interface: CollectionClient
createExtension creates a new Extension object and any associated system resources that the Extension will need.

Specified by:
createExtension in interface CollectionClient
Parameters:
configuration - The Extension's configuration
Returns:
The newly created Extension
Throws:
dbXMLException

listExtensions

public java.lang.String[] listExtensions()
                                  throws dbXMLException
Description copied from interface: CollectionClient
listExtensions returns a list of the currently registered Extensions as an array of String.

Specified by:
listExtensions in interface CollectionClient
Returns:
The Extension list
Throws:
dbXMLException

dropExtension

public boolean dropExtension(java.lang.String name)
                      throws dbXMLException
Description copied from interface: CollectionClient
dropExtension physically removes the specified Extension and any associated system resources that the Extension uses.

Specified by:
dropExtension in interface CollectionClient
Parameters:
name - The Extension to drop
Returns:
Whether or not the Extension was dropped
Throws:
dbXMLException

createKey

public java.lang.String createKey()
                           throws dbXMLException
Description copied from interface: CollectionClient
createKey creates a new Collection unique Key. No promises are made as to global uniqueness, but every effort is made to ensure this.

Specified by:
createKey in interface CollectionClient
Returns:
a new unique Key
Throws:
dbXMLException

getDocument

public org.w3c.dom.Document getDocument(java.lang.String docKey)
                                 throws dbXMLException
Description copied from interface: CollectionClient
getDocument retrieves a Document by Key.

Specified by:
getDocument in interface CollectionClient
Parameters:
docKey - The Document Key
Returns:
The Document
Throws:
dbXMLException

getDocumentAsText

public java.lang.String getDocumentAsText(java.lang.String docKey)
                                   throws dbXMLException
Description copied from interface: CollectionClient
getDocumentAsText retrieves a Document by Key.

Specified by:
getDocumentAsText in interface CollectionClient
Parameters:
docKey - The Document Key
Returns:
The Document
Throws:
dbXMLException

getContent

public ContentClient getContent(java.lang.String key)
                         throws dbXMLException
Description copied from interface: CollectionClient
getContent returns a ContentClient instance by Key.

Specified by:
getContent in interface CollectionClient
Parameters:
key - The Content Key
Returns:
The ContentClient
Throws:
dbXMLException

insertDocument

public java.lang.String insertDocument(org.w3c.dom.Document document)
                                throws dbXMLException
Description copied from interface: CollectionClient
insertDocument inserts a new Document into a dbXML Collection.

Specified by:
insertDocument in interface CollectionClient
Parameters:
document - The Document
Returns:
The new Object Identifier
Throws:
dbXMLException

insertDocumentAsText

public java.lang.String insertDocumentAsText(java.lang.String document)
                                      throws dbXMLException
Description copied from interface: CollectionClient
insertDocumentAsText inserts a new Document into a dbXML Collection.

Specified by:
insertDocumentAsText in interface CollectionClient
Parameters:
document - The Document
Returns:
The new Object Identifier
Throws:
dbXMLException

setDocument

public void setDocument(java.lang.String docKey,
                        org.w3c.dom.Document document)
                 throws dbXMLException
Description copied from interface: CollectionClient
setDocument overwrites/updates an existing Document in a dbXML Collection.

Specified by:
setDocument in interface CollectionClient
Parameters:
docKey - The Document Key
document - The Document
Throws:
dbXMLException

setDocumentAsText

public void setDocumentAsText(java.lang.String docKey,
                              java.lang.String document)
                       throws dbXMLException
Description copied from interface: CollectionClient
setDocumentAsText overwrites/updates an existing Document in a dbXML Collection.

Specified by:
setDocumentAsText in interface CollectionClient
Parameters:
docKey - The Document Key
document - The Document
Throws:
dbXMLException

remove

public void remove(java.lang.String docKey)
            throws dbXMLException
Description copied from interface: CollectionClient
remove removes an object from the Collection based on its Key, regardless of its type.

Specified by:
remove in interface CollectionClient
Throws:
dbXMLException

listKeys

public java.lang.String[] listKeys()
                            throws dbXMLException
Description copied from interface: CollectionClient
listKeys returns a list of all Object keys stored by this collection.

Specified by:
listKeys in interface CollectionClient
Returns:
the list of object keys
Throws:
dbXMLException

getKeyCount

public long getKeyCount()
                 throws dbXMLException
Description copied from interface: CollectionClient
getKeyCount returns the count of Objects being maintained by this Collection.

Specified by:
getKeyCount in interface CollectionClient
Returns:
The object count
Throws:
dbXMLException

insertValue

public java.lang.String insertValue(byte[] value)
                             throws dbXMLException
Description copied from interface: CollectionClient
insertValue stores a binary Record in the Collection and returns a newly generated Key.

Specified by:
insertValue in interface CollectionClient
Parameters:
value - The Value to store
Throws:
dbXMLException

setValue

public void setValue(java.lang.String key,
                     byte[] value)
              throws dbXMLException
Description copied from interface: CollectionClient
setValue stores a binary Record in the Collection.

Specified by:
setValue in interface CollectionClient
Parameters:
key - The Key to use
value - The Value to store
Throws:
dbXMLException

getValue

public byte[] getValue(java.lang.String key)
                throws dbXMLException
Description copied from interface: CollectionClient
getValue retrieves a binary Record from the Collection.

Specified by:
getValue in interface CollectionClient
Parameters:
key - The Record's Key
Returns:
The Record
Throws:
dbXMLException

queryCollection

public ResultSetClient queryCollection(java.lang.String style,
                                       java.lang.String query,
                                       java.util.Map nsMap)
                                throws dbXMLException
Description copied from interface: CollectionClient
queryCollection performs a query against the current Collection using the specified style and query String.

Specified by:
queryCollection in interface CollectionClient
Parameters:
style - The query style to use (ex: XPath)
query - The query to execute
nsMap - The namespace Map (if any)
Returns:
The ResultSetClient
Throws:
dbXMLException

queryDocument

public ResultSetClient queryDocument(java.lang.String style,
                                     java.lang.String query,
                                     java.util.Map nsMap,
                                     java.lang.String key)
                              throws dbXMLException
Description copied from interface: CollectionClient
queryDocument performs a query against a single Document using the specified style, query string, and Document ID.

Specified by:
queryDocument in interface CollectionClient
Parameters:
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 ResultSetClient
Throws:
dbXMLException

dbXML API

Copyright (c) 2004 The dbXML Group