Xindice API
version 1.2m1

org.apache.xindice.core
Class Database

java.lang.Object
  extended byorg.apache.xindice.core.CollectionManager
      extended byorg.apache.xindice.core.Collection
          extended byorg.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: 594145 $, $Date: 2007-11-12 08:58:46 -0500 (Mon, 12 Nov 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.
 boolean drop()
          Database can not be dropped.
 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 and load a new database 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, dropCollection, dropIndexer, exists, getBinary, getCanonicalDocumentName, getCanonicalDocumentName, getCanonicalName, getCollectionMeta, getCollectionRoot, getContainer, getDocument, getDocumentCount, getDocumentMeta, getDocumentSet, getEntry, getEntryMeta, getFiler, getIndexer, getIndexManager, getName, getObject, getParentCollection, getSymbols, insertBinary, insertBinary, insertDocument, insertDocument, insertObject, insertObject, isOpened, listDocuments, listIndexers, open, queryCollection, queryDocument, remove, setBinary, 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
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

DBROOT_DEFAULT

public static final String DBROOT_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Database

public Database()
Method Detail

getDatabase

public static Database getDatabase(Configuration config)
                            throws DBException
This will return an instance of a Database for the given name if one has already been loaded, otherwise it will create and load a new database instance.

Parameters:
config - Database configuration
Returns:
Database instance
Throws:
DBException - if database name is missing in the configuration, or unable to load a database.

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

Specified by:
close in interface DBObject
Overrides:
close in class Collection
Throws:
DBException
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
Returns:
The Database
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
Returns:
The System 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.

Specified by:
setConfig in interface Configurable
Overrides:
setConfig in class Collection
Throws:
XindiceException
See Also:
Configurable.setConfig(org.apache.xindice.util.Configuration)

drop

public boolean drop()
             throws DBException
Database can not be dropped.

Specified by:
drop in interface DBObject
Overrides:
drop in class Collection
Returns:
nothing.
Throws:
DBException - Always throws DBE_CANNOT_DROP fault code.
See Also:
DBObject.drop()

Xindice API
version 1.2m1

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