Xindice API
version 1.1

org.apache.xindice.core
Class CollectionManager

java.lang.Object
  |
  +--org.apache.xindice.core.CollectionManager
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
Collection

public class CollectionManager
extends Object
implements Configurable

CollectionManager is the base class for both Database and Collection.

Version:
$Revision: 533255 $, $Date: 2007-04-27 19:27:10 -0400 (Fri, 27 Apr 2007) $

Constructor Summary
protected CollectionManager()
           
 
Method Summary
protected  void addCollection(Collection collection)
           
 boolean close()
           
 long countCollections()
          Returns number of child collections
 Collection createCollection(String path, Configuration cfg)
          createCollection creates a new Collection object and any associated system resources that the Collection will need.
 boolean dropCollection(Collection collection)
          dropCollection physically removes the specified Collection and any associated system resources that the Collection uses.
 Collection getCollection(String path)
          getCollection retrieves a Collection by name.
protected  Map getCollections()
           
 Configuration getConfig()
          getConfig retrieves the configuration information for the Configurable object instance.
 String[] listCollections()
          listCollections retrieves a list of Collections as an array of Strings.
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionManager

protected CollectionManager()
Method Detail

addCollection

protected void addCollection(Collection collection)
Parameters:
collection -  

countCollections

public final long countCollections()
                            throws DBException
Returns number of child collections
Returns:
number of collections

createCollection

public Collection createCollection(String path,
                                   Configuration cfg)
                            throws DBException
createCollection creates a new Collection object and any associated system resources that the Collection will need.
Parameters:
path - The relative path of the Collection
cfg - The Collection's configuration
Returns:
The newly created Collection

close

public boolean close()
              throws DBException

dropCollection

public boolean dropCollection(Collection collection)
                       throws DBException
dropCollection physically removes the specified Collection and any associated system resources that the Collection uses.
Parameters:
collection - The Collection to drop
Returns:
Whether or not the Collection was dropped

getCollection

public Collection getCollection(String path)
                         throws DBException
getCollection retrieves a Collection by name.
Parameters:
path - The Collection path
Returns:
The Collection (or null)

getCollections

protected Map getCollections()
Returns:
The collections map

getConfig

public Configuration getConfig()
Description copied from interface: Configurable
getConfig retrieves the configuration information for the Configurable object instance.
Specified by:
getConfig in interface Configurable
See Also:
Configurable.getConfig()

listCollections

public final String[] listCollections()
                               throws DBException
listCollections retrieves a list of Collections as an array of Strings.
Returns:
The Collection list

setConfig

public void setConfig(Configuration config)
               throws XindiceException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.
Specified by:
setConfig in interface Configurable
See Also:
Configurable.setConfig(org.apache.xindice.util.Configuration)

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.