A Collection represents a collection of Resources
stored within an XML database. An XML database may expose collections as a
hierarchical set of parent and child collections.
A Collection provides access to the Resources
stored by the Collection and to Service instances
that can operate against the Collection and the
Resources stored within it. The Service mechanism
provides the ability to extend the functionality of a Collection
in ways that allows optional functionality to be enabled for the Collection.
author: SMB, Per Nyfelt version: $Revision: 1.1 $
createResource(String id, String type) Creates a new empty Resource with the provided id.
Parameters: id - the unique id to associate with the created Resource. Parameters: type - the Resource type to create.
getChildCollection(String name) Returns a Collection instance for the requested child collection
if it exists.
Parameters: name - the name of the child collection to retrieve.
public int
getChildCollectionCount() Returns the number of child collections under this collection or 0 if no
child collections exist.
Releases all resources consumed by the Collection.
The close method must
always be called when use of a Collection is complete.
exception: XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendorspecific errors that occur.
Creates a new empty Resource with the provided id.
Parameters: id - the unique id to associate with the created Resource. Parameters: type - the Resource type to create. an empty Resource instance.
Returns a Collection instance for the requested child collection
if it exists.
Parameters: name - the name of the child collection to retrieve. the requested child collection or null if it couldn't be found. exception: XMLDBException -
Returns the number of child collections under this collection or 0 if no
child collections exist.
the number of child collections. exception: XMLDBException -
Returns the Service with the provided name and version.
Parameters: name - the name of the requested Service Parameters: version - the version of the requested Service if any
Returns a list of Collection names naming all child collections
of the current collection. If no child collections exist an empty list is
returned.
an array containing Collection names for all childcollections. exception: XMLDBException -
Returns a list of the ids for all resources stored in the collection.
a string array containing the names for allResources in the collection. exception: XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendorspecific errors that occur.
Removes the Resource from the database.
Parameters: res - the resource to remove. exception: XMLDBException - with expected error codes. ErrorCodes.VENDOR_ERROR for any vendorspecific errors that occur. ErrorCodes.INVALID_RESOURCE if the Resource isnot valid. ErrorCodes.NO_SUCH_RESOURCE if the Resource isnot known to this Collection.