Package org.xmldb.api.base
Interface Database
-
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
DatabaseImpl
,SimpleDatabase
public interface Database extends Configurable
Database
is an encapsulation of the database driver functionality that is necessary to access an XML database. Each vendor must provide their own implmentation of theDatabase
interface. The implementation is registered with theDatabaseManager
to provide access to the resources of the XML database. In general usage client applications should only accessDatabase
implementations directly during initialization.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
acceptsURI(java.lang.String uri)
acceptsURI determines whether thisDatabase
implementation can handle the URI.Collection
getCollection(java.lang.String uri, java.lang.String username, java.lang.String password)
Retrieves aCollection
instance based on the URI provided in theuri
parameter.java.lang.String
getConformanceLevel()
Returns the XML:DB API Conformance level for the implementation.java.lang.String
getName()
Deprecated.Replaced by String[] getNames().java.lang.String[]
getNames()
Returns an array of names associated with the Database instance.-
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
-
-
-
-
Method Detail
-
getName
java.lang.String getName() throws XMLDBException
Deprecated.Replaced by String[] getNames().Returns the name associated with the Database instance.- Returns:
- the name of the object.
- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getNames
java.lang.String[] getNames() throws XMLDBException
Returns an array of names associated with the Database instance.- Returns:
- the array of name of the object.
- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getCollection
Collection getCollection(java.lang.String uri, java.lang.String username, java.lang.String password) throws XMLDBException
Retrieves aCollection
instance based on the URI provided in theuri
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 theusername
andpassword
if those provided are not null.- Parameters:
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.- Returns:
- A
Collection
instance for the requested collection or null if the collection could not be found. - Throws:
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 theusername
andpassword
were not accepted by the database.
-
acceptsURI
boolean acceptsURI(java.lang.String uri) throws XMLDBException
acceptsURI determines whether thisDatabase
implementation can handle the URI. It should return true if the Database instance knows how to handle the URI and false otherwise.- Parameters:
uri
- the URI to check for.- Returns:
- true if the URI can be handled, false otherwise.
- Throws:
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.
-
getConformanceLevel
java.lang.String getConformanceLevel() throws XMLDBException
Returns the XML:DB API Conformance level for the implementation. This can be used by client programs to determine what functionality is available to them.- Returns:
- the XML:DB API conformance level for this implementation.
- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
-