org.sixdml.excelon
Class xlnSixdmlDatabase

java.lang.Object
  |
  +--org.sixdml.excelon.xlnSixdmlDatabase
All Implemented Interfaces:
Configurable, Database, SixdmlDatabase

public class xlnSixdmlDatabase
extends Object
implements SixdmlDatabase

  
 xlnSixdmlDatabase.java

 The database object that represents an interface to the eXcelon DXE database. It represents an 
 XMLStore whose name is "sixdml".
 
 Created: Sat Jan 12 02:15:15 2002
 

Version:
1.0
Author:
Dare Obasanjo

Field Summary
private  org.sixdml.excelon.xlnSixdmlCollection dbRoot
          The root collection of the database.
private  HashMap properties
          This is the table of properties for the needed by the Configurable interface.
private  com.exln.dxe.Session session
          A session provides the context in which an application can access XMLStores.
private  com.exln.dxe.XMLStore xmlStore
          The underlying eXcelon DXE XMLStore where this database is stored.
 
Constructor Summary
xlnSixdmlDatabase()
          Initializes the class.
 
Method Summary
 boolean acceptsURI(String uri)
          Determines whether this Database implementation can handle the URI.
 org.sixdml.dbmanagement.SixdmlIndex createIndex(String name, HashMap indexFields)
          Creates an index with a name, an indexFields table and an underlying DXE database.
 Collection getCollection(String uri, String username, String password)
          Retrieves a Collection instance based on the URI provided in the uri parameter.
 String getConformanceLevel()
          Returns the XML:DB API Conformance level for the implementation.
 String getName()
          Returns the name associated with the Database instance.
 String getProperty(String name)
          Returns the value of the property identified by name.
 Resource getResource(String uri, String username, String password)
          Gets the specified resource from the database.
 Service getService(String name, String version)
          Returns all the top level documents and collections in the database.
 Service[] getServices()
          Provides a list of all services known to the collection.
 org.sixdml.dbmanagement.SixdmlIndexType[] getSupportedIndexTypes()
          Gets the types of index that are supported by the this database.
 org.sixdml.transform.SixdmlTransformType[] getSupportedTransformTypes()
          Gets the types of transforms that are supported by the this database.
static void main(String[] args)
          Main used for testing class.
 void setProperty(String name, String value)
          Sets the property name to have the value provided in value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbRoot

private org.sixdml.excelon.xlnSixdmlCollection dbRoot
The root collection of the database.


session

private com.exln.dxe.Session session
A session provides the context in which an application can access XMLStores. An application needs a session to do anything with DXE


xmlStore

private com.exln.dxe.XMLStore xmlStore
The underlying eXcelon DXE XMLStore where this database is stored.


properties

private HashMap properties
This is the table of properties for the needed by the Configurable interface.

See Also:
Configurable
Constructor Detail

xlnSixdmlDatabase

public xlnSixdmlDatabase()
Initializes the class.

Method Detail

createIndex

public org.sixdml.dbmanagement.SixdmlIndex createIndex(String name,
                                                       HashMap indexFields)
                                                throws UnsupportedIndexTypeException
Creates an index with a name, an indexFields table and an underlying DXE database.
NOTE: Runtime error may occur if table not properly populated.

Specified by:
createIndex in interface SixdmlDatabase
Parameters:
name - the name of the index.
indexFields - the index fields for the class.
Throws:
XMLDBException - if an error occurs.
UnsupportedIndexTypeException - if the type of index requested is unsupported by the database.

getProperty

public String getProperty(String name)
Returns the value of the property identified by name.

Specified by:
getProperty in interface Configurable
Returns:
the value of the property or null if there is no matching value for the key in hash table.

setProperty

public void setProperty(String name,
                        String value)
Sets the property name to have the value provided in value.

Specified by:
setProperty in interface Configurable
Parameters:
name - the name of the property to set.
value - the value to set for the property.

getResource

public Resource getResource(String uri,
                            String username,
                            String password)
Gets the specified resource from the database. This implementation does not support authentication.

Specified by:
getResource in interface SixdmlDatabase
Parameters:
uri - the name or path to the resource to obtain.
username - The username to use for authentication to the database or null if the database does not support authentication.
password - The password to use for authentication to the database or null if the database does not support authentication.
Returns:
the requested resource.

getSupportedIndexTypes

public org.sixdml.dbmanagement.SixdmlIndexType[] getSupportedIndexTypes()
Gets the types of index that are supported by the this database.

Specified by:
getSupportedIndexTypes in interface SixdmlDatabase
Returns:
an array of SixdmlIndexTypes which the database supports.
Throws:
XMLDBException - if an error occurs.

getSupportedTransformTypes

public org.sixdml.transform.SixdmlTransformType[] getSupportedTransformTypes()
Gets the types of transforms that are supported by the this database.

Specified by:
getSupportedTransformTypes in interface SixdmlDatabase
Returns:
an array of SixdmlTransformTypes which the database supports.
Throws:
XMLDBException - if an error occurs.

getName

public String getName()
Returns the name associated with the Database instance.

Specified by:
getName in interface Database
Returns:
the name of the database instance.

getConformanceLevel

public String getConformanceLevel()
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 Database
Returns:
XML:DB API conformance level for this implementation.

acceptsURI

public boolean acceptsURI(String uri)
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. In this implementation it checks to see if the target of the URI exists in the DB, this may not be what is meant for this method to do.

Specified by:
acceptsURI in interface Database
Parameters:
uri - the URI to check for.
Returns:
true if the URI can be handled, false otherwise

getCollection

public Collection getCollection(String uri,
                                String username,
                                String password)
Retrieves a Collection instance based on the URI provided in the uri parameter. This implementation does not support authentication.

Specified by:
getCollection in interface Database
Parameters:
uri - the URI to use to locate the collection.
username - The username to use for authentication to the database or null if the database does not support authentication.
password - The password to use for authentication to the database or null if the database does not support authentication.
Returns:
the requested vollection.
Throws:
XMLDBException - if no such collection exists

getService

public Service getService(String name,
                          String version)
Returns all the top level documents and collections in the database.

Specified by:
getService in interface SixdmlDatabase
Parameters:
name - the name of the service to return.
version - the version number of the service to return.
Returns:
an array containing the names of all the top level /** Returns a Service instance for the requested service name and version. If no Service exists for those parameters a null value is returned. The only valid name and version number for this implementation are "XSLT" and "1.0" respectively.

getServices

public Service[] getServices()
Provides a list of all services known to the collection. If no services are known an empty list is returned.

Specified by:
getServices in interface SixdmlDatabase
Returns:
An array of registered Service implementations.

main

public static void main(String[] args)
                 throws Exception
Main used for testing class.

Parameters:
args - IGNORED
Exception