dbXML API

## com.dbxml.db.client
Interface CollectionClient

All Known Implementing Classes:
  CollectionClientImpl, CollectionClientImpl

public interface CollectionClient

CollectionClient is the standard interface for working with a dbXML Collection in a client/server fashion.

Field Summary
`static int` `TYPE_DOCUMENTS`
`static int` `TYPE_VALUES`

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.
`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.

Field Detail

### TYPE_DOCUMENTS

    public static final int TYPE_DOCUMENTS

See Also:
  Constant Field Values

### TYPE_VALUES

    public static final int TYPE_VALUES

See Also:
  Constant Field Values

Method Detail

### getClient

    public dbXMLClient getClient()

  getClient returns the dbXMLClient instance for this CollectionClient.

  Returns:
    The dbXMLClient instance

### getName

    public java.lang.String getName()
                             throws dbXMLException

  getName returns the name for this Object.

  Returns:
    The name
  Throws:
    `dbXMLException`

### getCollectionType

    public int getCollectionType()
                          throws dbXMLException

  getCollectionType returns the type of Objects that the Collection is allowed to store. Currently this value can either be TYPE_DOCUMENTS or TYPE_VALUES.

  Returns:
    The Collection type
  Throws:
    `dbXMLException`

### getCanonicalName

    public java.lang.String getCanonicalName()
                                      throws dbXMLException

  getCanonicalName returns the canonical name for this Object.
  ex: /local/test/ocs

  Returns:
    The canonical name
  Throws:
    `dbXMLException`

### getParentCollection

    public CollectionClient getParentCollection()
                                         throws dbXMLException

  getParentCollection returns the parent Collection of this Collection.

  Returns:
    The parent CollectionClient
  Throws:
    `dbXMLException`

### getDatabase

    public CollectionClient getDatabase()
                                 throws dbXMLException

  getDatabase returns the Database owner for this Collection.

  Returns:
    The Database CollectionClient
  Throws:
    `dbXMLException`

### getSystemCollection

    public CollectionClient getSystemCollection()
                                         throws dbXMLException

  getSystemCollection returns the System Collection.

  Returns:
    The System CollectionClient
  Throws:
    `dbXMLException`

### getCollection

    public CollectionClient getCollection(java.lang.String name)
                                   throws dbXMLException

  getCollection retrieves a Collection by name.

  Returns:
    The CollectionClient
  Throws:
    `dbXMLException`

### createCollection

    public CollectionClient createCollection(java.lang.String path,
                                             org.w3c.dom.Document configuration)
                                      throws dbXMLException

  createCollection creates a new Collection object and any associated system resources that the Collection will need.

  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

  listCollections retrieves a list of Collections as an array of Strings.

  Returns:
    The Collection list
  Throws:
    `dbXMLException`

### dropCollection

    public boolean dropCollection(java.lang.String name)
                           throws dbXMLException

  dropCollection physically removes the specified Collection and any associated system resources that the Collection uses.

  Returns:
    Whether or not the Collection was dropped
  Throws:
    `dbXMLException`

### createTrigger

    public java.lang.String createTrigger(org.w3c.dom.Document configuration)
                                   throws dbXMLException

  createTrigger creates a new Trigger object and any associated system resources that the Trigger will need.

  Parameters:
    `configuration` - The Trigger's configuration
  Returns:
    The newly created Trigger
  Throws:
    `dbXMLException`

### dropTrigger

    public boolean dropTrigger(java.lang.String name)
                        throws dbXMLException

  dropTrigger physically removes the specified Trigger and any associated system resources that the Trigger uses.

  Parameters:
    `name` - The Trigger to drop
  Returns:
    Whether or not the Trigger was dropped
  Throws:
    `dbXMLException`

### listTriggers

    public java.lang.String[] listTriggers()
                                    throws dbXMLException

  listTriggers returns a list of the currently registered Triggers as an array of String.

  Returns:
    The Trigger list
  Throws:
    `dbXMLException`

### createIndexer

    public java.lang.String createIndexer(org.w3c.dom.Document configuration)
                                   throws dbXMLException

  createIndexer creates a new Indexer object and any associated system resources that the Indexer will need.

  Parameters:
    `configuration` - The Indexer's configuration
  Returns:
    The newly created Indexer
  Throws:
    `dbXMLException`

### dropIndexer

    public boolean dropIndexer(java.lang.String name)
                        throws dbXMLException

  dropIndexer physically removes the specified Indexer and any associated system resources that the Indexer uses.

  Parameters:
    `name` - The Indexer to drop
  Returns:
    Whether or not the Indexer was dropped
  Throws:
    `dbXMLException`

### listIndexers

    public java.lang.String[] listIndexers()
                                    throws dbXMLException

  listIndexers returns a list of the currently registered Indexers as an array of String.

  Returns:
    The Indexer list
  Throws:
    `dbXMLException`

### getExtension

    public java.lang.String getExtension(java.lang.String name)
                                  throws dbXMLException

  getExtension retrieves an Extension by name.

  Parameters:
    `name` - The Extension's name
  Returns:
    The Extension
  Throws:
    `dbXMLException`

### createExtension

    public java.lang.String createExtension(org.w3c.dom.Document configuration)
                                     throws dbXMLException

  createExtension creates a new Extension object and any associated system resources that the Extension will need.

  Parameters:
    `configuration` - The Extension's configuration
  Returns:
    The newly created Extension
  Throws:
    `dbXMLException`

### listExtensions

    public java.lang.String[] listExtensions()
                                      throws dbXMLException

  listExtensions returns a list of the currently registered Extensions as an array of String.

  Returns:
    The Extension list
  Throws:
    `dbXMLException`

### dropExtension

    public boolean dropExtension(java.lang.String name)
                          throws dbXMLException

  dropExtension physically removes the specified Extension and any associated system resources that the Extension uses.

  Parameters:
    `name` - The Extension to drop
  Returns:
    Whether or not the Extension was dropped
  Throws:
    `dbXMLException`

### createKey

    public java.lang.String createKey()
                               throws dbXMLException

  createKey creates a new Collection unique Key. No promises are made as to global uniqueness, but every effort is made to ensure this.

  Returns:
    a new unique Key
  Throws:
    `dbXMLException`

### getDocument

    public org.w3c.dom.Document getDocument(java.lang.String docKey)
                                     throws dbXMLException

  getDocument retrieves a Document by Key.

  Parameters:
    `docKey` - The Document Key
  Returns:
    The Document
  Throws:
    `dbXMLException`

### getDocumentAsText

    public java.lang.String getDocumentAsText(java.lang.String docKey)
                                       throws dbXMLException

  getDocumentAsText retrieves a Document by Key.

  Parameters:
    `docKey` - The Document Key
  Returns:
    The Document
  Throws:
    `dbXMLException`

### getContent

    public ContentClient getContent(java.lang.String key)
                             throws dbXMLException

  getContent returns a ContentClient instance by Key.

  Parameters:
    `key` - The Content Key
  Returns:
    The ContentClient
  Throws:
    `dbXMLException`

### insertDocument

    public java.lang.String insertDocument(org.w3c.dom.Document document)
                                    throws dbXMLException

  insertDocument inserts a new Document into a dbXML Collection.

  Parameters:
    `document` - The Document
  Returns:
    The new Object Identifier
  Throws:
    `dbXMLException`

### insertDocumentAsText

    public java.lang.String insertDocumentAsText(java.lang.String document)
                                          throws dbXMLException

  insertDocumentAsText inserts a new Document into a dbXML Collection.

  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

  setDocument overwrites/updates an existing Document in a dbXML Collection.

  Parameters:
    `docKey` - The Document Key
    `document` - The Document
  Throws:
    `dbXMLException`

### setDocumentAsText

    public void setDocumentAsText(java.lang.String docKey,
                                  java.lang.String document)
                           throws dbXMLException

  setDocumentAsText overwrites/updates an existing Document in a dbXML Collection.

  Parameters:
    `docKey` - The Document Key
    `document` - The Document
  Throws:
    `dbXMLException`

### remove

    public void remove(java.lang.String docKey)
                throws dbXMLException

  remove removes an object from the Collection based on its Key, regardless of its type.

  Throws:
    `dbXMLException`

### listKeys

    public java.lang.String[] listKeys()
                                throws dbXMLException

  listKeys returns a list of all Object keys stored by this collection.

  Returns:
    the list of object keys
  Throws:
    `dbXMLException`

### getKeyCount

    public long getKeyCount()
                     throws dbXMLException

  getKeyCount returns the count of Objects being maintained by this Collection.

  Returns:
    The object count
  Throws:
    `dbXMLException`

### insertValue

    public java.lang.String insertValue(byte[] value)
                                 throws dbXMLException

  insertValue stores a binary Record in the Collection and returns a newly generated Key.

  Parameters:
    `value` - The Value to store
  Throws:
    `dbXMLException`

### setValue

    public void setValue(java.lang.String key,
                         byte[] value)
                  throws dbXMLException

  setValue stores a binary Record in the Collection.

  Parameters:
    `key` - The Key to use
    `value` - The Value to store
  Throws:
    `dbXMLException`

### getValue

    public byte[] getValue(java.lang.String key)
                    throws dbXMLException

  getValue retrieves a binary Record from the Collection.

  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

  queryCollection performs a query against the current Collection using the specified style and query String.

  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

  queryDocument performs a query against a single Document using the specified style, query string, and Document ID.

  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