org.apache.xindice.client.xmldb.xmlrpc
Class DatabaseImpl
java.lang.Object
|
+--org.apache.xindice.client.xmldb.CommonConfigurable
|
+--org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl
- All Implemented Interfaces:
- org.xmldb.api.base.Configurable, org.xmldb.api.base.Database
- public class DatabaseImpl
- extends CommonConfigurable
- implements org.xmldb.api.base.Database
implements XML:DB's Database
interface using XML-RPC to
communicate with the Xindice server.
Note this class is a database driver, and one class of this database
could be used to connect to many different databases.
- Version:
- CVS $Revision: 1.17 $, $Date: 2003/08/16 03:47:36 $
- Author:
- James Bates
Method Summary |
boolean |
acceptsURI(java.lang.String uri)
Determines whether this Database implementation can handle
the URI. |
org.xmldb.api.base.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 prefix used in XML:DB to denote URI's that this driver can
handle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xmldb.api.base.Configurable |
getProperty, setProperty |
DatabaseImpl
public DatabaseImpl()
throws org.xmldb.api.base.XMLDBException
- Create a new DatabaseImpl object.
DatabaseImpl
public DatabaseImpl(CommonConfigurable config)
throws org.xmldb.api.base.XMLDBException
- Create a new DatabaseImpl object with a copy of the properties
from the DatabaseImpl parameter.
- Parameters:
config
- from which the initial parameters for this
DatabaseImpl object are copied.
acceptsURI
public boolean acceptsURI(java.lang.String uri)
throws org.xmldb.api.base.XMLDBException
- Determines whether this
Database
implementation can handle
the URI. It should return true if the Database instance knows how to
handle the URI and false otherwise.
- Specified by:
acceptsURI
in interface org.xmldb.api.base.Database
- Parameters:
uri
- the URI to check for.- Returns:
- true if the URI can be handled, false otherwise.
- Throws:
org.xmldb.api.base.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.
getCollection
public org.xmldb.api.base.Collection getCollection(java.lang.String uri,
java.lang.String userName,
java.lang.String password)
throws org.xmldb.api.base.XMLDBException
- Retrieves a
Collection
instance based on the URI provided
in the uri
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 the
username
and password
if those provided are not
null.
- Specified by:
getCollection
in interface org.xmldb.api.base.Database
- 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:
org.xmldb.api.base.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 the username
and password
were not accepted by the database.
getName
public java.lang.String getName()
throws org.xmldb.api.base.XMLDBException
- Returns the prefix used in XML:DB to denote URI's that this driver can
handle.
- Specified by:
getName
in interface org.xmldb.api.base.Database
- Returns:
- the prefix driver name
- Throws:
org.xmldb.api.base.XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
getConformanceLevel
public java.lang.String getConformanceLevel()
throws org.xmldb.api.base.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.
- Specified by:
getConformanceLevel
in interface org.xmldb.api.base.Database
- Returns:
- the XML:DB API conformance level for this implementation.
- Throws:
org.xmldb.api.base.XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
Copyright (c) 1999-2003 The Apache Software Foundation. All Rights Reserved.