public abstract class SimpleDatabase extends SimpleConfigurable implements Database
Database implementation intended to be used as a base
class for a specific implementation.
Extending classes MUST set INSTANCE_NAME and SHOULD set CONFORMANCE_LEVEL to
values appropriate for their specific implementation.| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CONFORMANCE_LEVEL
The XML:DB API Core Level Conformance of this implementation.
|
protected static java.lang.String |
INSTANCE_NAME
Name used in the uri for collections associated with this instance.
|
| Constructor and Description |
|---|
SimpleDatabase() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsURI(java.lang.String uri)
acceptsURI determines whether this
Database implementation
can handle the URI. |
Collection |
getCollection(java.lang.String uri,
java.lang.String username,
java.lang.String password)
Retrieves a
Collection instance based on the URI provided
in the uri parameter. |
java.lang.String |
getConformanceLevel()
Returns the XML:DB API Conformance level for the implementation.
|
java.lang.String |
getName()
Returns the name associated with the Configurable object.
|
getProperty, setPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProperty, setPropertyprotected static java.lang.String INSTANCE_NAME
protected static java.lang.String CONFORMANCE_LEVEL
public java.lang.String getName()
throws XMLDBException
getName in interface DatabaseXMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.public Collection getCollection(java.lang.String uri, java.lang.String username, java.lang.String password) throws XMLDBException
Collection instance based on the URI provided
in the uri parameter. Implementations must override this
method.getCollection in interface Databaseuri - 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 instanceXMLDBException - 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 boolean acceptsURI(java.lang.String uri)
throws XMLDBException
Database implementation
can handle the URI.acceptsURI in interface Databaseuri - 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 java.lang.String getConformanceLevel()
throws XMLDBException
getConformanceLevel in interface DatabaseXMLDBException - with expected error codes.ErrorCodes.VENDOR_ERROR for any vendor
specific errors that occur.