Data Resource Configuration
Data resource configuration involves
specifying information about a data resource including its location,
its metadata and its driver classes. Configuration is done using a
data resource configuration document.
Data resource configuration documents are written by OGSA-DAI service
deployers.
A data resource configuration document includes information on the
following:
-
The location of the data resource and the database or collection
within that data resource to be exposed.
-
The type of the data resource being exposed e.g. a MySQL or Xindice
database.
-
The database driver used to manage connections with the data resource.
-
Information to allow metadata to be extracted dynamically from the data
resource (e.g. database schema).
-
The location of a role map document specifying authorisation
information for the data resource.
For the remainder of this page we give an overview of the general
format of data resource configuration documents. In the following
pages we give examples of how they are used to expose different types
of data resource.
Example
<?xml version="1.0" encoding="UTF-8"?>
<dataResourceConfig
xmlns="http://ogsadai.org.uk/namespaces/2005/03/config">
<documentation>
This is an example data resource configuration document for a
MySQL relational data resource.
</documentation>
<!-- Metadata about the data resource -->
<metaData>
<!-- This element and its contents are optional. -->
<productInfo>
<productName>MySQL</productName>
<productVersion>4</productVersion>
<vendorName>MySQL</vendorName>
</productInfo>
<relationalMetaData>
<databaseSchema callback="uk.org.ogsadai.dataresource.SimpleJDBCMetaDataExtractor"/>
</relationalMetaData>
<!-- Custom metadata -->
<keywordlist>
<keyword> frogs <keyword>
<keyword> genome <keyword>
</keywordlist>
</metaData>
<!-- Data resource authorisation information - Role Map -->
<roleMap name="Name"
implementation="uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper"
configuration="SomeDataResource/DatabaseRoles.xml"/>
<!-- Manager of the connection to the DBMS -->
<dataResource
implementation="uk.org.ogsadai.dataresource.conx.SimpleJDBCConnectionManager">
<driver implementation="org.gjt.mm.mysql.Driver">
<uri>jdbc:mysql://localhost:3306/ogsadai</uri>
</driver>
</dataResource>
</dataResourceConfig>
Specification
Element dataResourceConfig:
-
Element documentation
(zero or more) -
human-readable description of the data resource.
-
Element metaData (required) - data resource metadata that
can be accessed by clients via OGSA-DAI services.
-
Element productInfo (optional) - description
of the data resource product.
-
Element productName (required) - name.
-
Element productVersion (required) - version.
-
Element vendorName (required) - vendor.
-
One of the following two elements:
-
Element relationalMetaData (optional) -
information to facilitate extraction of dynamic metadata from a
relational data resource.
-
Element databaseSchema (required) - the
database schema.
-
Attribute callback (required) - Java class
that performs the metadata extraction.
-
Arbitrary XML content for publication.
-
Element xmlMetaData (optional) - for
information to facilitate extraction of dynamic meta-data from an XML
data resource.
-
Element collectionSchema (required) - the
collection schema.
-
Attribute callback (required) - Java class
that performs the metadata extraction.
-
Application-specific XML metadata.
-
Application-specific metadata. The name of the element can be used by
clients to access this metadata.
-
Element roleMap (one or more) -
information on authorising client access to the data resource:
-
Attribute name (optional) - name for this
particular entry.
-
Attribute implementation (required) - Java
class that implements role mapping:
-
OGSA-DAI provides two role mapper classes which you can use:
-
uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper
- this expects role map documents to be in a standard OGSA-DAI format which is described later.
-
uk.org.ogsadai.common.rolemap.SimpleFileWithEncryptedPasswordsRoleMapper - this expects role map documents to be in a standard OGSA-DAI format which is described later.
-
Attribute configuration (optional) -
location of a role map configuration document. This can be a relative
or absolute path. Relative pathnames will be resolved against the home directory of the web application of a Web services hosting container, for example
CONTAINER/webapps/ogsa.
-
If one of the two OGSA-DAI role map classes are used then a value for
the configuration attribute must be given and this must be consistent
with the OGSA-DAI standard role map document formats (which are
described later in this guide).
-
Element dataResource
(required) - element which specifies the database driver and related
information:
-
Attribute name (optional) - name for this
particular entry.
-
Attribute implementation (required)
- Java wrapper class for the database driver. This class will use the
database driver class supplied in the driver
element to manage access to a data resource.
-
This class must sub-class the uk.org.ogsadai.dataresource.conx.ConnectionManager
class.
-
OGSA-DAI provides:
-
SimpleJDBCConnectionManager for
JDBC drivers.
-
XMLDBConnectionManager for XMLDB
drivers.
-
FileSystemConnectionManager for
file accesses.
-
Element driver (required) - information on the
database driver.
-
Attribute implementation (required) -
Java database driver class.
-
Element uri
(required) - URI used by the database driver to connect to the
database.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/data_resource_config.xsd