org.exist.xmldb
Class DatabaseImpl

java.lang.Object
  extended by org.exist.xmldb.DatabaseImpl
All Implemented Interfaces:
Configurable, Database

public class DatabaseImpl
extends Object
implements Database

The XMLDB driver class for eXist. This driver manages two different internal implementations. The first communicates with a remote database using the XMLRPC protocol. The second has direct access to an embedded database instance running in the same virtual machine. The driver chooses an implementation depending on the XML:DB URI passed to getCollection(). When running in embedded mode, the driver can create a new database instance if none is available yet. It will do so if the property "create-database" is set to "true" or if there is a system property "exist.initdb" with value "true". You may optionally provide the location of an alternate configuration file through the "configuration" property. The driver is also able to address different database instances - which may have been installed at different places.

Author:
Wolfgang Meier

Field Summary
static String CONF_XML
          Default config filename to configure an Instance
 
Constructor Summary
DatabaseImpl()
           
 
Method Summary
 boolean acceptsURI(String uri)
           
 boolean acceptsURI(XmldbURI xmldbURI)
           
 Collection getCollection(String uri, String user, String password)
           
 Collection getCollection(XmldbURI xmldbURI, String user, String password)
           
 String getConformanceLevel()
           
 String getName()
          Deprecated.  
 String[] getNames()
           
 String getProperty(String property)
           
static Collection readCollection(String c, XmlRpcClient rpcClient)
           
 void setDatabaseShutdownListener(ShutdownListener listener)
          Register a ShutdownListener for the current database instance.
 void setProperty(String property, String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_XML

public static final String CONF_XML
Default config filename to configure an Instance

See Also:
Constant Field Values
Constructor Detail

DatabaseImpl

public DatabaseImpl()
Method Detail

acceptsURI

public boolean acceptsURI(String uri)
                   throws XMLDBException
Specified by:
acceptsURI in interface Database
Throws:
XMLDBException

acceptsURI

public boolean acceptsURI(XmldbURI xmldbURI)
                   throws XMLDBException
Throws:
XMLDBException

getCollection

public Collection getCollection(String uri,
                                String user,
                                String password)
                         throws XMLDBException
Specified by:
getCollection in interface Database
Throws:
XMLDBException

getCollection

public Collection getCollection(XmldbURI xmldbURI,
                                String user,
                                String password)
                         throws XMLDBException
Throws:
XMLDBException

readCollection

public static Collection readCollection(String c,
                                        XmlRpcClient rpcClient)
                                 throws XMLDBException
Throws:
XMLDBException

setDatabaseShutdownListener

public void setDatabaseShutdownListener(ShutdownListener listener)
                                 throws XMLDBException
Register a ShutdownListener for the current database instance. The ShutdownListener is called after the database has shut down. You have to register a listener before any calls to getCollection().

Parameters:
listener -
Throws:
XMLDBException

getConformanceLevel

public String getConformanceLevel()
                           throws XMLDBException
Specified by:
getConformanceLevel in interface Database
Throws:
XMLDBException

getName

public String getName()
               throws XMLDBException
Deprecated. 

Specified by:
getName in interface Database
Throws:
XMLDBException

getNames

public String[] getNames()
                  throws XMLDBException
Specified by:
getNames in interface Database
Throws:
XMLDBException

getProperty

public String getProperty(String property)
                   throws XMLDBException
Specified by:
getProperty in interface Configurable
Throws:
XMLDBException

setProperty

public void setProperty(String property,
                        String value)
                 throws XMLDBException
Specified by:
setProperty in interface Configurable
Throws:
XMLDBException


Copyright (C) The eXist-db Project. All rights reserved.