|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xmldb.DatabaseImpl
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.
Field Summary | |
static java.lang.String |
CONF_XML
Default config filename to configure an Instance |
Constructor Summary | |
DatabaseImpl()
|
Method Summary | |
boolean |
acceptsURI(java.lang.String uri)
acceptsURI determines whether this Database implementation
can handle the URI. |
boolean |
acceptsURI(XmldbURI xmldbURI)
|
Collection |
getCollection(java.lang.String uri,
java.lang.String user,
java.lang.String password)
Retrieves a Collection instance based on the URI provided
in the uri parameter. |
Collection |
getCollection(XmldbURI xmldbURI,
java.lang.String user,
java.lang.String password)
|
java.lang.String |
getConformanceLevel()
Returns the XML:DB API Conformance level for the implementation. |
java.lang.String |
getName()
Returns the name associated with the Database instance. |
java.lang.String[] |
getNames()
Returns an array of names associated with the Database instance. |
java.lang.String |
getProperty(java.lang.String property)
Returns the value of the property identified by name . |
static Collection |
readCollection(java.lang.String c,
org.apache.xmlrpc.XmlRpcClient rpcClient)
|
void |
setDatabaseShutdownListener(ShutdownListener listener)
Register a ShutdownListener for the current database instance. |
void |
setProperty(java.lang.String property,
java.lang.String value)
Sets the property name to have the value provided in
value . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONF_XML
Constructor Detail |
public DatabaseImpl()
Method Detail |
public boolean acceptsURI(java.lang.String uri) throws XMLDBException
Database
Database
implementation
can handle the URI. It should return true
if the Database instance knows how to handle the URI and false otherwise.
acceptsURI
in interface Database
uri
- the URI to check for.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrroCodes.INVALID_URI
If the URI is not in a valid format. public boolean acceptsURI(XmldbURI xmldbURI) throws XMLDBException
XMLDBException
public Collection getCollection(java.lang.String uri, java.lang.String user, java.lang.String password) throws XMLDBException
Database
Collection
instance based on the URI provided
in the uri
parameter. The format of the URI is defined in the
documentation for DatabaseManager.getCollection().
Authentication is handled via username and password however it is not
required that the database support authentication. Databases that do not
support authentication MUST ignore the
username
and password
if those provided are not
null.
getCollection
in interface Database
uri
- the URI to use to locate the collection.password
- The password to use for authentication to the database or
null if the database does not support authentication.
Collection
instance for the requested collection or
null if the collection could not be found.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrroCodes.INVALID_URI
If the URI is not in a valid format. ErrroCodes.PERMISSION_DENIED
If the username
and password
were not accepted by the database.public Collection getCollection(XmldbURI xmldbURI, java.lang.String user, java.lang.String password) throws XMLDBException
XMLDBException
public static Collection readCollection(java.lang.String c, org.apache.xmlrpc.XmlRpcClient rpcClient) throws XMLDBException
XMLDBException
public void setDatabaseShutdownListener(ShutdownListener listener) throws XMLDBException
listener
-
XMLDBException
public java.lang.String getConformanceLevel() throws XMLDBException
Database
getConformanceLevel
in interface Database
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getName() throws XMLDBException
Database
getName
in interface Database
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String[] getNames() throws XMLDBException
Database
getNames
in interface Database
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getProperty(java.lang.String property) throws XMLDBException
Configurable
name
.
getProperty
in interface Configurable
property
- the name of the property to retrieve.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public void setProperty(java.lang.String property, java.lang.String value) throws XMLDBException
Configurable
name
to have the value provided in
value
.
setProperty
in interface Configurable
property
- the name of the property to set.value
- the value to set for the property.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |