Package org.xmldb.api.sdk
Class SimpleDatabase
- java.lang.Object
-
- org.xmldb.api.sdk.SimpleConfigurable
-
- org.xmldb.api.sdk.SimpleDatabase
-
- All Implemented Interfaces:
Configurable
,Database
- Direct Known Subclasses:
DatabaseImpl
public abstract class SimpleDatabase extends SimpleConfigurable implements Database
SimpleDatabase
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.
-
-
Constructor Summary
Constructors Constructor Description SimpleDatabase()
-
Method Summary
All Methods Instance Methods Concrete 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()
Returns the name associated with the Configurable object.java.lang.String[]
getNames()
Returns an array of names associated with the Database instance.-
Methods inherited from class org.xmldb.api.sdk.SimpleConfigurable
getProperty, setProperty
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
-
-
-
-
Method Detail
-
getName
public java.lang.String getName() throws XMLDBException
Returns the name associated with the Configurable object.- Specified by:
getName
in interfaceDatabase
- Returns:
- the name of the object.
- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getNames
public java.lang.String[] getNames() throws XMLDBException
Description copied from interface:Database
Returns an array of names associated with the Database instance.- Specified by:
getNames
in interfaceDatabase
- 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
public 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. Implementations must override this method.- Specified by:
getCollection
in interfaceDatabase
- 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:
- The
Collection
instance - 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
public boolean acceptsURI(java.lang.String uri) throws XMLDBException
acceptsURI determines whether thisDatabase
implementation can handle the URI.- Specified by:
acceptsURI
in interfaceDatabase
- 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
public java.lang.String getConformanceLevel() throws XMLDBException
Returns the XML:DB API Conformance level for the implementation.- Specified by:
getConformanceLevel
in interfaceDatabase
- 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.
-
-