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
Simple
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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURI(String uri) acceptsURI determines whether thisDatabaseimplementation can handle the URI.getCollection(String uri, String username, String password) Retrieves aCollectioninstance based on the URI provided in theuriparameter.Returns the XML:DB API Conformance level for the implementation.getName()Returns the name associated with the Configurable object.String[]getNames()Returns an array of names associated with the Database instance.Methods inherited from class org.xmldb.api.sdk.SimpleConfigurable
getProperty, setPropertyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
-
Constructor Details
-
SimpleDatabase
public SimpleDatabase()
-
-
Method Details
-
getName
Returns the name associated with the Configurable object.- Specified by:
getNamein interfaceDatabase- Returns:
- the name of the object.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getNames
Description copied from interface:DatabaseReturns an array of names associated with the Database instance.- Specified by:
getNamesin interfaceDatabase- Returns:
- the array of name of the object.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getCollection
Retrieves aCollectioninstance based on the URI provided in theuriparameter. Implementations must override this method.- Specified by:
getCollectionin 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
Collectioninstance - Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
ErrroCodes.INVALID_URIIf the URI is not in a valid format.
ErrroCodes.PERMISSION_DENIEDIf theusernameandpasswordwere not accepted by the database.
-
acceptsURI
acceptsURI determines whether thisDatabaseimplementation can handle the URI.- Specified by:
acceptsURIin 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_ERRORfor any vendor specific errors that occur.
ErrroCodes.INVALID_URIIf the URI is not in a valid format.
-
getConformanceLevel
Returns the XML:DB API Conformance level for the implementation.- Specified by:
getConformanceLevelin interfaceDatabase- Returns:
- the XML:DB API conformance level for this implementation.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-