Xindice API

org.apache.xindice.client.xmldb.services
Class CollectionManager

java.lang.Object
  |
  +--org.apache.xindice.client.xmldb.CommonConfigurable
        |
        +--org.apache.xindice.client.xmldb.services.CollectionManager
All Implemented Interfaces:
CollectionManagementService, Configurable, ManagedObject, Service

public class CollectionManager
extends CommonConfigurable
implements ManagedObject, Service, CollectionManagementService

CollectionManager provides management facilities for a Collection instance. Administrative access is required for retrieval of the CollectionManager interface. User level access is provided through the underlying Collection itself.


Constructor Summary
CollectionManager(CollectionManager manager, Database db, DatabaseImpl database)
          Creates a new CollectionManager service
 
Method Summary
 Collection createCollection(java.lang.String name)
          Creates a simple collection with a basic default configuration.
 Collection createCollection(java.lang.String path, org.w3c.dom.Document configuration)
          Creates a new collection in the database identified by name and using the provided configuration.
 void createIndexer(org.w3c.dom.Document configuration)
          Creates a new Indexer for this collection.
 void createXMLObject(org.w3c.dom.Document configuration)
          Creates a new collection level XMLObject using the provided configuration.
 void dropCollection(java.lang.String name)
          Drops a child collection from this collection.
 void dropIndexer(java.lang.String name)
          Drops the indexer from the collection
 void dropXMLObject(java.lang.String name)
          Drops a collection level XMLObject from the collection.
 java.lang.String getCanonicalName()
          Returns the fully qualified name of the collection that this manager is associated with.
 java.lang.String getCollectionName()
          Returns the name of the collection that this manager is associated with.
 java.lang.String getName()
          Returns the name of the Service
 java.lang.String getVersion()
          Returns the version of the Service
 java.lang.String[] listIndexers()
          Returns a list of all indexers for this collection.
 java.lang.String[] listXMLObjects()
          Returns a list of all collection level XMLObjects for this collection.
 void remove()
          Removes the server side Servant for this object.
 void removeCollection(java.lang.String name)
          Removes the named collection from the system.
 void setCollection(Collection col)
          Provides a reference to the XML:DB collection instance that this service is associated with.
 
Methods inherited from class org.apache.xindice.client.xmldb.CommonConfigurable
getProperty, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Constructor Detail

CollectionManager

public CollectionManager(CollectionManager manager,
                         Database db,
                         DatabaseImpl database)
Creates a new CollectionManager service
Parameters:
manager - the server side CollectionManager to use.
db - the root Database instance that the CollectionManager is associated with.
database - a reference to the XML:DB Database instance for the API.
Method Detail

getName

public java.lang.String getName()
Returns the name of the Service
Specified by:
getName in interface Service
Returns:
the name of the Service

getVersion

public java.lang.String getVersion()
Returns the version of the Service
Specified by:
getVersion in interface Service
Returns:
the version of the Service

setCollection

public void setCollection(Collection col)
Provides a reference to the XML:DB collection instance that this service is associated with.
Specified by:
setCollection in interface Service
Parameters:
col - the XML:DB collection instance associated with this Service

getCollectionName

public java.lang.String getCollectionName()
                                   throws XMLDBException
Returns the name of the collection that this manager is associated with.
Returns:
the name of the collection
Throws:
XMLDBException -  

getCanonicalName

public java.lang.String getCanonicalName()
                                  throws XMLDBException
Returns the fully qualified name of the collection that this manager is associated with. This name includes all parent collections.
Returns:
the fully qualified name for this collection.
Throws:
XMLDBException -  

createCollection

public Collection createCollection(java.lang.String path,
                                   org.w3c.dom.Document configuration)
                            throws XMLDBException
Creates a new collection in the database identified by name and using the provided configuration.
Parameters:
path - the path of the new collection
configuration - the XML collection configuration to use for creating this collection.
Returns:
The newly created collection
Throws:
XMLDBException -  

dropCollection

public void dropCollection(java.lang.String name)
                    throws XMLDBException
Drops a child collection from this collection.
Parameters:
collection - The child collection to drop.
Throws:
XMLDBException -  

listIndexers

public java.lang.String[] listIndexers()
                                throws XMLDBException
Returns a list of all indexers for this collection.
Returns:
the list of indexers
Throws:
XMLDBException -  

createIndexer

public void createIndexer(org.w3c.dom.Document configuration)
                   throws XMLDBException
Creates a new Indexer for this collection.
Parameters:
name - The name for this indexer
configuration - The configuration to use for this indexer.
Throws:
XMLDBException -  

dropIndexer

public void dropIndexer(java.lang.String name)
                 throws XMLDBException
Drops the indexer from the collection
Parameters:
indexer - The indexer to drop.
Throws:
XMLDBException -  

listXMLObjects

public java.lang.String[] listXMLObjects()
                                  throws XMLDBException
Returns a list of all collection level XMLObjects for this collection.
Returns:
the list of XMLObjects.
Throws:
XMLDBException -  

createXMLObject

public void createXMLObject(org.w3c.dom.Document configuration)
                     throws XMLDBException
Creates a new collection level XMLObject using the provided configuration. The XMLObject will be added to the collection using the provided name as a key.
Parameters:
name - The name of this XMLObject
configuration - The XML configuration to use
Returns:
The created XMLObject
Throws:
XMLDBException -  

dropXMLObject

public void dropXMLObject(java.lang.String name)
                   throws XMLDBException
Drops a collection level XMLObject from the collection.
Parameters:
object - The XMLObject to drop.
Throws:
XMLDBException -  

createCollection

public Collection createCollection(java.lang.String name)
                            throws XMLDBException
Creates a simple collection with a basic default configuration. More complex configuration requires using a proprietary interface
Specified by:
createCollection in interface CollectionManagementService
Following copied from interface: org.xmldb.api.modules.CollectionManagementService
Parameters:
name - The name of the collection to create.
Returns:
The created Collection instance.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

removeCollection

public void removeCollection(java.lang.String name)
                      throws XMLDBException
Removes the named collection from the system.
Specified by:
removeCollection in interface CollectionManagementService
Following copied from interface: org.xmldb.api.modules.CollectionManagementService
Parameters:
name - The name of the collection to remove.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

remove

public void remove()
Removes the server side Servant for this object. Should be called when the the object is no longer needed.
Specified by:
remove in interface ManagedObject

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation