Xindice API

org.apache.xindice.client.xmldb
Class DatabaseImpl

java.lang.Object
  |
  +--org.apache.xindice.client.xmldb.CommonConfigurable
        |
        +--org.apache.xindice.client.xmldb.DatabaseImpl
All Implemented Interfaces:
Configurable, Database

public class DatabaseImpl
extends CommonConfigurable
implements Database

DatabaseImpl is the XML:DB driver implementation for Xindice. It is the entry point into the Xindice server but is not intended for direct use by users. Users access it indirectly through the XML:DB DatabaseManager implementation. This API is an implementation of the XML:DB API. More information on this API can be found by looking at http://www.xmldb.org/xapi/index.html

The location to find the NamingService ior can be specified by setting the property xindice.naming.ior using setProperty. By default the system is bootstrapped via HTTP and doesn't use a CORBA naming service. The CORBA ORB implementation can be switched by setting the properties org.omg.CORBA.ORBClass and org.omg.CORBA.ORBSingletonClass with the values provided by your orb vendor. The values are set using setProperty().


Field Summary
static java.lang.String CONFORMANCE_LEVEL
          The XML:DB API Core Level Conformance of this implementation.
static java.lang.String CORBA_NAMING_PROP
          Property name to use to set the URI where a CORBA name service can be located.
static java.lang.String DEFAULT_BOOTSTRAP_URI
          Default location where the bootstrap IOR can be located.
static java.lang.String DEFAULT_CORBA_NAME
          Default CORBA name service name for the Database instance.
static java.lang.String INSTANCE_NAME
          Name used in the uri for collections associated with this instance.
static java.lang.String ORB_CLASS_PROP
          Property name to use to set the name of the ORB Class.
static java.lang.String ORB_SINGLETON_CLASS_PROP
          Property name to use to set the name of the ORB singleton Class.
static java.lang.String SEP
          The characters expected to separate the INSTANCE_NAME from the database name.
 
Constructor Summary
DatabaseImpl()
          Constructor for the DatabaseImpl object
 
Method Summary
 boolean acceptsURI(java.lang.String uri)
          Used by org.xmldb.api.base.DatabaseManager to determine if this database instance is the proper one to handle a request or not.
 Collection getCollection(java.lang.String uri, java.lang.String username, java.lang.String password)
          Creates a Collection instance using the URI to locate the collection in the Xindice instance.
 java.lang.String getConformanceLevel()
          Gets the ConformanceLevel attribute of the DatabaseImpl object
 java.lang.String getName()
          Gets the instance Name
 
Methods inherited from class org.apache.xindice.client.xmldb.CommonConfigurable
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
 

Field Detail

INSTANCE_NAME

public static java.lang.String INSTANCE_NAME
Name used in the uri for collections associated with this instance.

SEP

public static java.lang.String SEP
The characters expected to separate the INSTANCE_NAME from the database name.

CONFORMANCE_LEVEL

public static java.lang.String CONFORMANCE_LEVEL
The XML:DB API Core Level Conformance of this implementation.

DEFAULT_CORBA_NAME

public static final java.lang.String DEFAULT_CORBA_NAME
Default CORBA name service name for the Database instance.

DEFAULT_BOOTSTRAP_URI

public static final java.lang.String DEFAULT_BOOTSTRAP_URI
Default location where the bootstrap IOR can be located.

CORBA_NAMING_PROP

public static final java.lang.String CORBA_NAMING_PROP
Property name to use to set the URI where a CORBA name service can be located.

ORB_CLASS_PROP

public static final java.lang.String ORB_CLASS_PROP
Property name to use to set the name of the ORB Class. This is used to override the JDKs built in CORBA ORB.

ORB_SINGLETON_CLASS_PROP

public static final java.lang.String ORB_SINGLETON_CLASS_PROP
Property name to use to set the name of the ORB singleton Class. This is used to override the JDKs built in CORBA ORB.
Constructor Detail

DatabaseImpl

public DatabaseImpl()
Constructor for the DatabaseImpl object
Method Detail

getName

public java.lang.String getName()
                         throws XMLDBException
Gets the instance Name
Specified by:
getName in interface Database
Returns:
The Name value
Throws:
XMLDBException -  

getCollection

public Collection getCollection(java.lang.String uri,
                                java.lang.String username,
                                java.lang.String password)
                         throws XMLDBException
Creates a Collection instance using the URI to locate the collection in the Xindice instance. Applications should not call this method directly. Instead they should call org.xmldb.api.base.DatabaseManager.getCollection().

The URI format accepted by this method: xindice:/[Nameservice host]//[Database Instance Name in the CORBA Name Service]/[collection path]

Nameservice host is optional. This usually looks something like this: xindice:///db/root/ocs. or xindice://some.host.com:8309/db/root/ocs

When you pass the URI to DatabaseManager.getCollection(uri) you must prepend an xmldb: to the beginning to make it a valid XML:DB URI. So to normal users of the API URIs will look like this: xmldb:xindice:///db/root/ocs. DatabaseManager will strip the xmldb: before handing the URI to this getCollection implementation.

Specified by:
getCollection in interface Database
Parameters:
uri - The URI specifing the location of the collection.
Returns:
The Collection value
Throws:
XMLDBException -  

getConformanceLevel

public java.lang.String getConformanceLevel()
                                     throws XMLDBException
Gets the ConformanceLevel attribute of the DatabaseImpl object
Specified by:
getConformanceLevel in interface Database
Returns:
The ConformanceLevel value
Throws:
XMLDBException - Description of Exception

acceptsURI

public boolean acceptsURI(java.lang.String uri)
                   throws XMLDBException
Used by org.xmldb.api.base.DatabaseManager to determine if this database instance is the proper one to handle a request or not.
Specified by:
acceptsURI in interface Database
Parameters:
uri - The uri to test - see getCollection for a description of the format.
Returns:
true if the URI can be handled, false otherwise.
Throws:
XMLDBException -  

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation