Package org.xmldb.api.reference
Class DatabaseImpl
java.lang.Object
org.xmldb.api.sdk.SimpleConfigurable
org.xmldb.api.sdk.SimpleDatabase
org.xmldb.api.reference.DatabaseImpl
- All Implemented Interfaces:
Configurable,Database
Reference Database implmentation. The reference Database simply resides on
the file system. It isn't speedy but it serves the purpose of illustrating
how a driver should work..
The path where the data files are located is specified through the property
xmldb.data.dir. If this property is not specified it defaults to a directory
named data in the current working directory. If the directory does not exist
an attempt will be made to create it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCollection(String uri, String username, String password) Retrieves aCollectioninstance based on the URI provided in theuriparameter.Methods inherited from class org.xmldb.api.sdk.SimpleDatabase
acceptsURI, getConformanceLevel, getName, getNamesMethods 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
-
DatabaseImpl
public DatabaseImpl()
-
-
Method Details
-
getCollection
Retrieves aCollectioninstance based on the URI provided in theuriparameter. The URI format for this implementation is ref:///path where path is a path in the file system. To locate the data files the database expects a directory data to exist in the current directory.- Specified by:
getCollectionin interfaceDatabase- Overrides:
getCollectionin classSimpleDatabase- 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.
-