Xindice API
version 1.1

org.apache.xindice.core
Class Database

java.lang.Object
  |
  +--org.apache.xindice.core.CollectionManager
        |
        +--org.apache.xindice.core.Collection
              |
              +--org.apache.xindice.core.Database
All Implemented Interfaces:
Configurable, DBObject, Named

public final class Database
extends Collection
implements Named

Database is the primary container for the Xindice Database Engine.

Version:
$Revision: 533273 $, $Date: 2007-04-27 20:51:37 -0400 (Fri, 27 Apr 2007) $

Field Summary
static String DBROOT
           
static String DBROOT_DEFAULT
           
static String NAME
           
 
Constructor Summary
Database()
           
 
Method Summary
 boolean close()
          close closes the DBObject
protected  boolean close(boolean removeFromShutdown)
          Checks to see if it has been closed to insure that it doesn't try to do it twice.
 void flushConfig()
          flushConfig ensures that the Collection configuration has been properly flushed to disk after a modification.
 Database getDatabase()
          getDatabase returns the Database owner for this Collection.
static Database getDatabase(Configuration config)
          This will return an instance of a Database for the given name if one has already been loaded, otherwise it will create a new instance.
static Database getDatabase(String name)
          This will merely return an instance of a Database for the given name if one has already been loaded.
 DocumentCache getDocumentCache()
          getDocumentCache returns the Database-level Document Cache.
 MetaSystemCollection getMetaSystemCollection()
          Return the MetaSystem collection for this database.
 QueryEngine getQueryEngine()
          getQueryEngine returns a reference to the Database's current operating QueryEngine implementation.
 SystemCollection getSystemCollection()
          getSystemCollection returns the System Collection.
protected  Timer getTimer()
          Return database's timer instance.
 boolean isMetaEnabled()
          Return whether or not metadata is enabled on this database.
static String[] listDatabases()
           
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 
Methods inherited from class org.apache.xindice.core.Collection
create, createCollection, createIndexer, createNewKey, createNewOID, drop, dropCollection, dropIndexer, exists, flushSymbolTable, getBinary, getCanonicalDocumentName, getCanonicalDocumentName, getCanonicalName, getCollectionMeta, getCollectionRoot, getContainer, getDocument, getDocumentCount, getDocumentMeta, getDocumentSet, getEntry, getFiler, getIndexer, getIndexManager, getName, getObject, getParentCollection, getSymbols, insertBinary, insertBinary, insertDocument, insertDocument, insertObject, insertObject, isOpened, listDocuments, listIndexers, open, queryCollection, queryDocument, remove, setCanonicalName, setCollectionMeta, setCollectionRoot, setDocument, setDocumentMeta, setName, setObject, updateCollectionMeta, updateDocumentMeta
 
Methods inherited from class org.apache.xindice.core.CollectionManager
addCollection, countCollections, getCollection, getCollections, getConfig, listCollections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xindice.util.Named
getName
 
Methods inherited from interface org.apache.xindice.util.Configurable
getConfig
 

Field Detail

DBROOT

public static final String DBROOT

NAME

public static final String NAME

DBROOT_DEFAULT

public static final String DBROOT_DEFAULT
Constructor Detail

Database

public Database()
Method Detail

getDatabase

public static Database getDatabase(Configuration config)
This will return an instance of a Database for the given name if one has already been loaded, otherwise it will create a new instance.
Parameters:
config - Database configuration
Returns:
Database instance
Throws:
ConfigurationException - if database name is missing in the configuration

getDatabase

public static Database getDatabase(String name)
This will merely return an instance of a Database for the given name if one has already been loaded.
Parameters:
name - Database name
Returns:
Database

listDatabases

public static String[] listDatabases()

close

protected boolean close(boolean removeFromShutdown)
                 throws DBException
Checks to see if it has been closed to insure that it doesn't try to do it twice.
Parameters:
removeFromShutdown - If true removes its self from the shutdown hook
Returns:
true if closed
Throws:
DBException - if unable to close

close

public boolean close()
              throws DBException
Description copied from interface: DBObject
close closes the DBObject
Overrides:
close in class Collection
See Also:
DBObject.close(), close(boolean removeFromShutdown)

flushConfig

public void flushConfig()
flushConfig ensures that the Collection configuration has been properly flushed to disk after a modification.

getDatabase

public Database getDatabase()
Description copied from class: Collection
getDatabase returns the Database owner for this Collection.
Overrides:
getDatabase in class Collection
See Also:
Collection.getDatabase()

getDocumentCache

public DocumentCache getDocumentCache()
getDocumentCache returns the Database-level Document Cache.
Returns:
The DocumentCache

getMetaSystemCollection

public MetaSystemCollection getMetaSystemCollection()
Return the MetaSystem collection for this database. It will return null if metadata is not enabled on this database.
Returns:
MetaSystemCollection

getQueryEngine

public QueryEngine getQueryEngine()
getQueryEngine returns a reference to the Database's current operating QueryEngine implementation.
Overrides:
getQueryEngine in class Collection
Returns:
The QueryEngine instance

getSystemCollection

public SystemCollection getSystemCollection()
Description copied from class: Collection
getSystemCollection returns the System Collection.
Overrides:
getSystemCollection in class Collection
See Also:
Collection.getSystemCollection()

getTimer

protected Timer getTimer()
Return database's timer instance.
Returns:
Database timer instance

isMetaEnabled

public boolean isMetaEnabled()
Return whether or not metadata is enabled on this database.
Overrides:
isMetaEnabled in class Collection
Returns:
boolean

setConfig

public void setConfig(Configuration config)
               throws XindiceException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.
Overrides:
setConfig in class Collection
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.